bazelcache

package
v0.0.0-...-3d93004 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("resource was not found")

Functions

func NewCacheServer

func NewCacheServer(bc BazelCache) http.Handler

NewCacheServer converts a BazelCache object to a handler compatible with Bazel remote cahce.

func NewFileSystemCache

func NewFileSystemCache(cacheDir string, maxSize int) (*fileSystemCache, error)

NewFileSystemCache creates a fileSystemCache that backs its data to local file system. It deletes the least used files if the total size exceeds maxSize.

Types

type BazelCache

type BazelCache interface {
	// Get retrieves the object with a given key
	Get(ctx context.Context, key string) ([]byte, error)
	// Put stores the object with a given key
	Put(ctx context.Context, key string, r io.Reader) error
	// Delete deletes the object with a given key
	Delete(ctx context.Context, key string) error
	// Has checks wether an object with a given key exists.
	Has(ctx context.Context, key string) bool
}

func NewChainCache

func NewChainCache(bcs ...BazelCache) BazelCache

NewChainCache provides a chained cache. On write it tries to write to all underlying caches and on read it returns the first cache hit.

Jump to

Keyboard shortcuts

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