Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBadgerDB ¶ added in v1.0.2
InitBadgerDB returns a new initialized BadgerDB database implementing the DB interface. If the database cannot be initialized, an error will be returned.
Types ¶
type BadgerDB ¶ added in v1.0.2
type BadgerDB struct {
// contains filtered or unexported fields
}
BadgerDB is a wrapper around a BadgerDB backend database that implements the DB interface.
func (*BadgerDB) Close ¶ added in v1.0.2
Close implements the DB interface. It closes the connection to the underlying BadgerDB database as well as invoking the context's cancel function.
func (*BadgerDB) Get ¶ added in v1.0.2
Get implements the DB interface. It attempts to get a value for a given key and namespace. If the key does not exist in the provided namespace, an error is returned, otherwise the retrieved value.
type DB ¶ added in v1.0.2
type DB interface { Get(namespace, key []byte) (value []byte, err error) Set(namespace, key, value []byte) error Has(namespace, key []byte) (bool, error) Close() error }
DB defines an embedded key/value store database interface.
Click to show internal directories.
Click to hide internal directories.