oci

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Image, _ = partial.UncompressedToImage(emptyImage{})

Image is a singleton empty image, think: FROM scratch.

Functions

func Build

func Build(files map[string]string) (v1.Image, error)

func BuildTgz

func BuildTgz(files map[string]string) ([]byte, error)

func GzipReadCloser

func GzipReadCloser(rc io.ReadCloser) (io.ReadCloser, error)

GzipReadCloser constructs a new gzipReadCloser from the passed file.

func ReadTgz

func ReadTgz(tgzData []byte) ([]byte, error)

func TgzReader

func TgzReader(ctx context.Context, r io.Reader, data store.Storer[[]byte]) error

func UnzipTgz

func UnzipTgz(ctx context.Context, basepath string, tgzData []byte, data store.Storer[[]byte]) error

Types

type Cache

type Cache interface {
	Has(id string) bool
	Get(id string) (io.ReadCloser, error)
	Store(id string, content io.ReadCloser) error
	Delete(id string) error
}

A Cache caches OCI package content.

func NewFsCache

func NewFsCache(dir string) Cache

NewFsCache creates a pkg Cache.

func NewNopCache

func NewNopCache() Cache

NewNopCache creates a new NopCache.

type NopCache

type NopCache struct{}

NopCache is a cache implementation that does not store anything and always returns an error on get.

func (*NopCache) Delete

func (c *NopCache) Delete(string) error

Delete removes content from the NopCache.

func (*NopCache) Get

func (c *NopCache) Get(string) (io.ReadCloser, error)

Get retrieves content from the NopCache.

func (*NopCache) Has

func (c *NopCache) Has(string) bool

Has indicates whether content is in the NopCache.

func (*NopCache) Store

func (c *NopCache) Store(string, io.ReadCloser) error

Store saves content to the NopCache.

type Puller

type Puller interface {
	Fetch(ctx context.Context, ref name.Reference, secrets ...string) (v1.Image, error)
	Head(ctx context.Context, ref name.Reference, secrets ...string) (*v1.Descriptor, error)
	Tags(ctx context.Context, ref name.Reference, secrets ...string) ([]string, error)
}

Puller pulls package images.

Jump to

Keyboard shortcuts

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