Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultTTL = 7 * 24 * time.Hour
View Source
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func Compute ¶
func Compute(args ComputeArgs) string
Compute returns the deterministic SHA-256 key (lowercase hex) for the cache lookup. The schema version is folded in so a future bump invalidates every existing entry without touching disk.
func EnsureGitignore ¶
EnsureGitignore appends `.commitbrief/` to the repo's .gitignore if not already present. Idempotent: a file that already contains the entry is left untouched. Returns true if the file was modified.
Types ¶
type ComputeArgs ¶
type Entry ¶
type Options ¶
type Options struct {
Dir string
// RepoRoot, if non-empty, enables auto-add of `.commitbrief/` to the
// repo's .gitignore on the first successful Put.
RepoRoot string
// TTL controls how long an entry is considered fresh. Zero falls back
// to DefaultTTL (7 days).
TTL time.Duration
// Now overrides time.Now (test injection); production callers leave it nil.
Now func() time.Time
}
Click to show internal directories.
Click to hide internal directories.