Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BadgerAlertNamespace defines the alerts BadgerDB namespace. BadgerAlertNamespace = []byte("alerts") )
Functions ¶
This section is empty.
Types ¶
type BadgerDB ¶
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 ¶
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 ¶
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 ¶
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.
func NewBadgerDB ¶
NewBadgerDB returns a new initialized BadgerDB database implementing the DB interface. If the database cannot be initialized, an error will be returned.
Click to show internal directories.
Click to hide internal directories.