Documentation ¶
Index ¶
- type Config
- type DB
- func (db *DB) Close() error
- func (db *DB) Delete(namespace, key []byte) error
- func (db *DB) Get(namespace, key []byte) (metadata []byte, err error)
- func (db *DB) ListKeys(namespace []byte, cb dbp.ListCallback) error
- func (db *DB) Set(namespace, key, metadata []byte) error
- func (db *DB) Update(namespace, key []byte, cb dbp.UpdateCallback) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Badger data directory DataDir string `yaml:"datadir"` // Badger metadata directory MetaDir string `yaml:"metadir"` }
Config represents badger DB configuration
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB defines a metastor database implementation, using badger on the local FS as its underlying storage medium.
func New ¶
New creates a new metastor database implementation, using badger on the local FS as storage medium.
Both the data and meta dir are required. If you want to be able to specify more options than just the required data and metadata directory, you can make use of the `NewWithOpts` function, as this function will use default options for all other badger options.
func NewWithOpts ¶
NewWithOpts creates a new metastor database implementation, using badger on the local FS as storage medium.
Both the data and meta dir, defined as properties of the given options, are required.