Documentation
¶
Index ¶
- type EntryMetadata
- type ReadyGate
- func (gate *ReadyGate) Add()
- func (gate *ReadyGate) Available() int64
- func (gate *ReadyGate) Cleanup()
- func (gate *ReadyGate) Done() bool
- func (gate *ReadyGate) Drained() bool
- func (gate *ReadyGate) Finish(err error, total int64)
- func (gate *ReadyGate) SetAvailable(x int64)
- func (gate *ReadyGate) SetCancel(cancel context.CancelFunc)
- func (gate *ReadyGate) SetCleanup(cleanup func())
- func (gate *ReadyGate) SetTotal(total int64)
- func (gate *ReadyGate) WaitFor(end int64) error
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryMetadata ¶ added in v3.3.109
type EntryMetadata struct {
Path string `json:"path"`
Size int64 `json:"size"`
ModTime time.Time `json:"mtime"`
Complete bool `json:"complete"`
}
EntryMetadata identifies a completed cache entry for a specific remote file version.
func NewEntryMetadata ¶ added in v3.3.109
func NewEntryMetadata(path string, size int64, modTime time.Time) EntryMetadata
func (EntryMetadata) Matches ¶ added in v3.3.109
func (m EntryMetadata) Matches(other EntryMetadata) bool
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) Cleanup ¶ added in v3.3.109
func (gate *ReadyGate) Cleanup()
Cleanup runs the gate cleanup callback once after Done reports the gate is drained.
func (*ReadyGate) Done ¶
Done releases one waiter and reports whether the gate is finished with no remaining waiters. Callers that receive true must call Cleanup; releaseGateWaiter is the canonical pairing.
func (*ReadyGate) SetAvailable ¶
func (*ReadyGate) SetCancel ¶
func (gate *ReadyGate) SetCancel(cancel context.CancelFunc)
func (*ReadyGate) SetCleanup ¶ added in v3.3.109
func (gate *ReadyGate) SetCleanup(cleanup func())
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.
Click to show internal directories.
Click to hide internal directories.