cache

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheName            = "wasme-cache"
	CacheNamespace       = "wasme"
	CacheImageRepository = "quay.io/solo-io/wasme"
	CacheImageTag        = version.Version
	ImagesKey            = "images"
	DefaultCacheArgs     = []string{
		"cache",
		"--directory",
		"/var/local/lib/wasme-cache",
		"--ref-file",
		"/etc/wasme-cache/images.txt",
	}
)

Functions

func Digest2filename added in v0.0.13

func Digest2filename(digest digest.Digest) string

func MakeDaemonSet added in v0.0.13

func MakeDaemonSet(name, namespace, image string, labels map[string]string, args []string, pullPolicy v1.PullPolicy) *appsv1.DaemonSet

func NewDeployer

func NewDeployer(kube kubernetes.Interface, namespace, name string, imageRepo, imageTag string, args []string, pullPolicy v1.PullPolicy) *deployer

func NewLocalImagePuller added in v0.0.13

func NewLocalImagePuller(imageCache Cache, refFile string, directory string) *localImagePuller

Types

type Cache

type Cache interface {
	// adds the image retrieve the digest for the image.
	// the digest will be cached if it is the initial Get
	Add(ctx context.Context, image string) (digest.Digest, error)

	// retrieve the wasm file from the image
	Get(ctx context.Context, digest digest.Digest) (model.Filter, error)
	http.Handler
}

Cache stores digests and image contents in memory

func NewCache

func NewCache(puller pull.ImagePuller) Cache

type CacheImpl

type CacheImpl struct {
	Puller pull.ImagePuller
	// contains filtered or unexported fields
}

func (*CacheImpl) Add

func (c *CacheImpl) Add(ctx context.Context, ref string) (digest.Digest, error)

func (*CacheImpl) Get

func (c *CacheImpl) Get(ctx context.Context, digest digest.Digest) (model.Filter, error)

func (*CacheImpl) ServeHTTP

func (c *CacheImpl) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Deployer

type Deployer interface {
	// ensures the desired cache is deployed.
	// if a cache component already exists, it is updated
	EnsureCache() error
}

the cache deployer deploys an instance of the cache to Kubernetes.

type LocalImagePuller added in v0.0.13

type LocalImagePuller interface {
	// watches ref file (images.txt) pulls each image to disk
	WatchFile(ctx context.Context) error
}

pulls images for a local cache

Jump to

Keyboard shortcuts

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