cache

package standard library
go1.13.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package cache implements a build artifact cache.

Index

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

func FileHash(file string) ([HashSize]byte, error)

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 SetFileHash

func SetFileHash(file string, sum [HashSize]byte)

SetFileHash sets the hash returned by FileHash for file.

Types

type ActionID

type ActionID [HashSize]byte

An ActionID is a cache action key, the hash of a complete description of a repeatable computation (command line, environment variables, input file contents, executable contents).

func Subkey