Documentation
¶
Overview ¶
Package cache provides a disk-based LRU response cache for AI provider calls. Cache key = SHA256(provider+model+prompt). Entries stored as gzip-compressed JSON files under .cloop/cache/. Supports TTL expiry and LRU eviction.
Index ¶
Constants ¶
View Source
const ( DefaultTTL = 24 * time.Hour DefaultMaxSize = 100 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a disk-based LRU response cache.
type Entry ¶
type Entry struct {
Key string `json:"key"`
Response string `json:"response"`
Provider string `json:"provider"`
Model string `json:"model"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at"`
HitCount int `json:"hit_count"`
}
Entry is a single cached response stored on disk.
Click to show internal directories.
Click to hide internal directories.