cache

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// GraphCapacity bounds the graph cache: a handful of recent workspace states is
	// plenty. Unbounded stores pass 0.
	GraphCapacity = 32
)

Variables

View Source
var ErrDisabled = errors.New("cache disabled")

Functions

func BuildIdentity

func BuildIdentity() string

Types

type Digest

type Digest [32]byte

type FileDigest

type FileDigest struct {
	AbsPath string
	RelPath string
	Digest  Digest
}

type Fingerprint

type Fingerprint [32]byte

func Compute

func Compute(ctx context.Context, in Inputs) (Fingerprint, error)

func (Fingerprint) String

func (f Fingerprint) String() string

type Inputs

type Inputs struct {
	Root string
	Tags []string
	Env  []string
}

type Manifest

type Manifest struct {
	Root  string
	Key   Fingerprint
	Files []FileDigest
	// contains filtered or unexported fields
}

func Scan

func Scan(ctx context.Context, in Inputs) (*Manifest, error)

func (*Manifest) DigestFor

func (m *Manifest) DigestFor(absPath string) (Digest, bool)

func (*Manifest) Digests

func (m *Manifest) Digests() map[string]string

Digests renders the manifest as the rel-path digest map the index fingerprinter consumes, describing the working tree as it is right now.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(dir string) (*Store, error)

func (*Store) Dir

func (s *Store) Dir() string

func (*Store) Get

func (s *Store) Get(key Fingerprint) ([]byte, bool)

func (*Store) Namespace

func (s *Store) Namespace(name string, capacity int) (*Store, error)

Namespace returns a sibling store under its own subdirectory with its own capacity. A capacity of 0 means unbounded, which is what the coverage index needs: it holds one entry per package, so a small cap would silently evict records as fast as they were written.

func (*Store) Put

func (s *Store) Put(key Fingerprint, payload []byte) error

Jump to

Keyboard shortcuts

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