Documentation
¶
Index ¶
Constants ¶
View Source
const EmptyPrefix = Key("")
Variables ¶
This section is empty.
Functions ¶
func MustIterate ¶ added in v0.1.0
Types ¶
type KVStore ¶
type KVStore interface {
KVStoreWriter
KVStoreReader
}
KVStore represents a key-value store where both keys and values are arbitrary byte slices.
type KVStoreReader ¶ added in v0.1.0
type KVStoreReader interface {
// Get returns the value, or nil if not found
Get(key Key) ([]byte, error)
Has(key Key) (bool, error)
Iterate(prefix Key, f func(key Key, value []byte) bool) error
IterateKeys(prefix Key, f func(key Key) bool) error
// MustGet returns the value, or nil if not found
MustGet(key Key) []byte
MustHas(key Key) bool
MustIterate(prefix Key, f func(key Key, value []byte) bool)
MustIterateKeys(prefix Key, f func(key Key) bool)
}
type KVStoreWriter ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.