Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearCache ¶
Types ¶
type CachedIndex ¶
type CachedIndex struct {
// contains filtered or unexported fields
}
CachedIndex memoizes tracked file listings per root for one scan.
func NewCachedIndex ¶
func NewCachedIndex(runner Runner) *CachedIndex
NewCachedIndex returns a memoizing index around runner.
func NewGitIndex ¶
func NewGitIndex() *CachedIndex
NewGitIndex returns a per-run tracked-file index backed by git ls-files.
type FileMetadataProvider ¶
type FileMetadataProvider struct{}
FileMetadataProvider reads git metadata directly from .git so warm checks do not pay the cost of listing the full repository.
type GitRunner ¶
type GitRunner struct{}
GitRunner lists files tracked by the git worktree rooted at root.
type Index ¶
Index provides repository-relative tracked file paths for a root. Implementations return ok=false when callers should fall back to a filesystem walk.
type MetadataProvider ¶
MetadataProvider snapshots the git metadata that determines whether a tracked-file listing can be reused without invoking git ls-files.
type PersistentRunner ¶
type PersistentRunner struct {
// contains filtered or unexported fields
}
PersistentRunner wraps a Runner with a disk cache. It implements Runner so callers can keep using NewCachedIndex for per-run memoization.
func NewPersistentRunner ¶
func NewPersistentRunner(runner Runner, meta MetadataProvider) *PersistentRunner
func NewPersistentRunnerWithStore ¶
func NewPersistentRunnerWithStore(runner Runner, meta MetadataProvider, store Store) *PersistentRunner
type Runner ¶
Runner is the pluggable backend used by CachedIndex. Tests can supply a fake runner to assert that multiple consumers share one discovery result.
type Snapshot ¶
type Snapshot struct {
Root string `json:"root"`
GitDir string `json:"gitDir"`
IndexPath string `json:"indexPath"`
IndexSize int64 `json:"indexSize"`
IndexModTime int64 `json:"indexModTime"`
Head string `json:"head"`
}
Snapshot is intentionally based on git metadata rather than worktree file mtimes. A modified tracked source file does not change the tracked-file set, while index or HEAD changes do.