ocidir

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package ocidir implements the OCI Image Layout scheme with a directory (not packed in a tar)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OCIDir

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

OCIDir is used for accessing OCI Image Layouts defined as a directory

func New

func New(opts ...Opts) *OCIDir

New creates a new OCIDir with options

func (*OCIDir) BlobDelete

func (o *OCIDir) BlobDelete(ctx context.Context, r ref.Ref, d descriptor.Descriptor) error

BlobDelete removes a blob from the repository. This method does not verify that blobs are unused. Calling the OCIDir.Close method to trigger the garbage collection is preferred.

func (*OCIDir) BlobGet

func (o *OCIDir) BlobGet(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)

BlobGet retrieves a blob, returning a reader

func (*OCIDir) BlobHead

func (o *OCIDir) BlobHead(ctx context.Context, r ref.Ref, d descriptor.Descriptor) (blob.Reader, error)

BlobHead verifies the existence of a blob, the reader contains the headers but no body to read

func (*OCIDir) BlobMount

func (o *OCIDir) BlobMount(ctx context.Context, refSrc ref.Ref, refTgt ref.Ref, d descriptor.Descriptor) error

BlobMount attempts to perform a server side copy of the blob

func (*OCIDir) BlobPut

BlobPut sends a blob to the repository, returns the digest and size when successful

func (*OCIDir) Close

func (o *OCIDir) Close(ctx context.Context, r ref.Ref) error

Close triggers a garbage collection if the underlying path has been modified

func (*OCIDir) GCLock added in v0.5.0

func (o *OCIDir) GCLock(r ref.Ref)

GCLock is used to prevent GC on a ref

func (*OCIDir) GCUnlock added in v0.5.0

func (o *OCIDir) GCUnlock(r ref.Ref)

GCUnlock removes a hold on GC of a ref, this must be done before the ref is closed

func (*OCIDir) ManifestDelete

func (o *OCIDir) ManifestDelete(ctx context.Context, r ref.Ref, opts ...scheme.ManifestOpts) error

ManifestDelete removes a manifest, including all tags that point to that manifest

func (*OCIDir) ManifestGet

func (o *OCIDir) ManifestGet(ctx context.Context, r ref.Ref) (manifest.Manifest, error)

ManifestGet retrieves a manifest from a repository

func (*OCIDir) ManifestHead

func (o *OCIDir) ManifestHead(ctx context.Context, r ref.Ref) (manifest.Manifest, error)

ManifestHead gets metadata about the manifest (existence, digest, mediatype, size)

func (*OCIDir) ManifestPut

func (o *OCIDir) ManifestPut(ctx context.Context, r ref.Ref, m manifest.Manifest, opts ...scheme.ManifestOpts) error

ManifestPut sends a manifest to the repository

func (*OCIDir) Ping added in v0.5.4

func (o *OCIDir) Ping(ctx context.Context, r ref.Ref) (ping.Result, error)

Ping for an ocidir verifies access to read the path.

func (*OCIDir) ReferrerList added in v0.4.3

func (o *OCIDir) ReferrerList(ctx context.Context, r ref.Ref, opts ...scheme.ReferrerOpts) (referrer.ReferrerList, error)

ReferrerList returns a list of referrers to a given reference

func (*OCIDir) TagDelete

func (o *OCIDir) TagDelete(ctx context.Context, r ref.Ref) error

TagDelete removes a tag from the repository

func (*OCIDir) TagList

func (o *OCIDir) TagList(ctx context.Context, r ref.Ref, opts ...scheme.TagOpts) (*tag.List, error)

TagList returns a list of tags from the repository

func (*OCIDir) Throttle added in v0.5.0

func (o *OCIDir) Throttle(r ref.Ref, put bool) []*throttle.Throttle

Throttle is used to limit concurrency

type Opts

type Opts func(*ociConf)

Opts are used for passing options to ocidir

func WithFS

func WithFS(fs rwfs.RWFS) Opts

WithFS allows the rwfs to be replaced The default is to use the OS, this can be used to sandbox within a folder This can also be used to pass an in-memory filesystem for testing or special use cases

func WithGC

func WithGC(gc bool) Opts

WithGC configures the garbage collection setting This defaults to enabled

func WithLog

func WithLog(log *logrus.Logger) Opts

WithLog provides a logrus logger By default logging is disabled

func WithThrottle added in v0.5.0

func WithThrottle(count int) Opts

WithThrottle provides a number of concurrent write actions (blob/manifest put)

Jump to

Keyboard shortcuts

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