Documentation
¶
Overview ¶
Package cache implements a build artifact cache.
Index ¶
- Constants
- Variables
- func DefaultDir() string
- func FileHash(file string) ([HashSize]byte, error)
- func PutBytes(c Cache, id ActionID, data []byte) error
- func SetFileHash(file string, sum [HashSize]byte)
- type ActionID
- type Cache
- type DiskCache
- type Entry
- type Hash
- type OutputID
- type ProgCache
- type ProgCmd
- type ProgRequest
- type ProgResponse
Constants ¶
View Source
const HashSize = 32
HashSize is the number of bytes in a hash.
Variables ¶
View Source
var DebugTest = false
DebugTest is set when GODEBUG=gocachetest=1 is in the environment.
Functions ¶
func DefaultDir ¶
func DefaultDir() string
DefaultDir returns the effective GOCACHE setting. It returns "off" if the cache is disabled.
func FileHash ¶
FileHash returns the hash of the named file. It caches repeated lookups for a given file, and the cache entry for a file can be initialized using SetFileHash. The hash used by FileHash is not the same as the hash used by NewHash.
func PutBytes ¶ added in go1.21.0
PutBytes stores the given bytes in the cache as the output for the action ID.
func SetFileHash ¶
SetFileHash sets the hash returned by FileHash for file.