cache

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cache persists parse results between runs, keyed by a hash of each file's path and content, so regeneration only re-parses what changed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint() string

fingerprint ties the cache to the running binary, so any parser change (new release or a local rebuild) invalidates stale entries. Fingerprint identifies the running binary's parser behavior.

func Path

func Path(root string) string

Path returns the cache file location for root, or "" when no cache directory is available. STACKLIT_CACHE_DIR overrides the default.

Types

type Store

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

Store is a concurrency-safe parse cache bound to one repo root.

func Open

func Open(root string) *Store

Open loads the cache for root. A missing, corrupt or stale (different fingerprint) cache file yields an empty store, never an error.

func (*Store) Get

func (s *Store) Get(key string) (*parser.FileInfo, bool)

Get implements parser.Cache.

func (*Store) Put

func (s *Store) Put(key string, info *parser.FileInfo)

Put implements parser.Cache.

func (*Store) Save

func (s *Store) Save() error

Save writes only the entries touched this run, so deleted or edited files do not accumulate. Failure is reported but is never fatal to a scan.

func (*Store) Stats

func (s *Store) Stats() (hits, misses int)

Stats reports cache hits and misses for this run.

Jump to

Keyboard shortcuts

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