Regc.Blob (regc v0.0.2)
View SourceGeneric registry blob operations.
Blob bodies are returned as incrementally verified Regc.Blob.Reader
resources and are never forced into one binary by this API.
Summary
Functions
Copies a verified blob between repositories or configured backends.
Deletes a blob by digest.
Attempts a server-side cross-repository mount.
Uploads a blob with monolithic or resumable chunked transfer.
Functions
@spec copy( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), String.t() | Regc.Oci.Reference.t(), Regc.Oci.Descriptor.t() | map(), keyword() ) :: :ok | {:error, Regc.Error.t()}
Copies a verified blob between repositories or configured backends.
The target is checked first. For compatible backends, Regc attempts a server-side mount before streaming the source into the target. The source reader is always closed, and the target upload is finalized only after the source digest and size have been verified.
The optional :progress callback receives the regular blob upload events,
plus a :skipped event when the target already contains the blob and a
:mounted event after a server-side copy.
@spec delete( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), Regc.Oci.Descriptor.t() | map(), keyword() ) :: :ok | {:error, Regc.Error.t()}
Deletes a blob by digest.
@spec get( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), Regc.Oci.Descriptor.t() | map(), keyword() ) :: {:ok, Regc.Blob.Reader.t()} | {:error, Regc.Error.t()}
@spec head( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), Regc.Oci.Descriptor.t() | map(), keyword() ) :: {:ok, Regc.Blob.Metadata.t()} | {:error, Regc.Error.t()}
@spec mount( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), String.t() | Regc.Oci.Reference.t(), Regc.Oci.Descriptor.t() | map(), keyword() ) :: :ok | {:error, Regc.Error.t()}
Attempts a server-side cross-repository mount.
@spec put( Regc.Client.t(), String.t() | Regc.Oci.Reference.t(), binary() | {:iodata, iodata()} | {:stream, Enumerable.t()} | {:factory, (-> Enumerable.t())}, keyword() ) :: {:ok, Regc.Oci.Descriptor.t()} | {:error, Regc.Error.t()}
Uploads a blob with monolithic or resumable chunked transfer.
Binary and {:iodata, data} sources are replayable. One-shot enumerables
should be wrapped as {:stream, enumerable}; replayable producers use
{:factory, fun}. Pass a known descriptor with :descriptor, or let Regc
compute a SHA-256 descriptor during upload.