Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteAuthorized(task *model.Task) (bool, error)
- func NewAfterUploadTask(objectID int64, versionID string, maxRetries int, scheduledAt time.Time) *model.Task
- func NewBucketDurabilityTask(bucketID int64, maxRetries int, scheduledAt time.Time) *model.Task
- func NewLRUTask(candidate Candidate, maxRetries int, scheduledAt time.Time) *model.Task
- func NormalizeAccessTime(value time.Time) time.Time
- func WithDeleteAuthorization(payload map[string]any) map[string]any
- type AuthorizedDeletion
- type Candidate
- type LRUTaskPayload
Constants ¶
const ( StageLRU = "lru" StageAfterUpload = "after_upload" StageReconcileBucketDurability = "reconcile_bucket_durability" )
Variables ¶
var ErrAccessChanged = errors.New("cache access snapshot changed")
ErrAccessChanged means an LRU candidate was accessed after it was planned.
var ErrDurabilityThreshold = errors.New("minimum durable copies not met")
ErrDurabilityThreshold means the current Bucket policy does not authorize deletion.
var ErrNoLongerEligible = errors.New("cache entry is no longer eligible")
ErrNoLongerEligible means a planned cache entry no longer matches the deletion contract.
Functions ¶
func DeleteAuthorized ¶
DeleteAuthorized reports whether the task has crossed the durable deletion authorization boundary.
func NewAfterUploadTask ¶
func NewAfterUploadTask(objectID int64, versionID string, maxRetries int, scheduledAt time.Time) *model.Task
NewAfterUploadTask builds the stable task for post-upload eviction.
func NewBucketDurabilityTask ¶
NewBucketDurabilityTask builds the singleton reconciliation task for one bucket.
func NewLRUTask ¶
NewLRUTask builds the stable task for one candidate access snapshot.
func NormalizeAccessTime ¶
NormalizeAccessTime matches the timestamp precision supported by both PostgreSQL and SQLite persistence paths.
Types ¶
type AuthorizedDeletion ¶
type AuthorizedDeletion struct {
Version model.ObjectVersion
BucketName string
}
AuthorizedDeletion is the persisted decision needed to remove one cache entry outside the database transaction that approved it.
type Candidate ¶
type Candidate struct {
ObjectID int64 `bun:"object_id"`
VersionID string `bun:"version_id"`
Size int64 `bun:"size"`
AccessedAt time.Time `bun:"cache_accessed_at"`
}
Candidate is the persisted snapshot needed to plan one LRU eviction.
type LRUTaskPayload ¶
LRUTaskPayload is the typed boundary for an LRU task's persisted payload.
func ParseLRUTaskPayload ¶
func ParseLRUTaskPayload(task *model.Task) (LRUTaskPayload, error)
ParseLRUTaskPayload validates and decodes the persisted LRU access snapshot.