cacher

package
v0.0.0-...-09e74c9 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCacheFound = errors.New("cached version not found")
	ErrNoStoreFound = errors.New("cache store not found")
)

Functions

func OpenOrCreate

func OpenOrCreate(path string) (*cacherImpl, error)

OpenOrCreate expects a directory cache with populated indicies for each store or for no directory to exist. If a directory doesn't exist, the function will attempt to create one. Any non-indexed directories within will cause an error to be returned. A valid Cacher will be returned if nil error is returned.

Types

type Cacher

type Cacher interface {
	// Cache a single binary artifact using a namespace and version located at path
	Cache(namespace, version, path string) error
	// Get the path for an already cached binary if one exists. An error will
	// be returned for any case that causes the Cacher to not provide a valid path
	Get(namespace, version string) (string, error)
}

Cacher is used by the builder package to copy the binary of expensive builds.

Jump to

Keyboard shortcuts

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