Documentation
¶
Overview ¶
Package stepcache builds a StepCache from config: off (the default, never hits) or dir (one marker file per passed key under a directory), and derives the content-addressed key a step is cached under.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Digest ¶ added in v0.0.20
func Digest( ctx context.Context, cb interfaces.Codebase, sel types.FileSelector, ) ([]byte, error)
Digest is the SHA-256 of the paths and contents of the files sel selects in cb, in path order: the inputs part of a step's Key.
func IsOff ¶ added in v0.0.19
func IsOff(c interfaces.StepCache) bool
IsOff reports whether c is the off cache (or nil), so a caller can skip computing keys nothing will ever look up.
func Key ¶
Key is the hex SHA-256 of a step's inputs, its tool's version and its arguments. Each field is length-prefixed, so no two different field lists share a key.
func NewFromConfig ¶
func NewFromConfig(cfg Config) (interfaces.StepCache, error)
NewFromConfig builds the cache cfg.Kind selects. An unknown kind, or KindDir with no Dir, is CodeInvalidInput. It does no I/O.