Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { // Get returns the value for the given key, ErrNotFound if the key doesn't exist, // or another error if the get failed Get(key string) ([]byte, error) // Set sets the value for the given key. Returns an error if the set failed. // If non-nil error is returned, the value was not updated Set(key string, val []byte) error }
DB is the interface to a simple key/value store
func NewInMemoryDB ¶
func NewInMemoryDB() DB
NewInMemoryDB creates a new DB implementation that stores all data in memory. All operations are concurrency safe
Click to show internal directories.
Click to hide internal directories.