Regc.Oci.Transport behaviour (regc v0.0.2)

View Source

Behaviour for custom registry HTTP transports.

A transport performs one request and returns either a Regc.Oci.Transport.Response, a response-shaped map, or an error. Regc handles registry status codes and bearer authentication around the transport.

Implementations should honor the request body and response mode, use the configured timeouts, and apply equivalent redirect and network-target protections if they follow redirects themselves. A transport that retries or redirects a request must respect body replayability.

Existing transports may continue reading request.max_body_bytes during the compatibility period. Regc.Oci.Transport.Request.response_mode/1 resolves both forms.

Summary

Types

result()

@type result() :: {:ok, Regc.Oci.Transport.Response.t() | map()} | {:error, term()}

Callbacks

request(t, t)

Functions

retryable_error?(reason)

@spec retryable_error?(term()) :: boolean()

user_agent()

@spec user_agent() :: String.t()