containerd

package
v0.0.0-...-3231407 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultSock is the default containerd socket path.
	DefaultSock = "/run/containerd/containerd.sock"

	// DefaultNamespace is the default containerd namespace for this client.
	DefaultNamespace = "k8s.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Reference

type Reference interface {
	// Name is the name of the artifact.
	Name() string

	// Digest is the digest of the artifact.
	Digest() digest.Digest

	// Tag is the tag of the artifact.
	Tag() string

	// Repository is the repository of the artifact.
	Repository() string

	// Host is the host of the artifact.
	Host() string

	// String returns the string representation of the reference.
	// docker.io/library/ubuntu:latest
	// docker.io/library/ubuntu@sha256:abcdef
	String() string
}

Reference is a reference to an OCI artifact in the content store.

func ParseReference

func ParseReference(name string, targetDigest digest.Digest) (Reference, error)

ParseReference parses the given name into a reference. targetDigest is obtained from the containerd interface, and is used to verify the parsed digest, or to set the digest if it is not present.

type Store

type Store interface {
	// Subscribe returns a channel of artifacts and a channel of errors.
	// Artifacts are sent on the channel as they are discovered.
	Subscribe(ctx context.Context) (<-chan Reference, <-chan error)

	// List returns a list of artifacts.
	List(ctx context.Context) ([]Reference, error)

	// Resolve returns the digest for an existing artifact.
	Resolve(ctx context.Context, ref string) (digest.Digest, error)

	// Size returns the size of the artifact.
	Size(ctx context.Context, dgst digest.Digest) (int64, error)

	// Bytes returns the artifact bytes.
	Bytes(ctx context.Context, dgst digest.Digest) ([]byte, string, error)

	// Write writes the artifact bytes to the writer.
	Write(ctx context.Context, dst io.Writer, dgst digest.Digest) error

	// Verify will verify that the client status is healthy.
	Verify(ctx context.Context) error

	// All returns a list of digests of all resources referenced in ref.
	All(ctx context.Context, ref Reference) ([]string, error)
}

Store is the interface for all containerd content store artifacts.

func NewDefaultStore

func NewDefaultStore(hosts []string) (Store, error)

NewDefaultStore creates a new Store with default values for containerd socket, namespace and hosts configuration path.

func NewStore

func NewStore(sock, ns string, hosts []string) (Store, error)

NewStore creates a new Store.

Jump to

Keyboard shortcuts

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