oci

package
v0.0.363 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConvertImagesToEstargz = false
View Source
var File_internal_artifacts_oci_types_proto protoreflect.FileDescriptor
View Source
var MergeOptimizer func(images []NamedImage) compute.Computable[Image]
View Source
var (
	UsePercentageInTracking = false
)

Functions

func AttachDigestToAction added in v0.0.108

func AttachDigestToAction(ctx context.Context, img Image)

func CacheLayer

func CacheLayer(ctx context.Context, c cache.Cache, layer v1.Layer) (schema.Digest, error)

func ComputeLayerCacheData

func ComputeLayerCacheData(layer v1.Layer) ([]byte, schema.Digest, error)

func DockerHubMirror added in v0.0.267

func DockerHubMirror() string

func ImageAsFS added in v0.0.124

func ImageAsFS(image v1.Image) tarfs.FS

func ImageP

func ImageP(ref string, platform *specs.Platform, opts RegistryAccess) compute.Computable[Image]

Returns a Computable which constraints on platform if one is specified.

func LoadCachedLayer

func LoadCachedLayer(ctx context.Context, c cache.Cache, h schema.Digest) (v1.Layer, schema.Digest, error)

func MakeImageIndex

func MakeImageIndex(images ...ImageWithPlatform) compute.Computable[ResolvableImage]

func MergeImageLayers

func MergeImageLayers(images ...NamedImage) compute.Computable[Image]

func ParseRef

func ParseRef(imageRef string, insecure bool) (name.Reference, error)

func ParseRefAndKeychain

func ParseRefAndKeychain(ctx context.Context, imageRef string, opts RegistryAccess) (name.Reference, []remote.Option, error)

func ParseTag

func ParseTag(tag RepositoryWithAccess, digest v1.Hash) (name.Tag, error)

func Prebuilt added in v0.0.94

func RefWithRegistryMirror added in v0.0.267

func RefWithRegistryMirror(ctx context.Context, imageRef name.Reference) (name.Reference, error)

func RegisterDomainKeychain

func RegisterDomainKeychain(suffix string, keychain Keychain, purpose KeychainWhen)

func RegisterImageCacheable

func RegisterImageCacheable()

func RemoteOptsWithAuth added in v0.0.124

func RemoteOptsWithAuth(ctx context.Context, access RegistryAccess, writeAccess bool) ([]remote.Option, error)

func ResolveImagePlatform added in v0.0.112

func ResolveImagePlatform(c compute.Computable[ResolvableImage], platform specs.Platform) compute.Computable[Image]

func VisitFilesFromImage

func VisitFilesFromImage(img v1.Image, visitor func(layer, path string, typ byte, contents []byte) error) error

Types

type HasToLayer

type HasToLayer interface {
	AsLayer() (v1.Layer, error)
}

type Image

type Image v1.Image

func Canonical

func Canonical(ctx context.Context, original Image) (Image, error)

func EnsureCached added in v0.0.108

func EnsureCached(ctx context.Context, img Image) (Image, error)

func FetchRemoteImage added in v0.0.117

func FetchRemoteImage(ctx context.Context, imageid ImageID, opts RegistryAccess) (Image, error)

func IngestFromFS

func IngestFromFS(ctx context.Context, fsys fs.FS, path string, compressed bool) (Image, error)

func WithCanonicalManifest

func WithCanonicalManifest(ctx context.Context, img Image) (Image, error)

type ImageID

type ImageID struct {
	Repository string `json:"repository"`
	Tag        string `json:"tag"`
	Digest     string `json:"digest"`
}

func ParseImageID

func ParseImageID(ref string) (ImageID, error)

func (ImageID) ComputeDigest

func (i ImageID) ComputeDigest(ctx context.Context) (schema.Digest, error)

func (ImageID) ImageRef

func (i ImageID) ImageRef() string

func (ImageID) RepoAndDigest

func (i ImageID) RepoAndDigest() string

func (ImageID) String

func (i ImageID) String() string

func (ImageID) WithDigest

func (i ImageID) WithDigest(d fmt.Stringer) ImageID

type ImageIndex

type ImageIndex v1.ImageIndex

type ImageSource added in v0.0.89

type ImageSource interface {
	GetSourceLabel() string
	GetSourcePackageRef() *schema.PackageRef
}

type ImageWithPlatform

type ImageWithPlatform struct {
	Image    NamedImage
	Platform specs.Platform
}

type Keychain

type Keychain interface {
	Resolve(context.Context, authn.Resource) (authn.Authenticator, error)
}

type KeychainWhen

type KeychainWhen int
const (
	Keychain_UseAlways KeychainWhen = iota
	Keychain_UseOnWrites
)

type Layer

type Layer v1.Layer

func LayerFromFS

func LayerFromFS(ctx context.Context, vfs fs.FS) (Layer, error)

func RawZstdLayerFrom added in v0.0.351

func RawZstdLayerFrom(file string, mediaType types.MediaType) (Layer, error)

