storagecapacity

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnresolvedSizes = errors.New("capacity eviction requires every active storage location size")

Functions

This section is empty.

Types

type Options

type Options struct {
	DB        *ent.Client
	Storage   storage.Adapter
	Config    config.CacheConfig
	Lifecycle *storagelifecycle.Service
	Locker    *dblock.Locker
	Logger    *zerolog.Logger
}

type Result

type Result struct {
	Mode                string
	BudgetBytes         int64
	TargetBytes         int64
	UsageBeforeBytes    int64
	UsageAfterBytes     int64
	PendingCreditBytes  int64
	Candidates          int
	ClaimedLocations    int
	ClaimedBytes        int64
	PinnedLocations     int
	StaleLocations      int
	UnresolvedLocations int
	Constrained         bool
	// Skipped means another replica held the eviction lock, so this pass did nothing.
	Skipped bool
}

type Service

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

func NewService

func NewService(options Options) *Service

func (*Service) Enforce

func (s *Service) Enforce(ctx context.Context) (result Result, err error)

func (*Service) Run

func (s *Service) Run(ctx context.Context, ready <-chan struct{})

func (*Service) Trigger

func (s *Service) Trigger()

Jump to

Keyboard shortcuts

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