depscache

package
v0.0.0-...-668aac7 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	MaxEntries int
	Logger     *logger.Logger
	// contains filtered or unexported fields
}

Cache is the deps cache.

func New

func New(fmc filemetadata.Cache) *Cache

New creates a new empty deps cache.

func (*Cache) GetDeps

func (c *Cache) GetDeps(k Key) ([]string, bool)

GetDeps returns deps if exist in cache.

func (*Cache) IsReady

func (c *Cache) IsReady() bool

IsReady returns whether the cache is ready to be used. The cache will not be ready if its performing a long running operation, such as loading from file.

func (*Cache) LoadFromDir

func (c *Cache) LoadFromDir(dir string)

LoadFromDir loads the cache from a directory. Recommended to be called in a goroutine as runtime could be long depending on the size of the cache.

func (*Cache) SetDeps

func (c *Cache) SetDeps(k Key, deps []string) error

SetDeps sets the dependencies of an action defined by the given key.

func (*Cache) WriteToDisk

func (c *Cache) WriteToDisk(outDir string)

WriteToDisk writes the cache to disk in proto file format.

type Key

type Key struct {
	CommandDigest string
	SrcFilePath   string
	// contains filtered or unexported fields
}

Key is the key identifying a command and source file to retrieve its cached dependencies.

Jump to

Keyboard shortcuts

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