content

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 28 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalProvider

func NewLocalProvider(
	workDir string,
	threshold string,
	hosts remote.HostFunc,
	platformMC platforms.MatchComparer,
) (Provider, *Content, error)

Types

type Content added in v0.2.5

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

func NewContent added in v0.2.5

func NewContent(contentDir string, databaseDir string, threshold string) (*Content, error)

NewContent return content support by content store, bolt database and threshold. content store created in contentDir and bolt database created in databaseDir. content.db supported by bolt database and content store.

func (*Content) Abort added in v0.2.6

func (content *Content) Abort(ctx context.Context, ref string) error

func (*Content) Delete added in v0.2.6

func (content *Content) Delete(ctx context.Context, dgst digest.Digest) error

func (*Content) GC added in v0.2.5

func (content *Content) GC(ctx context.Context) error

GC clean the local caches by cfg.Provider.GCPolicy configuration

func (*Content) Info added in v0.2.6

func (content *Content) Info(ctx context.Context, dgst digest.Digest) (content.Info, error)

func (*Content) ListStatuses added in v0.2.6

func (content *Content) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error)

func (*Content) ReaderAt added in v0.2.6

func (content *Content) ReaderAt(ctx context.Context, desc ocispec.Descriptor) (content.ReaderAt, error)

func (*Content) Size added in v0.2.5

func (content *Content) Size() (int64, error)

Size return the size of local caches size

func (*Content) Status added in v0.2.6

func (content *Content) Status(ctx context.Context, ref string) (content.Status, error)

func (*Content) Update added in v0.2.6

func (content *Content) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error)

func (*Content) Walk added in v0.2.6

func (content *Content) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error

func (*Content) Writer added in v0.2.6

func (content *Content) Writer(ctx context.Context, opts ...content.WriterOpt) (content.Writer, error)

type LocalProvider

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

func (*LocalProvider) ContentStore

func (pvd *LocalProvider) ContentStore() content.Store

func (*LocalProvider) Image

func (pvd *LocalProvider) Image(ctx context.Context, ref string) (*ocispec.Descriptor, error)

func (*LocalProvider) Pull

func (pvd *LocalProvider) Pull(ctx context.Context, ref string) error

func (*LocalProvider) Push

func (pvd *LocalProvider) Push(ctx context.Context, desc ocispec.Descriptor, ref string) error

func (*LocalProvider) Resolver

func (pvd *LocalProvider) Resolver(ref string) (remotes.Resolver, error)

func (*LocalProvider) UsePlainHTTP added in v0.1.1

func (pvd *LocalProvider) UsePlainHTTP()

type Provider

type Provider interface {
	// Use plain HTTP to communicate with registry.
	UsePlainHTTP()

	// Resolve attempts to resolve the reference into a name and descriptor.
	Resolver(ref string) (remotes.Resolver, error)
	// Pull pulls source image from remote registry by specified reference.
	// This pulls all platforms of the image but Image() returns containerd.Image for
	// the default platform.
	Pull(ctx context.Context, ref string) error
	// Push pushes target image to remote registry by specified reference,
	// the desc parameter represents the manifest of targe image.
	Push(ctx context.Context, desc ocispec.Descriptor, ref string) error

	// Image gets the source image descriptor.
	Image(ctx context.Context, ref string) (*ocispec.Descriptor, error)
	// ContentStore gets the content store object of containerd.
	ContentStore() content.Store
}

Provider provides necessary image utils, image content store for image conversion.

Jump to

Keyboard shortcuts

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