image

package
v1.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAllMetadata

func WithAllMetadata(s *Store)

Types

type CredentialHelper

type CredentialHelper interface {
	GetCredentials(ctx context.Context, ref, host string) (Credentials, error)
}

From stream

type Credentials

type Credentials struct {
	Host     string
	Username string
	Secret   string
	Header   string
}

type OCIRegistry

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

OCI

func NewOCIRegistry

func NewOCIRegistry(ref string, headers http.Header, creds CredentialHelper) *OCIRegistry

Initialize with hosts, authorizer callback, and headers

func (*OCIRegistry) Fetcher

func (r *OCIRegistry) Fetcher(ctx context.Context, ref string) (transfer.Fetcher, error)

func (*OCIRegistry) Image

func (r *OCIRegistry) Image() string

func (*OCIRegistry) MarshalAny

func (r *OCIRegistry) MarshalAny(ctx context.Context, sm streaming.StreamCreator) (typeurl.Any, error)

func (*OCIRegistry) Pusher

func (*OCIRegistry) Resolve

func (r *OCIRegistry) Resolve(ctx context.Context) (name string, desc ocispec.Descriptor, err error)

func (*OCIRegistry) String

func (r *OCIRegistry) String() string

func (*OCIRegistry) UnmarshalAny

func (r *OCIRegistry) UnmarshalAny(ctx context.Context, sm streaming.StreamGetter, a typeurl.Any) error

type Store

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

func NewStore

func NewStore(image string, opts ...StoreOpt) *Store

NewStore creates a new image store source or Destination

func (*Store) Get

func (is *Store) Get(ctx context.Context, store images.Store) (images.Image, error)

func (*Store) ImageFilter

func (is *Store) ImageFilter(h images.HandlerFunc, cs content.Store) images.HandlerFunc

func (*Store) MarshalAny

func (*Store) Store

func (is *Store) Store(ctx context.Context, desc ocispec.Descriptor, store images.Store) (images.Image, error)

func (*Store) String

func (is *Store) String() string

func (*Store) UnmarshalAny

func (is *Store) UnmarshalAny(ctx context.Context, sm streaming.StreamGetter, a typeurl.Any) error

func (*Store) UnpackPlatforms

func (is *Store) UnpackPlatforms() []unpack.Platform

type StoreOpt

type StoreOpt func(*Store)

StoreOpt defines options when configuring an image store source or destination

func WithDigestRefs

func WithDigestRefs(always bool) StoreOpt

WithDigestRefs sets digest refs for imported images, if always is enabled, then digest refs are added even if a non-digest image name is added for the same image.

func WithImageLabels

func WithImageLabels(labels map[string]string) StoreOpt

WithImageLabels are the image labels to apply to a new image

func WithManifestLimit

func WithManifestLimit(limit int) StoreOpt

WithManifestLimit defines the max number of manifests to fetch

func WithNamePrefix

func WithNamePrefix(prefix string, check bool) StoreOpt

WithNamePrefix sets the name prefix for imported images, if check is enabled, then only images with the prefix are stored.

func WithPlatforms

func WithPlatforms(p ...ocispec.Platform) StoreOpt

WithPlatforms specifies which platforms to fetch content for

func WithUnpack

func WithUnpack(p ocispec.Platform, snapshotter string) StoreOpt

WithUnpack specifies a platform to unpack for and an optional snapshotter to use

type UnpackConfiguration

type UnpackConfiguration struct {
	Platform    ocispec.Platform
	Snapshotter string
}

UnpackConfiguration specifies the platform and snapshotter to use for resolving the unpack Platform, if snapshotter is not specified the platform default will be used.

Jump to

Keyboard shortcuts

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