Help us shape the future of Go! Take the 2026 Go Developer Survey

cacheeviction

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDurabilityThreshold = errors.New("minimum durable copies not met")
	ErrNoLongerEligible    = errors.New("cache entry is no longer eligible")
	ErrAccessChanged       = errors.New("cache access snapshot changed")
)

Functions

func NormalizeAccessTime

func NormalizeAccessTime(value time.Time) time.Time

func ValidateDurabilityInput

func ValidateDurabilityInput(input *DurabilityInput) error

func ValidateEvictInput

func ValidateEvictInput(input *EvictInput) error

Types

type AuthorizedDeletion

type AuthorizedDeletion struct {
	Content    model.StorageContent
	BucketName string
}

type Candidate

type Candidate struct {
	ContentID  int64     `bun:"content_id"`
	BucketID   int64     `bun:"bucket_id"`
	Size       int64     `bun:"content_size"`
	AccessedAt time.Time `bun:"cache_accessed_at"`
}

Candidate is one cached content payload, not one object version: residency is content-addressed, so several versions of identical bytes share a single eviction decision.

type DurabilityInput

type DurabilityInput struct {
	BucketID   int64 `json:"bucket_id"`
	Generation int64 `json:"generation"`
}

func ParseDurabilityInput

func ParseDurabilityInput(task *model.Task) (DurabilityInput, error)

type EvictInput

type EvictInput struct {
	ContentID  int64      `json:"content_id"`
	Generation int64      `json:"generation"`
	AccessedAt *time.Time `json:"accessed_at,omitempty"`
}

EvictInput identifies one cache generation. AccessedAt is present for an LRU authorization and omitted when remote durability directly authorizes removal.

func ParseEvictInput

func ParseEvictInput(task *model.Task) (EvictInput, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL