oci

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0, BSD-3-Clause Imports: 17 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 GzipReadCloser

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

GzipReadCloser constructs a new gzipReadCloser from the passed file.

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