content

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(data []byte) (schema.ObjectKind, error)

Types

type OCI

type OCI struct {
	// contains filtered or unexported fields
}

func NewOCI

func NewOCI(root string) (*OCI, error)

func (*OCI) AddIndex

func (o *OCI) AddIndex(desc ocispec.Descriptor) error

AddIndex adds a descriptor to the index and updates it

The descriptor must use AnnotationRefName to identify itself

func (*OCI) Fetch

func (o *OCI) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)

func (*OCI) FetchManifest

func (o *OCI) FetchManifest(ctx context.Context, manifest ocispec.Manifest) (io.ReadCloser, error)

func (*OCI) Fetcher

func (o *OCI) Fetcher(ctx context.Context, ref string) (remotes.Fetcher, error)

Fetcher returns a new fetcher for the provided reference. All content fetched from the returned fetcher will be from the namespace referred to by ref.

func (*OCI) LoadIndex

func (o *OCI) LoadIndex() error

LoadIndex will load the index from disk

func (*OCI) Pusher

func (o *OCI) Pusher(ctx context.Context, ref string) (remotes.Pusher, error)

Pusher returns a new pusher for the provided reference The returned Pusher should satisfy content.Ingester and concurrent attempts to push the same blob using the Ingester API should result in ErrUnavailable.

func (*OCI) Resolve

func (o *OCI) Resolve(ctx context.Context, ref string) (name string, desc ocispec.Descriptor, err error)

Resolve attempts to resolve the reference into a name and descriptor.

The argument `ref` should be a scheme-less URI representing the remote. Structurally, it has a host and path. The "host" can be used to directly reference a specific host or be matched against a specific handler.

The returned name should be used to identify the referenced entity. Dependending on the remote namespace, this may be immutable or mutable. While the name may differ from ref, it should itself be a valid ref.

If the resolution fails, an error will be returned.

func (*OCI) SaveIndex

func (o *OCI) SaveIndex() error

SaveIndex will update the index on disk

func (*OCI) Walk

func (o *OCI) Walk(fn func(reference string, desc ocispec.Descriptor) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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