type NamedImage

type NamedImage interface {
	ResourceDescription[Image]
	Image() compute.Computable[Image]
}

func LocalCopy

func LocalCopy(input NamedImage) NamedImage

func MakeImage

func MakeImage(description string, base NamedImage, layers ...NamedLayer) NamedImage

func MakeImageFromScratch

func MakeImageFromScratch(description string, layers ...NamedLayer) NamedImage

func MakeNamedImage

func MakeNamedImage(description string, image compute.Computable[Image]) NamedImage

func ResolveImage

func ResolveImage(ref string, platform specs.Platform) NamedImage

func Scratch

func Scratch() NamedImage

type NamedImageID

type NamedImageID interface {
	ResourceDescription[ImageID]
	ImageID() compute.Computable[ImageID]
}

func MakeNamedImageID

func MakeNamedImageID(description string, imageID compute.Computable[ImageID]) NamedImageID

func ResolveDigest

func ResolveDigest(ref string, opts RegistryAccess) NamedImageID

Resolves the image tag into a digest. If one is already specified, this is a no-op.

type NamedLayer

type NamedLayer interface {
	ResourceDescription[Layer]
	Layer() compute.Computable[Layer]
}

func LayerFromFile

func LayerFromFile(description string, vfs fs.FS, path string) NamedLayer

func MakeLayer

func MakeLayer(name string, vfs compute.Computable[fs.FS]) NamedLayer

func MakeNamedLayer

func MakeNamedLayer(description string, layer compute.Computable[Layer]) NamedLayer

type RawDescriptor

type RawDescriptor struct {
	Repository  string `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	MediaType   string `protobuf:"bytes,2,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
	RawManifest []byte `protobuf:"bytes,3,opt,name=raw_manifest,json=rawManifest,proto3" json:"raw_manifest,omitempty"`
	RawConfig   []byte `protobuf:"bytes,4,opt,name=raw_config,json=rawConfig,proto3" json:"raw_config,omitempty"` // Only available when the descriptor points at an image.
	// contains filtered or unexported fields
}

func (*RawDescriptor) Descriptor deprecated

func (*RawDescriptor) Descriptor() ([]byte, []int)

Deprecated: Use RawDescriptor.ProtoReflect.Descriptor instead.

func (*RawDescriptor) GetMediaType

func (x *RawDescriptor) GetMediaType() string

func (*RawDescriptor) GetRawConfig

func (x *RawDescriptor) GetRawConfig() []byte

func (*RawDescriptor) GetRawManifest

func (x *RawDescriptor) GetRawManifest() []byte

func (*RawDescriptor) GetRepository

func (x *RawDescriptor) GetRepository() string

func (*RawDescriptor) ProtoMessage

func (*RawDescriptor) ProtoMessage()

func (*RawDescriptor) ProtoReflect

func (x *RawDescriptor) ProtoReflect() protoreflect.Message

func (*RawDescriptor) Reset

func (x *RawDescriptor) Reset()

func (*RawDescriptor) String

func (x *RawDescriptor) String() string

type RawImageWithPlatform added in v0.0.199

type RawImageWithPlatform struct {
	Image    Image
	Platform specs.Platform
}

type RegistryAccess added in v0.0.103

type RegistryAccess struct {
	InsecureRegistry bool
	PublicImage      bool
	Keychain         Keychain
	Transport        *registry.RegistryTransport
}

type RemoteProgress

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

func (*RemoteProgress) FormatProgress

func (rp *RemoteProgress) FormatProgress() string

func (*RemoteProgress) Track

func (rp *RemoteProgress) Track() remote.Option

type RepositoryWithAccess added in v0.0.124

type RepositoryWithAccess struct {
	RegistryAccess
	Repository string
	UserTag    string
}

type RepositoryWithParent added in v0.0.124

type RepositoryWithParent struct {
	Parent interface{}
	RepositoryWithAccess
}

func (RepositoryWithParent) ComputeDigest added in v0.0.124

func (t RepositoryWithParent) ComputeDigest(context.Context) (schema.Digest, error)

type ResolvableImage

type ResolvableImage interface {
	Digest() (schema.Digest, error)
	Image() (Image, error)
	ImageForPlatform(specs.Platform) (Image, error)
	ImageIndex() (ImageIndex, error)
	Push(context.Context, RepositoryWithAccess, bool) (v1.Hash, error)
	// contains filtered or unexported methods
}

func RawAsResolvable

func RawAsResolvable(img Image) ResolvableImage

func RawMakeIndex added in v0.0.199

func RawMakeIndex(images ...RawImageWithPlatform) (ResolvableImage, error)

type ResourceDescription

type ResourceDescription[V any] interface {
	Description() string
}

type TargetRewritter

type TargetRewritter interface {
	CheckRewriteLocalUse(RepositoryWithAccess) *RepositoryWithAccess
}

Jump to

Keyboard shortcuts

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