Documentation ¶
Index ¶
- Variables
- func FetchSociArtifacts(ctx context.Context, refspec reference.Spec, indexDesc ocispec.Descriptor, ...) (*soci.Index, error)
- func NewFilesystem(ctx context.Context, root string, cfg config.Config, opts ...Option) (_ snapshot.FileSystem, err error)
- func SelectFirstPolicy(descs []ocispec.Descriptor) (ocispec.Descriptor, error)
- type Archive
- type Fetcher
- type IndexSelectionPolicy
- type Inner
- type OCIArtifactClient
- type Option
- type ReferrersCaller
- type ReferrersClient
- type Unpacker
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoReferrers = errors.New("no existing referrers")
)
Functions ¶
func FetchSociArtifacts ¶
func NewFilesystem ¶
func SelectFirstPolicy ¶
func SelectFirstPolicy(descs []ocispec.Descriptor) (ocispec.Descriptor, error)
Types ¶
type Archive ¶
type Archive interface { // Apply decompresses the compressed stream represented by reader `r` and // applies it to the directory `root`. Apply(ctx context.Context, root string, r io.Reader, opts ...archive.ApplyOpt) (int64, error) }
func NewLayerArchive ¶
func NewLayerArchive() Archive
type Fetcher ¶
type Fetcher interface { // Fetch fetches the artifact identified by the descriptor. It first checks the local content store // and returns a `ReadCloser` from there. Otherwise it fetches from the remote, saves in the local content store // and then returns a `ReadCloser`. Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, bool, error) // Store takes in a descriptor and io.Reader and stores it in the local store. Store(ctx context.Context, desc ocispec.Descriptor, reader io.Reader) error }
type IndexSelectionPolicy ¶
type IndexSelectionPolicy func([]ocispec.Descriptor) (ocispec.Descriptor, error)
Determines which index will be selected from a list of index descriptors
type Inner ¶
type Inner interface { content.Storage ReferrersCaller }
type OCIArtifactClient ¶
type OCIArtifactClient struct {
Inner
}
func NewOCIArtifactClient ¶
func NewOCIArtifactClient(inner Inner) *OCIArtifactClient
func (*OCIArtifactClient) AllReferrers ¶
func (c *OCIArtifactClient) AllReferrers(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error)
func (*OCIArtifactClient) SelectReferrer ¶
func (c *OCIArtifactClient) SelectReferrer(ctx context.Context, desc ocispec.Descriptor, fn IndexSelectionPolicy) (ocispec.Descriptor, error)
type Option ¶
type Option func(*options)
func WithGetSources ¶
func WithGetSources(s source.GetSources) Option
func WithMetadataStore ¶
func WithOverlayOpaqueType ¶
func WithOverlayOpaqueType(overlayOpaqueType layer.OverlayOpaqueType) Option
type ReferrersCaller ¶
type ReferrersCaller interface {
Referrers(ctx context.Context, desc ocispec.Descriptor, artifactType string, fn func(referrers []ocispec.Descriptor) error) error
}
Interface for oras-go's Repository.Referrers call, for mocking
type ReferrersClient ¶
type ReferrersClient interface { /// Takes in an manifest descriptor and IndexSelectionPolicy and returns a single artifact descriptor. /// Returns an error (ErrNoReferrers) if the manifest descriptor has no referrers. SelectReferrer(context.Context, ocispec.Descriptor, IndexSelectionPolicy) (ocispec.Descriptor, error) }
Responsible for making Referrers API calls to remote registry to fetch list of referrers.
type Unpacker ¶
type Unpacker interface { // Unpack takes care of getting the layer specified by descriptor `desc`, // decompressing it, putting it in the directory with the path `mountpoint` // and applying the difference to the parent layers if there is any. // After that the layer can be mounted as non-remote snapshot. Unpack(ctx context.Context, desc ocispec.Descriptor, mountpoint string, mounts []mount.Mount) error }
func NewLayerUnpacker ¶
Click to show internal directories.
Click to hide internal directories.