Documentation
¶
Overview ¶
Package oci wraps oras-go for agentfile use: authenticated remote repositories, manifest/index resolution, blob fetching, and a Puller abstraction that extracts a bin layer from an image.
Index ¶
- func AgentFetcher(opts ...RemoteRepositoryOption) func(ctx context.Context, ref spec.Reference) (*spec.Agentfile, error)
- func FetchBlobBytes(ctx context.Context, fetcher content.Fetcher, desc v1.Descriptor) ([]byte, error)
- func NewRemoteRepository(ref spec.Reference, opts ...RemoteRepositoryOption) (*remote.Repository, error)
- func ParseTag(ref spec.Reference) string
- func ResolveManifest(ctx context.Context, fetcher content.Fetcher, desc v1.Descriptor) (*v1.Manifest, error)
- func WithPlainHTTP(repo *remote.Repository)
- type Puller
- type RemoteRepositoryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentFetcher ¶
func AgentFetcher( opts ...RemoteRepositoryOption, ) func(ctx context.Context, ref spec.Reference) (*spec.Agentfile, error)
AgentFetcher returns a resolve.Fetcher that pulls agent artifacts from OCI registries.
func FetchBlobBytes ¶
func FetchBlobBytes(ctx context.Context, fetcher content.Fetcher, desc v1.Descriptor) ([]byte, error)
FetchBlobBytes reads the blob identified by desc from fetcher into memory. Accepts any content.Fetcher so it can be exercised against in-memory stores in tests as well as remote repositories.
func NewRemoteRepository ¶
func NewRemoteRepository(ref spec.Reference, opts ...RemoteRepositoryOption) (*remote.Repository, error)
NewRemoteRepository constructs an oras remote.Repository bound to ref, wired up with Docker credential resolution.
func ResolveManifest ¶
func ResolveManifest(ctx context.Context, fetcher content.Fetcher, desc v1.Descriptor) (*v1.Manifest, error)
ResolveManifest fetches the blob at desc and parses it as a v1.Manifest. If the blob is a v1.Index, a platform-appropriate child manifest is selected and resolved recursively.
func WithPlainHTTP ¶
func WithPlainHTTP(repo *remote.Repository)
WithPlainHTTP configures the repository to use HTTP instead of HTTPS. Suitable for local/dev registries only.
Types ¶
type Puller ¶
func NoopPuller ¶
func NoopPuller() Puller
func RemotePuller ¶
func RemotePuller(opts ...RemoteRepositoryOption) Puller
type RemoteRepositoryOption ¶
type RemoteRepositoryOption func(*remote.Repository)
RemoteRepositoryOption mutates a remote repository at construction time.