Regc.Artifact (regc v0.0.2)

View Source

OCI artifact push, streamed pull, and copy operations.

Artifact payloads use the OCI artifact manifest and are exposed as verified Regc.Blob.Reader resources when pulled. Call close/1 when a pulled artifact is not fully consumed.

Summary

Functions

Closes every payload reader in a pulled artifact.

Copies an OCI artifact manifest and its payload blobs between backends.

Pulls an OCI artifact manifest and opens a verified reader for each payload.

Uploads payloads and publishes an OCI artifact manifest.

Types

t()

@type t() :: %Regc.Artifact{
  blobs: [Regc.Artifact.Content.t()],
  manifest: Regc.Oci.Manifest.t()
}

Functions

close(artifact)

@spec close(t()) :: :ok

Closes every payload reader in a pulled artifact.

copy(client, source, target, opts \\ [])

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

Copies an OCI artifact manifest and its payload blobs between backends.

pull(client, reference, opts \\ [])

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

Pulls an OCI artifact manifest and opens a verified reader for each payload.

Set fetch_blobs: false to retrieve only the decoded artifact manifest.

push(client, reference, blobs, opts \\ [])

@spec push(
  Regc.Client.t(),
  String.t() | Regc.Oci.Reference.t(),
  [term()],
  keyword()
) :: {:ok, Regc.Manifest.Metadata.t()} | {:error, Regc.Error.t()}

Uploads payloads and publishes an OCI artifact manifest.

blobs accepts {media_type, source}, {media_type, source, annotations}, or maps containing :media_type and :source. A map may also include an expected :descriptor and descriptor :annotations.

Required options:

  • :artifact_type - media type describing the artifact

Optional values include :subject (a descriptor, manifest, or reference), manifest :annotations, and keyword :blob_options/:manifest_options.