scheme

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package scheme defines the interface for various reference schemes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Info is experimental, do not use
	Info() Info

	// BlobDelete removes a blob from the repository
	BlobDelete(ctx context.Context, r ref.Ref, d digest.Digest) error
	// BlobGet retrieves a blob, returning a reader
	BlobGet(ctx context.Context, r ref.Ref, d digest.Digest) (blob.Reader, error)
	// BlobHead verifies the existence of a blob, the reader contains the headers but no body to read
	BlobHead(ctx context.Context, r ref.Ref, d digest.Digest) (blob.Reader, error)
	// BlobMount attempts to perform a server side copy of the blob
	BlobMount(ctx context.Context, refSrc ref.Ref, refTgt ref.Ref, d digest.Digest) error
	// BlobPut sends a blob to the repository, returns the digest and size when successful
	BlobPut(ctx context.Context, r ref.Ref, d digest.Digest, rdr io.Reader, cl int64) (digest.Digest, int64, error)

	// ManifestDelete removes a manifest, including all tags that point to that manifest
	ManifestDelete(ctx context.Context, r ref.Ref) error
	// ManifestGet retrieves a manifest from a repository
	ManifestGet(ctx context.Context, r ref.Ref) (manifest.Manifest, error)
	// ManifestHead gets metadata about the manifest (existence, digest, mediatype, size)
	ManifestHead(ctx context.Context, r ref.Ref) (manifest.Manifest, error)
	// ManifestPut sends a manifest to the repository
	ManifestPut(ctx context.Context, r ref.Ref, m manifest.Manifest, opts ...ManifestOpts) error

	// TagDelete removes a tag from the repository
	TagDelete(ctx context.Context, r ref.Ref) error
	// TagList returns a list of tags from the repository
	TagList(ctx context.Context, r ref.Ref, opts ...TagOpts) (*tag.List, error)
}

API is used to interface between different methods to store images

type Closer

type Closer interface {
	Close(ctx context.Context, r ref.Ref) error
}

Closer is used to check if a scheme implements the Close API

type Info

type Info struct {
	ManifestPushFirst bool
}

Info provides details on the scheme, this is experimental, do not use

type ManifestConfig

type ManifestConfig struct {
	Child bool // used when pushing a child of a manifest list, skips indexing in ocidir
}

ManifestConfig is used by schemes to import ManifestOpts

type ManifestOpts

type ManifestOpts func(*ManifestConfig)

ManifestOpts is used to set options on manifest APIs

func WithManifestChild

func WithManifestChild() ManifestOpts

WithManifestChild indicates the API call is on a child manifest This is used internally when copying multi-platform manifests This bypasses tracking of an untagged digest in ocidir which is needed for garbage collection

type RepoConfig

type RepoConfig struct {
	Limit int
	Last  string
}

RepoConfig is used by schemes to import RepoOpts

type RepoOpts

type RepoOpts func(*RepoConfig)

RepoOpts is used to set options on repo APIs

func WithRepoLast

func WithRepoLast(l string) RepoOpts

WithRepoLast passes the last received repository for requesting the next batch of repositories Registries may ignore this

func WithRepoLimit

func WithRepoLimit(l int) RepoOpts

WithRepoLimit passes a maximum number of repositories to return to the repository list API Registries may ignore this

type TagConfig

type TagConfig struct {
	Limit int
	Last  string
}

TagConfig is used by schemes to import TagOpts

type TagOpts

type TagOpts func(*TagConfig)

TagOpts is used to set options on tag APIs

func WithTagLast

func WithTagLast(last string) TagOpts

WithTagLast passes the last received tag for requesting the next batch of tags Registries may ignore this

func WithTagLimit

func WithTagLimit(limit int) TagOpts

WithTagLimit passes a maximum number of tags to return to the tag list API Registries may ignore this

Directories

Path Synopsis
Package ocidir implements the OCI Image Layout scheme with a directory (not packed in a tar)
Package ocidir implements the OCI Image Layout scheme with a directory (not packed in a tar)
Package reg implements the OCI registry scheme used by most images (host:port/repo:tag)
Package reg implements the OCI registry scheme used by most images (host:port/repo:tag)

Jump to

Keyboard shortcuts

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