Regc.Blob (regc v0.0.2)

View Source

Generic 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

copy(client, source_repository, target_repository, descriptor, opts \\ [])

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.

delete(client, repository, descriptor, opts \\ [])

@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.

get(client, repository, descriptor, opts \\ [])

head(client, repository, descriptor, opts \\ [])

mount(client, target_repository, source_repository, descriptor, opts \\ [])

Attempts a server-side cross-repository mount.

put(client, repository, source, opts \\ [])

@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.