Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Read retrieves a slice of entries from the storage. The output is a slice of the same type as // of `shape`, possibly of length 0. // The provided type has to implement a binary.Unmarshaler interface Read(key []byte, shape encoding.BinaryUnmarshaler, buckets ...[]byte) (interface{}, error) // ReadAll goes through each key of a bucket and return a slice of all values. This implies // therefore that all values in each key are of the same type (the shape provided) ReadAll(shape encoding.BinaryUnmarshaler, buckets ...[]byte) (interface{}, error) // Update replaces a set of entries by the new given set Update(key []byte, entries []encoding.BinaryMarshaler, buckets ...[]byte) error // Append adds at the end of an existing set the new given set Append(key []byte, entries []encoding.BinaryMarshaler, buckets ...[]byte) error // Delete complete removes all targeted entries Delete(key []byte, buckets ...[]byte) error // Reset empties a bucket Reset(buckets ...[]byte) error // Close terminates the communication with the storage Close() error }
The storage Interface provides an abstraction on top of the bolt database to store and access data in a local in-memory database. All methods uses a slice of buckets as bucket selector, each subsequent bucket being nested in the previous one. Each time also, the key can be omitted in which case it will fall back to a default key.
Click to show internal directories.
Click to hide internal directories.