Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigDefault = Config{
NumCounters: 1e7,
MaxCost: 1 << 30,
BufferItems: 64,
DefaultCost: 1,
}
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // NumCounters number of keys to track frequency of (10M). NumCounters int64 // MaxCost maximum cost of cache (1GB). MaxCost int64 // BufferItems number of keys per Get buffer. BufferItems int64 DefaultCost int64 }
Config defines the config for storage.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage interface that is implemented by storage providers.
func (*Storage) Close ¶
Close closes the storage and will stop any running garbage collectors and open connections.
func (*Storage) Delete ¶
Delete deletes the value for the given key. It returns no error if the storage does not contain the key,
func (*Storage) Get ¶
Get gets the value for the given key. `nil, nil` is returned when the key does not exist
Click to show internal directories.
Click to hide internal directories.