Help us shape the future of Go! Take the 2026 Go Developer Survey

cache

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionKey

func ActionKey(kind string, spec any, inputs, dependencies []string) (string, error)

Types

type ActionResult

type ActionResult struct {
	Artifact       string     `json:"artifact"`
	Output         string     `json:"output"`
	OutputMetadata FileRecord `json:"output_metadata,omitempty"`
}

type Cache

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

func OpenCache

func OpenCache(root string) (*Cache, error)

func OpenCacheReadOnly

func OpenCacheReadOnly(root string) (*Cache, error)

OpenCacheReadOnly opens existing cache metadata without creating project state. Snapshot updates remain in memory and are never saved by inspection.

func (*Cache) BeginObservationSession

func (c *Cache) BeginObservationSession()

BeginObservationSession lets a finite executor share tree traversal across related snapshots. Direct Cache callers retain fresh-per-call semantics.

func (*Cache) HasReceipt

func (c *Cache) HasReceipt(actionKey, marker string) bool

func (*Cache) InvalidateObservations

func (c *Cache) InvalidateObservations()

InvalidateObservations starts a new filesystem-observation boundary. The executor calls this before running a handler, so snapshots within an unchanged no-op graph share one consistent tree view while generated or user-modified files are always rediscovered after actual work.

func (*Cache) Lookup

func (c *Cache) Lookup(actionKey, output string) (LookupStatus, string, error)

func (*Cache) Peek

func (c *Cache) Peek(actionKey, output string) (LookupStatus, string, error)

Peek reports what Lookup would do without restoring or modifying files.

func (*Cache) RecordAction

func (c *Cache) RecordAction(actionKey, output string) (string, error)

func (*Cache) RecordReceipt

func (c *Cache) RecordReceipt(actionKey string) error

func (*Cache) ResetStats

func (c *Cache) ResetStats()

func (*Cache) Save

func (c *Cache) Save() error

func (*Cache) Snapshot

func (c *Cache) Snapshot(options SnapshotOptions) (string, error)

func (*Cache) SnapshotFiles

func (c *Cache) SnapshotFiles(label string, paths ...string) (string, error)

func (*Cache) SnapshotGoAPI

func (c *Cache) SnapshotGoAPI(options SnapshotOptions) (string, error)

SnapshotGoAPI fingerprints binding-relevant Go syntax while ignoring method bodies. Free-function bodies remain inputs because main may delegate Wails service registration to helpers. Per-file semantic digests use the same metadata fast path as content Snapshots, so an unchanged tree is not reparsed.

func (*Cache) Stats

func (c *Cache) Stats() SnapshotStats

type FileRecord

type FileRecord struct {
	Size      int64  `json:"size"`
	ModTimeNS int64  `json:"mod_time_ns"`
	Mode      uint32 `json:"mode"`
	Identity  string `json:"identity"`
	Digest    string `json:"digest"`
}

type LookupStatus

type LookupStatus string
const (
	LookupMiss     LookupStatus = "miss"
	LookupHit      LookupStatus = "hit"
	LookupRestored LookupStatus = "restored"
	LookupDirty    LookupStatus = "dirty"
)

type SnapshotOptions

type SnapshotOptions struct {
	IncludeGoEmbed    bool
	Label             string
	Root              string
	IncludeAll        bool
	IncludeNames      []string
	IncludeExtensions []string
	ExcludeDirs       []string
	ExcludeSuffixes   []string
	UseGitIgnore      bool
}

type SnapshotStats

type SnapshotStats struct {
	Files         int
	BytesRead     int64
	DigestsReused int
	TreesWalked   int
}

Jump to

Keyboard shortcuts

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