oci

package
v3.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// ResolveRevision resolves a tag, digest, or semantic version constraint to a concrete digest.
	// If noCache is true, the resolution bypasses the local tags cache and queries the remote registry.
	// If the revision is already a digest, it is returned as-is.
	ResolveRevision(ctx context.Context, revision string, noCache bool) (string, error)

	// DigestMetadata retrieves an OCI manifest for a given digest.
	DigestMetadata(ctx context.Context, digest string) (*imagev1.Manifest, error)

	// CleanCache is invoked on a hard-refresh or when the manifest cache has expired. This removes the OCI image from
	// the cached path, which is looked up by the specified revision.
	CleanCache(revision string) error

	// Extract retrieves and unpacks the contents of an OCI image identified by the specified revision.
	// If successful, the extracted contents are extracted to a randomized tempdir.
	Extract(ctx context.Context, revision string) (string, utilio.Closer, error)

	// TestRepo verifies the connectivity and accessibility of the repository.
	TestRepo(ctx context.Context) (bool, error)

	// GetTags retrieves the list of tags for the repository.
	GetTags(ctx context.Context, noCache bool) ([]string, error)
}

Client is a generic OCI client interface that provides methods for interacting with an OCI (Open Container Initiative) registry.

func NewClient

func NewClient(repoURL string, creds Creds, proxy, noProxy string, layerMediaTypes []string, opts ...ClientOpts) (Client, error)

func NewClientWithLock

func NewClientWithLock(repoURL string, creds Creds, repoLock sync.KeyLock, proxyURL, noProxy string, layerMediaTypes []string, opts ...ClientOpts) (Client, error)

type ClientOpts

type ClientOpts func(c *nativeOCIClient)

func WithDisableManifestMaxExtractedSize

func WithDisableManifestMaxExtractedSize(disableManifestMaxExtractedSize bool) ClientOpts

func WithEventHandlers added in v3.3.0

func WithEventHandlers(handlers EventHandlers) ClientOpts

WithEventHandlers sets the git client event handlers

func WithImagePaths

func WithImagePaths(repoCachePaths utilio.TempPaths) ClientOpts

func WithIndexCache

func WithIndexCache(indexCache tagsCache) ClientOpts

func WithManifestMaxExtractedSize

func WithManifestMaxExtractedSize(manifestMaxExtractedSize int64) ClientOpts

type Creds

type Creds struct {
	Username           string
	Password           string
	CAPath             string
	CertData           []byte
	KeyData            []byte
	InsecureSkipVerify bool
	InsecureHTTPOnly   bool
}

type EventHandlers added in v3.3.0

type EventHandlers struct {
	OnExtract             func(repo string) func()
	OnResolveRevision     func(repo string) func()
	OnDigestMetadata      func(repo string) func()
	OnTestRepo            func(repo string) func()
	OnGetTags             func(repo string) func()
	OnExtractFail         func(repo string) func(revision string)
	OnResolveRevisionFail func(repo string) func(revision string)
	OnDigestMetadataFail  func(repo string) func(revision string)
	OnTestRepoFail        func(repo string) func()
	OnGetTagsFail         func(repo string) func()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL