Documentation ¶
Index ¶
- func WithCacheFile(cacheFilePath string, fetcher func() (io.ReadCloser, error)) (io.ReadCloser, error)
- type ImageDigestName
- type ImageTagName
- type Storage
- func (r *Storage) CachedConfigFile(ctx context.Context, imageName imageName) (*v1.ConfigFile, error)
- func (r *Storage) CachedManifest(ctx context.Context, image v1.Image) (*v1.Manifest, error)
- func (r *Storage) CreateOptions(ctx context.Context) []google.Option
- func (r *Storage) GetCacheDir() string
- func (r *Storage) ToRemoteImage(ctx context.Context, imageName imageName) (v1.Image, error)
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 ¶
ImageDigestName holds an image we know by digest (which is immutable and more cacheable)
func (ImageDigestName) String ¶
func (i ImageDigestName) String() string
type ImageTagName ¶
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 ¶
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 ¶
CachedManifest fetches Manifest making use of the cache TODO: This should be incorporated into the go-containerregistry, along with replacing a fetcher