Documentation ¶
Index ¶
Constants ¶
View Source
const Delimiter = '/'
Delimiter separates nested paths in storage.
Variables ¶
View Source
var ErrEmptyKey = errs.Class("empty key")
ErrEmptyKey is returned when an empty key is used in Put or in CompareAndSwap.
View Source
var ErrKeyNotFound = errs.Class("key not found")
ErrKeyNotFound used when something doesn't exist.
Functions ¶
Types ¶
type Items ¶
type Items []Item
Items keeps all Item.
type Key ¶
type Key []byte
Key is the type for the keys in a `Store`.
func (Key) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for the Key type.
type Keys ¶
type Keys []Key
Keys is the type for a slice of keys in a `Store`.
func (Keys) ByteSlices ¶
ByteSlices converts a `Keys` struct to a slice of byte-slices (i.e. `[][]byte`).
type Store ¶
type Store interface { // Put adds a value to store. Put(context.Context, Key, Value) error // Get gets a value to store. Get(context.Context, Key) (Value, error) // Delete deletes key and the value. Delete(context.Context, Key) error // Range iterates over all items in unspecified order. // The Key and Value are valid only for the duration of callback. Range(ctx context.Context, fn func(context.Context, Key, Value) error) error // Close closes the store. Close() error }
Store describes key/value stores like redis and boltdb.
Click to show internal directories.
Click to hide internal directories.