Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persistor ¶
type Persistor interface {
Run(time.Duration)
Read() <-chan string
Write(data string)
Flush() error
Truncate() error
File() *os.File
Close() error
}
func NewAOFPersistor ¶
NewAOFPersistor creates a new append only file if no path is provided it will default to the current working directory
func NewMockAOFPersistor ¶
NewMockAOFPersistor creates a new mock AOFPersistor implementation used for when AOF service is disabled
type Store ¶
type Store interface {
// Set inserts a key-value data
Set(key string, value string)
// SetEX inserts an expirable key-value data
SetEX(key string, value string, expiresAfter int)
// Get returns the value of the given key
Get(key string) string
// Remove deletes an item by the given key
Remove(key string) int
// Flush deletes all keys
Flush()
// Iter represents an iterator for the table
Iter() <-chan *hashtable.Entry
// Exist returns true if an item with the given key exists otherwise returns false
Exist(key string) bool
// Size returns the amount of entries in the table
Size() int
}
Store is the representation of a key-value pair storage
Click to show internal directories.
Click to hide internal directories.