oci

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMirrorConfiguration

func AddMirrorConfiguration(ctx context.Context, fs afero.Fs, configPath string, registryURLs, mirrorURLs []url.URL, resolveTags, appendToBackup bool) error

Refer to containerd registry configuration documentation for mor information about required configuration. https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-configuration---examples

Types

type Client

type Client interface {
	Name() string
	Verify(ctx context.Context) error
	Subscribe(ctx context.Context) (<-chan ImageEvent, <-chan error, error)
	ListImages(ctx context.Context) ([]Image, error)
	AllIdentifiers(ctx context.Context, img Image) ([]string, error)
	Resolve(ctx context.Context, ref string) (digest.Digest, error)
	Size(ctx context.Context, dgst digest.Digest) (int64, error)
	GetManifest(ctx context.Context, dgst digest.Digest) ([]byte, string, error)
	GetBlob(ctx context.Context, dgst digest.Digest) (io.ReadCloser, error)
	// Deprecated: Use GetBlob.
	CopyLayer(ctx context.Context, dgst digest.Digest, dst io.Writer) error
}

type Containerd

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

func NewContainerd

func NewContainerd(sock, namespace, registryConfigPath string, registries []url.URL, opts ...Option) (*Containerd, error)

func (*Containerd) AllIdentifiers

func (c *Containerd) AllIdentifiers(ctx context.Context, img Image) ([]string, error)

func (*Containerd) Client

func (c *Containerd) Client() (*containerd.Client, error)

func (*Containerd) CopyLayer

func (c *Containerd) CopyLayer(ctx context.Context, dgst digest.Digest, dst io.Writer) error

func (*Containerd) GetBlob

func (c *Containerd) GetBlob(ctx context.Context, dgst digest.Digest) (io.ReadCloser, error)

func (*Containerd) GetManifest

func (c *Containerd) GetManifest(ctx context.Context, dgst digest.Digest) ([]byte, string, error)

func (*Containerd) ListImages

func (c *Containerd) ListImages(ctx context.Context) ([]Image, error)

func (*Containerd) Name

func (c *Containerd) Name() string

func (*Containerd) Resolve

func (c *Containerd) Resolve(ctx context.Context, ref string) (digest.Digest, error)

func (*Containerd) Size

func (c *Containerd) Size(ctx context.Context, dgst digest.Digest) (int64, error)

func (*Containerd) Subscribe

func (c *Containerd) Subscribe(ctx context.Context) (<-chan ImageEvent, <-chan error, error)

func (*Containerd) Verify

func (c *Containerd) Verify(ctx context.Context) error

type EventType

type EventType string
const (
	CreateEvent  EventType = "CREATE"
	UpdateEvent  EventType = "UPDATE"
	DeleteEvent  EventType = "DELETE"
	UnknownEvent EventType = ""
)

type Image

type Image struct {
	Name       string
	Registry   string
	Repository string
	Tag        string
	Digest     digest.Digest
}

func NewImage

func NewImage(name, registry, repository, tag string, dgst digest.Digest) (Image, error)

func Parse

func Parse(s string, extraDgst digest.Digest) (Image, error)

func (Image) IsLatestTag

func (i Image) IsLatestTag() bool

func (Image) String

func (i Image) String() string

func (Image) TagName

func (i Image) TagName() (string, bool)

type ImageEvent

type ImageEvent struct {
	Image Image
	Type  EventType
}

type MockClient

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

func NewMockClient

func NewMockClient(images []Image) *MockClient

func (*MockClient) AllIdentifiers

func (m *MockClient) AllIdentifiers(ctx context.Context, img Image) ([]string, error)

func (*MockClient) CopyLayer

func (m *MockClient) CopyLayer(ctx context.Context, dgst digest.Digest, dst io.Writer) error

func (*MockClient) GetBlob

func (m *MockClient) GetBlob(ctx context.Context, dgst digest.Digest) (io.ReadCloser, error)

func (*MockClient) GetManifest

func (m *MockClient) GetManifest(ctx context.Context, dgst digest.Digest) ([]byte, string, error)

func (*MockClient) ListImages

func (m *MockClient) ListImages(ctx context.Context) ([]Image, error)

func (*MockClient) Name

func (m *MockClient) Name() string

func (*MockClient) Resolve

func (m *MockClient) Resolve(ctx context.Context, ref string) (digest.Digest, error)

func (*MockClient) Size

func (m *MockClient) Size(ctx context.Context, dgst digest.Digest) (int64, error)

func (*MockClient) Subscribe

func (m *MockClient) Subscribe(ctx context.Context) (<-chan ImageEvent, <-chan error, error)

func (*MockClient) Verify

func (m *MockClient) Verify(ctx context.Context) error

type Option added in v0.0.22

type Option func(*Containerd)

func WithContentPath added in v0.0.22

func WithContentPath(path string) Option

type UnknownDocument

type UnknownDocument struct {
	MediaType string `json:"mediaType,omitempty"`
}

Jump to

Keyboard shortcuts

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