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 ¶
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.
Click to show internal directories.
Click to hide internal directories.