Documentation
¶
Overview ¶
Package kv defines a standard interface for key-value stores and key-value iterators. It provides persistent implementations using BadgerDB. It provides non-persistent implementations using a concurrent-safe in-memory map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NewJSON returns a key-value store that marshals and unmarshals values // using the standard Golang JSON marshalers. For more information, see // https://golang.org/pkg/encoding/json. NewJSON = json.New // NewGob returns a key-value store that encodes and decodes values using // gob. For more information, see https://golang.org/pkg/encoding/gob. NewGob = gob.New )
View Source
var ( // NewBadgerDB returns a key-value database that is implemented using // BadgerDB. For more information, see https://github.com/dgraph-io/badger. NewBadgerDB = badgerdb.New // NewMemDB returns a key-value database that is implemented in-memory. This // implementation is fast, but does not store data on-disk. A time-to-live can // be used to automatically delete key-value tuples after they have been in the // database for more than a specific duration. A time-to-live of zero will keep // key-value tuples until they are explicitly deleted. It is safe for concurrent // use. NewMemDB = memdb.New // NewLevelDB returns a key-value database that is implemented using // LevelDB. For more information, see https://github.com/syndtr/goleveldb. NewLevelDB = leveldb.New )
View Source
var ( // ErrNotFound is returned when there is no value associated with a key. ErrNotFound = db.ErrNotFound )
View Source
var ( // NewTTLCache returns a cache that wraps an underlying store. Keys that have // no been accessed for the specified duration will be automatically deleted // from the underlying store. It is safe for concurrent use, as long as the // underlying store is also safe for concurrent use. NewTTLCache = cache.NewTTL )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.