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

cache

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LocalReconcileInterval = time.Hour
)

Variables

This section is empty.

Functions

func NewContentDurabilityReachedSubscriber

func NewContentDurabilityReachedSubscriber(deps EvictionDependencies) (taskengine.MessageHandler, error)

func NewEvictCacheContentReceiver

func NewEvictCacheContentReceiver(deps EvictionDependencies) (taskengine.MessageHandler, error)

Types

type CapacityDependencies

type CapacityDependencies struct {
	Repositories              *repository.Repositories
	Cache                     cache.Cache
	CacheTracker              *cacheaccess.Tracker
	Scheduler                 *taskengine.Scheduler
	State                     *State
	PressureListener          PressureListener
	EvictionPolicy            cache.EvictionPolicy
	MaxCacheBytes             int64
	MaxWriteBytes             int64
	LRUHighPercent            int
	LRULowPercent             int
	CommitSealOnCachePressure bool
}

type CapacityHandler

type CapacityHandler struct {
	*taskengine.FuncHandler
	// contains filtered or unexported fields
}

func NewCapacityHandler

func NewCapacityHandler(deps CapacityDependencies) (*CapacityHandler, error)

type DurabilityDependencies

type DurabilityDependencies struct {
	Repositories   *repository.Repositories
	Scheduler      *taskengine.Scheduler
	EvictionPolicy cache.EvictionPolicy
}

type DurabilityHandler

type DurabilityHandler struct {
	*taskengine.FuncHandler
	// contains filtered or unexported fields
}

func NewDurabilityHandler

func NewDurabilityHandler(deps DurabilityDependencies) (*DurabilityHandler, error)

type EvictDependencies

type EvictDependencies struct {
	Repositories   *repository.Repositories
	Cache          cache.Cache
	CacheGate      *cacheaccess.Gate
	CacheTracker   *cacheaccess.Tracker
	State          *State
	EvictionPolicy cache.EvictionPolicy
	MaxCacheBytes  int64
	MaxWriteBytes  int64
	LRULowPercent  int
}

type EvictHandler

type EvictHandler struct {
	*taskengine.FuncHandler
	// contains filtered or unexported fields
}

func NewEvictHandler

func NewEvictHandler(deps EvictDependencies) (*EvictHandler, error)

type EvictionDependencies

type EvictionDependencies struct {
	Scheduler      *taskengine.Scheduler
	EvictionPolicy cache.EvictionPolicy
}

type LocalDependencies added in v0.1.1

type LocalDependencies struct {
	Repositories   *repository.Repositories
	Cache          cache.Cache
	CacheGate      *cacheaccess.Gate
	CacheTracker   *cacheaccess.Tracker
	Scheduler      *taskengine.Scheduler
	EvictionPolicy cache.EvictionPolicy
	Logger         *slog.Logger
}

type LocalFilesystem added in v0.1.1

type LocalFilesystem interface {
	ListUploadIDs(context.Context) ([]string, error)
	WalkContentFiles(context.Context, bool, func(bucket string, contentID int64) error) error
	Quarantine(context.Context, string, int64) error
	DeleteQuarantined(context.Context, string, int64) error
}

LocalFilesystem exposes cache files that need reconciliation with durable state. The boolean selects quarantined files.

type LocalHandler added in v0.1.1

type LocalHandler struct {
	*taskengine.FuncHandler
	// contains filtered or unexported fields
}

func NewLocalHandler added in v0.1.1

func NewLocalHandler(deps LocalDependencies) (*LocalHandler, error)

type PressureListener

type PressureListener interface{ OnCachePressure(context.Context) error }

type State

type State struct {
	// contains filtered or unexported fields
}

State holds cache pressure and the concurrent LRU deletion budget.

func NewState

func NewState() *State

func (*State) TargetBytes

func (s *State) TargetBytes() (int64, bool)

Jump to

Keyboard shortcuts

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