The seam describing where images live, behind one uniform interface.
A transport instance is a struct (carrying its own config — a registry repository, a layout
path, a Store, …) whose module implements this behaviour. The functions in this module
dispatch to that module based on the struct, so callers (notably Stevedore.copy/3) work
against any transport interchangeably:
Stevedore.Transport.get_manifest(transport, "3.20")Implementations: Stevedore.Transport.Registry (docker://), Transport.OCILayout (oci:),
Transport.Dir (dir:), Transport.Archive (docker-archive:), and Transport.Static.
Spec: containers-transports(5).
Summary
Callbacks
Delete a manifest by tag or digest.
Flush any buffered state (e.g. emit a tar). Called once at the end of a copy.
Fetch a blob by digest.
Fetch a manifest (or index) by tag or digest.
Whether the blob is already present (lets copy skip it).
List tags held by this transport.
Store a blob (the implementation verifies it against digest).
Store raw manifest bytes, optionally tagged as ref. Returns the manifest digest.
Functions
Dispatch delete/2.
Dispatch finalize/1, or :ok for transports that don't define it.
Dispatch get_blob/2.
Dispatch get_manifest/2 to transport's implementation.
Dispatch has_blob?/2.
Dispatch list_tags/1.
Dispatch put_blob/3.
Types
@type fetched() :: %{ media_type: String.t(), digest: Stevedore.Digest.t(), raw: binary(), json: map() }
@type ref() :: String.t() | Stevedore.Digest.t() | nil
@type t() :: struct()
Callbacks
Delete a manifest by tag or digest.
Flush any buffered state (e.g. emit a tar). Called once at the end of a copy.
@callback get_blob(t(), Stevedore.Digest.t()) :: {:ok, binary()} | {:error, term()}
Fetch a blob by digest.
Fetch a manifest (or index) by tag or digest.
@callback has_blob?(t(), Stevedore.Digest.t()) :: boolean()
Whether the blob is already present (lets copy skip it).
List tags held by this transport.
@callback put_blob(t(), Stevedore.Digest.t(), iodata()) :: :ok | {:error, term()}
Store a blob (the implementation verifies it against digest).
@callback put_manifest(t(), ref(), raw :: binary(), media_type :: String.t()) :: {:ok, Stevedore.Digest.t()} | {:error, term()}
Store raw manifest bytes, optionally tagged as ref. Returns the manifest digest.
Functions
Dispatch delete/2.
Dispatch finalize/1, or :ok for transports that don't define it.
@spec get_blob(t(), Stevedore.Digest.t()) :: {:ok, binary()} | {:error, term()}
Dispatch get_blob/2.
Dispatch get_manifest/2 to transport's implementation.
@spec has_blob?(t(), Stevedore.Digest.t()) :: boolean()
Dispatch has_blob?/2.
Dispatch list_tags/1.
@spec put_blob(t(), Stevedore.Digest.t(), iodata()) :: :ok | {:error, term()}
Dispatch put_blob/3.
@spec put_manifest(t(), ref(), binary(), String.t()) :: {:ok, Stevedore.Digest.t()} | {:error, term()}
Dispatch put_manifest/4.