Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("ErrorNotFound")
ErrNotFound is returned when no results are returned from the database
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
type DBStore struct {
// contains filtered or unexported fields
}
DBStore uses LevelDB to store values.
func NewDBStore ¶
NewDBStore creates a new instance of DBStore.
func NewInmemoryStore ¶
func NewInmemoryStore() *DBStore
NewInmemoryStore returns a new instance of DBStore. To be used only in tests and simulations.
func (*DBStore) Get ¶
Get retrieves a persisted value for a specific key. If there is no results ErrNotFound is returned. The provided parameter should be either a byte slice or a struct that implements the encoding.BinaryUnmarshaler interface
type Store ¶
type Store interface { Get(key string, i interface{}) (err error) Put(key string, i interface{}) (err error) Delete(key string) (err error) Iterate(prefix string, iterFunc iterFunction) (err error) Close() error }
Store defines methods required to get, set, delete values for different keys and close the underlying resources.
Click to show internal directories.
Click to hide internal directories.