store

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layout added in v0.1.5

type Layout struct {
	*content.OCI
	Root string
	// contains filtered or unexported fields
}

func NewLayout added in v0.1.5

func NewLayout(rootdir string, opts ...Options) (*Layout, error)

func (*Layout) AddOCI added in v0.1.5

func (l *Layout) AddOCI(ctx context.Context, oci artifacts.OCI, ref string) (ocispec.Descriptor, error)

AddOCI adds an artifacts.OCI to the store

The method to achieve this is to save artifact.OCI to a temporary directory in an OCI layout compatible form.  Once
saved, the entirety of the layout is copied to the store (which is just a registry).  This allows us to not only use
strict types to define generic content, but provides a processing pipeline suitable for extensibility.  In the
future we'll allow users to define their own content that must adhere either by artifact.OCI or simply an OCI layout.

func (*Layout) AddOCICollection added in v0.1.5

func (l *Layout) AddOCICollection(ctx context.Context, collection artifacts.OCICollection) ([]ocispec.Descriptor, error)

AddOCICollection .

func (*Layout) Copy added in v0.1.5

func (l *Layout) Copy(ctx context.Context, ref string, to target.Target, toRef string) (ocispec.Descriptor, error)

Copy will copy a given reference to a given target.Target

This is essentially a wrapper around oras.Copy, but locked to this content store

func (*Layout) CopyAll added in v0.1.5

func (l *Layout) CopyAll(ctx context.Context, to target.Target, toMapper func(string) (string, error)) ([]ocispec.Descriptor, error)

CopyAll performs bulk copy operations on the stores oci layout to a provided target.Target

func (*Layout) Flush added in v0.1.5

func (l *Layout) Flush(ctx context.Context) error

Flush is a fancy name for delete-all-the-things, in this case it's as trivial as deleting oci-layout content

This can be a highly destructive operation if the store's directory happens to be inline with other non-store contents
To reduce the blast radius and likelihood of deleting things we don't own, Flush explicitly deletes oci-layout content only

func (*Layout) Identify added in v0.1.5

func (l *Layout) Identify(ctx context.Context, desc ocispec.Descriptor) string

Identify is a helper function that will identify a human-readable content type given a descriptor

type Options added in v0.1.5

type Options func(*Layout)

func WithCache added in v0.1.5

func WithCache(c layer.Cache) Options

Jump to

Keyboard shortcuts

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