Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerBackend ¶
type BadgerBackend struct {
// contains filtered or unexported fields
}
BadgerBackend is a backend implemented using BadgerDB.
func NewBadgerBackend ¶
func NewBadgerBackend(path string) (*BadgerBackend, error)
NewBadgerBackend returns an initialized backend, opening (or creating, if not present) a badgerDB from the specified path.
func (*BadgerBackend) Close ¶
func (b *BadgerBackend) Close() error
Close closes the underlying badgerDB.
func (*BadgerBackend) Get ¶
func (b *BadgerBackend) Get(key string) (string, error)
Get takes a key as a string and returns the associated value saved in the storage, if present. If something goes wrong, it returns a non-nil error.
func (*BadgerBackend) Put ¶
func (b *BadgerBackend) Put(key, value string) error
Put takes a key-value pair in input and saves them in the underlying storage. It returns an error if something goes wrong.
Click to show internal directories.
Click to hide internal directories.