cache

package
v3.2.265 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReadyGate

type ReadyGate struct {
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

ReadyGate manages blocking cache consumers until the requested data is available.

func NewReadyGate

func NewReadyGate() *ReadyGate

func (*ReadyGate) Add

func (gate *ReadyGate) Add()

func (*ReadyGate) Available

func (gate *ReadyGate) Available() int64

func (*ReadyGate) Done

func (gate *ReadyGate) Done()

func (*ReadyGate) Finish

func (gate *ReadyGate) Finish(err error, total int64)

func (*ReadyGate) SetAvailable

func (gate *ReadyGate) SetAvailable(x int64)

func (*ReadyGate) SetCancel

func (gate *ReadyGate) SetCancel(cancel context.CancelFunc)

func (*ReadyGate) WaitFor

func (gate *ReadyGate) WaitFor(end int64) error

type Stats

type Stats struct {
	CapacityBytes          int64
	CapacityBytesRemaining int64
	MaxFileCount           int64
	FileCountRemaining     int64
	FileCount              atomic.Int64
	ReadBytes              atomic.Int64
	ReadCount              atomic.Int64
	SizeBytes              atomic.Int64
	WriteBytes             atomic.Int64
	WriteCount             atomic.Int64
	LoadDuration           time.Duration
	LruCount               int
	PinnedCount            int
	PinnedPaths            map[string]int
	LruKeys                []string
}

Stats maintains statistics about cache usage. In non-debug builds, this type exists but has no methods for retrieving statistics.

func (*Stats) ResetCounters

func (st *Stats) ResetCounters()

ResetCounters sets "counter" type stats to zero.

Directories

Path Synopsis
Package disk implements a disk-based cache for file data.
Package disk implements a disk-based cache for file data.

Jump to

Keyboard shortcuts

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