Documentation
¶
Index ¶
- Variables
- func CompressZlib(input []byte) []byte
- func DecompressZlib(input []byte) []byte
- type DummyCounter
- type DummyTimer
- type ICounter
- type ITimer
- type Mnemosyne
- type MnemosyneInstance
- func (mn *MnemosyneInstance) Delete(ctx context.Context, key string) error
- func (mn *MnemosyneInstance) Flush(targetLayerName string) error
- func (mn *MnemosyneInstance) Get(ctx context.Context, key string, ref interface{}) error
- func (mn *MnemosyneInstance) GetAndShouldUpdate(ctx context.Context, key string, ref interface{}) (bool, error)
- func (mn *MnemosyneInstance) Set(ctx context.Context, key string, value interface{}) error
- func (mn *MnemosyneInstance) ShouldUpdate(ctx context.Context, key string) (bool, error)
- func (mn *MnemosyneInstance) TTL(key string) (int, time.Duration)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecompressZlib ¶
Types ¶
type DummyCounter ¶
type DummyCounter struct { }
func NewDummyCounter ¶
func NewDummyCounter() *DummyCounter
func (*DummyCounter) Inc ¶
func (*DummyCounter) Inc(...string)
type DummyTimer ¶
type DummyTimer struct { }
func NewDummyTimer ¶
func NewDummyTimer() *DummyTimer
func (*DummyTimer) Start ¶
func (*DummyTimer) Start() time.Time
type ICounter ¶
type ICounter interface {
Inc(...string)
}
ICounter defines the interface for counting operations
type Mnemosyne ¶
type Mnemosyne struct {
// contains filtered or unexported fields
}
Mnemosyne is the parent object which holds all cache instances
func NewMnemosyne ¶
NewMnemosyne initializes the Mnemosyne object which holds all cache instances
func (*Mnemosyne) Select ¶
func (m *Mnemosyne) Select(cacheName string) *MnemosyneInstance
Select returns a cache instance selected by name
type MnemosyneInstance ¶
type MnemosyneInstance struct {
// contains filtered or unexported fields
}
MnemosyneInstance is an instance of a multi-layer cache
func (*MnemosyneInstance) Delete ¶
func (mn *MnemosyneInstance) Delete(ctx context.Context, key string) error
Delete removes a key from all layers
func (*MnemosyneInstance) Flush ¶
func (mn *MnemosyneInstance) Flush(targetLayerName string) error
Flush completely clears a single layer of the cache
func (*MnemosyneInstance) Get ¶
func (mn *MnemosyneInstance) Get(ctx context.Context, key string, ref interface{}) error
Get retrieves the value for key
func (*MnemosyneInstance) GetAndShouldUpdate ¶
func (mn *MnemosyneInstance) GetAndShouldUpdate(ctx context.Context, key string, ref interface{}) (bool, error)
GetAndShouldUpdate retrieves the value for key and indicates if the soft-TTL has expired
func (*MnemosyneInstance) Set ¶
func (mn *MnemosyneInstance) Set(ctx context.Context, key string, value interface{}) error
Set sets the value for a key in all layers of the cache instance
func (*MnemosyneInstance) ShouldUpdate ¶
ShouldUpdate indicates if the soft-TTL of a key has expired
Click to show internal directories.
Click to hide internal directories.