oci

package
v1.0.0-beta.50 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCacheFile

func WithCacheFile(cacheFilePath string, fetcher func() (io.ReadCloser, error)) (io.ReadCloser, error)

WithCacheFile runs with a filesystem-backed cache. If cacheFilePath does not exist, it will be fetched with the function fetcher. The file contents are then processed with the function reader. TODO: We likely need some form of GC/LRU on the cache file paths. We can probably use FS access time (or we might need to touch the files when we access them)!

Types

type ImageDigestName

type ImageDigestName struct {
	Image  string
	Digest string
}

ImageDigestName holds an image we know by digest (which is immutable and more cacheable)

func (ImageDigestName) String

func (i ImageDigestName) String() string

type ImageTagName

type ImageTagName struct {
	Image string
	Tag   string
}

ImageTagName holds an image we know by tag (but tags are mutable, so this often implies lookups)

func ParseImageTagName

func ParseImageTagName(s string) (*ImageTagName, error)

func (ImageTagName) String

func (i ImageTagName) String() string

type Storage

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

Storage provides helper functions specifically for OCI storage. It abstracts and simplifies the go-containerregistry library, but is agnostic to the contents of the images etc.

func NewStorage

func NewStorage(cacheDir string) (*Storage, error)

NewStorage creates a Storage for managing OCI images.

func (*Storage) CachedConfigFile

func (r *Storage) CachedConfigFile(ctx context.Context, imageName imageName) (*v1.ConfigFile, error)

CachedConfigFile fetches ConfigFile making use of the cache TODO: This should be incorporated into the go-containerregistry, along with replacing a fetcher

func (*Storage) CachedManifest

func (r *Storage) CachedManifest(_ context.Context, image v1.Image) (*v1.Manifest, error)

CachedManifest fetches Manifest making use of the cache TODO: This should be incorporated into the go-containerregistry, along with replacing a fetcher

func (*Storage) CreateOptions

func (r *Storage) CreateOptions(ctx context.Context) []google.Option

func (*Storage) GetCacheDir

func (r *Storage) GetCacheDir() string

func (*Storage) ToRemoteImage

func (r *Storage) ToRemoteImage(ctx context.Context, imageName imageName) (v1.Image, error)

ToRemoteImage builds a remote image reference for the given name, including caching and authentication.

Jump to

Keyboard shortcuts

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