cache

package
v0.0.0-...-9f81d63 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigurer

func NewConfigurer() config.Configurer

func SetCacheFactory

func SetCacheFactory(c CacheFactory)

Types

type Cache

type Cache interface {
	/** Persist any changes to the cache */
	Persist()

	/** Load+Store data computed from file contents.
	 *
	 * If the underlying file has changed since the data was computed, the
	 * loader should return false.
	 *
	 * The file content may or may not be read from disk, depending on the Cache
	 * implementation as well as the cache status.
	 *
	 * The path 'root' is not part of the cache key, but is used to resolve
	 * relative paths in the cache.
	 */
	LoadOrStoreFile(root, path, key string, loader FileCompute) (any, bool, error)
}

func Get

func Get(config *config.Config) Cache

Fetch the shared cache for a given config

func NewDiskCache

func NewDiskCache(cacheFilePath string) Cache

*

  • Cache to disk, keyed by file content hash and `buildinfo.GitCommit`.

func NewWatchmanCache

func NewWatchmanCache(c *config.Config) Cache

type CacheFactory

type CacheFactory = func(c *config.Config) Cache

type FileCompute

type FileCompute = func(path string, content []byte) (any, error)

Jump to

Keyboard shortcuts

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