Regc.Blob.Upload (regc v0.0.2)

View Source

Immutable state for a Distribution API blob upload.

Upload locations are validated when received from a registry. Each operation returns an updated value because a registry may rotate the location or report a new byte offset.

Summary

Types

t()

@type t() :: %Regc.Blob.Upload{
  endpoint: Regc.Oci.Reference.t(),
  location: String.t(),
  metadata: Regc.Registry.Metadata.t(),
  min_chunk_size: non_neg_integer() | nil,
  offset: non_neg_integer(),
  repository: Regc.Oci.Reference.t(),
  resolved_addresses: [Regc.Oci.Transport.Address.address()] | nil,
  status: :active | :complete | :cancelled,
  uuid: String.t() | nil
}

Functions

cancel(client, upload, opts \\ [])

@spec cancel(Regc.Client.t(), t(), keyword()) :: :ok | {:error, Regc.Error.t()}

chunk(client, upload, chunk, opts \\ [])

@spec chunk(Regc.Client.t(), t(), iodata(), keyword()) ::
  {:ok, t()} | {:error, Regc.Error.t()}

finalize(client, upload, digest, opts \\ [])

@spec finalize(Regc.Client.t(), t(), String.t(), keyword()) ::
  {:ok, Regc.Oci.Descriptor.t()} | {:error, Regc.Error.t()}

start(client, repository, opts \\ [])

@spec start(Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), keyword()) ::
  {:ok, t()} | {:error, Regc.Error.t()}

status(client, upload, opts \\ [])

@spec status(Regc.Client.t(), t(), keyword()) :: {:ok, t()} | {:error, Regc.Error.t()}