Versions in this module Expand all Collapse all v0 v0.4.1 Jan 26, 2026 Changes in this version + const DefaultErrorCacheTTL + const DefaultMaxAge + const DefaultMaxEntries + var ErrCacheEntryInUse = errors.New("cache entry in use") + var ErrCacheStale = errors.New("cache entry is stale") + var ErrEntryNotFound = errors.New("cache entry not found") + func GenerateGraphID(projectRoot string) string + type BuildFunc func(ctx context.Context, projectRoot string) (*graph.Graph, *manifest.Manifest, error) + type CacheEntry struct + BuiltAtMilli int64 + Graph *graph.Graph + GraphID string + LastAccessMilli int64 + Manifest *manifest.Manifest + ProjectRoot string + func (e *CacheEntry) Acquire() + func (e *CacheEntry) EstimatedMemoryBytes() int64 + func (e *CacheEntry) InUse() bool + func (e *CacheEntry) IsStale() bool + func (e *CacheEntry) RefCount() int32 + func (e *CacheEntry) Release() + type CacheOption func(*CacheOptions) + func WithErrorCacheTTL(d time.Duration) CacheOption + func WithMaxAge(d time.Duration) CacheOption + func WithMaxEntries(n int) CacheOption + func WithMaxMemoryMB(mb int) CacheOption + type CacheOptions struct + ErrorCacheTTL time.Duration + MaxAge time.Duration + MaxEntries int + MaxMemoryMB int + func DefaultCacheOptions() CacheOptions + type CacheStats struct + BuildCount int64 + EntryCount int + ErrorCount int64 + EstimatedMemoryMB int + Evictions int64 + Hits int64 + MaxAge time.Duration + MaxEntries int + MaxMemoryMB int + MemoryEvictions int64 + Misses int64 + RefreshCount int64 + func (s CacheStats) HitRate() float64 + type ErrBuildFailed struct + Err error + FailedAt time.Time + RetryAt time.Time + func (e *ErrBuildFailed) CanRetry() bool + func (e *ErrBuildFailed) Error() string + func (e *ErrBuildFailed) Unwrap() error + type GraphCache struct + func NewGraphCache(opts ...CacheOption) *GraphCache + func (c *GraphCache) Clear() + func (c *GraphCache) ForceInvalidate(projectRoot string) + func (c *GraphCache) Get(projectRoot string) (*CacheEntry, func(), bool) + func (c *GraphCache) GetOrBuild(ctx context.Context, projectRoot string, build BuildFunc) (*CacheEntry, func(), error) + func (c *GraphCache) Invalidate(projectRoot string) error + func (c *GraphCache) Refresh(ctx context.Context, projectRoot string, refresh RefreshFunc) error + func (c *GraphCache) Stats() CacheStats + type RefreshFunc func(ctx context.Context, projectRoot string, currentGraph *graph.Graph, ...) (*graph.Graph, *manifest.Manifest, error)