Documentation
¶
Index ¶
- Constants
- func GetSingleMock(i int, path []byte, cfg config.Config) *model.Entry
- func GetSingleMockWith(i int, path []byte, cfg config.Config, brotli bool) *model.Entry
- func LoadMocks(ctx context.Context, cfg config.Config, storage Storage, num int)
- func LoadMocksWith(ctx context.Context, cfg config.Config, storage Storage, num int, brotli bool)
- func StreamEntryPointersConsecutive(ctx context.Context, cfg config.Config, path []byte, num int) <-chan *model.Entry
- func StreamEntryPointersConsecutiveWith(ctx context.Context, cfg config.Config, path []byte, num int, brotli bool) <-chan *model.Entry
- type DB
- type Dump
- type Dumper
- type Storage
Constants ¶
View Source
const ( // services SvcEvictor = "soft-eviction" SvcLifeTimeManager = "wrk-lifetime-manager" SvcForceGC = "wrk-force-gc" )
Variables ¶
This section is empty.
Functions ¶
func GetSingleMock ¶ added in v1.1.1
func GetSingleMockWith ¶ added in v1.4.3
GetSingleMockWith builds a single mock Entry for the given index/path/config. Brotli compression is controlled by the brotli flag.
func LoadMocksWith ¶ added in v1.4.3
LoadMocksWith generates and stores num mock entries asynchronously.
func StreamEntryPointersConsecutive ¶ added in v1.2.0
Types ¶
type DB ¶ added in v1.3.0
type DB struct {
*lru.InMemoryStorage
// contains filtered or unexported fields
}
DB wraps the LRU storage and supervises worker groups through a Governor.
type Storage ¶
type Storage interface {
Get(*model.Entry) (entry *model.Entry, hit bool)
GetByKey(key uint64) (*model.Entry, bool)
Set(entry *model.Entry) (persisted bool)
WalkShards(ctx context.Context, fn func(key uint64, shard *sharded.Shard[*model.Entry]))
Remove(*model.Entry) (freedBytes int64, hit bool)
Stat() (bytes int64, length int64)
Clear()
Close() error
}
Storage is a generic interface for cache storages.
Click to show internal directories.
Click to hide internal directories.