package imgcache import ( "context" "time" ) // DefaultEvictionInterval is how often the background evictor checks // cache usage against the configured limit, in addition to the // write-pressure wakeups triggered by stores. const DefaultEvictionInterval = 5 * time.Minute // UsageBytes returns the total number of bytes of cache content // tracked in the database (source content blobs plus processed // variants). It never scans the cache directories. func (c *Cache) UsageBytes(_ context.Context) (int64, error) { // Red phase: implementation follows the failing tests. return 0, nil } // EvictToLimit evicts least-recently-used cache entries until total // tracked usage is at or below the configured MaxBytes limit. It is a // no-op when the cache is disabled (MaxBytes zero). func (c *Cache) EvictToLimit(_ context.Context) error { // Red phase: implementation follows the failing tests. return nil } // StartEviction launches the background eviction goroutine, which // reconciles the database accounting with the cache directories once // at startup and then evicts to the configured limit on the given // periodic interval and on write-pressure notifications. func (c *Cache) StartEviction(_ time.Duration) { // Red phase: implementation follows the failing tests. } // StopEviction stops the background eviction goroutine and waits for // it to exit. It is safe to call when eviction was never started. func (c *Cache) StopEviction() { // Red phase: implementation follows the failing tests. }