Documentation ¶
Overview ¶
Package badger implements database backend based on badger.
Index ¶
- type Badger
- func (db *Badger) Close() error
- func (db *Badger) DBType() string
- func (db *Badger) Del(keys []string) error
- func (db *Badger) GC() error
- func (db *Badger) Get(key string) (string, error)
- func (db *Badger) HDel(hashmap string, keys []string) error
- func (db *Badger) HGet(hashmap, key string) (string, error)
- func (db *Badger) HGetAll(hashmap string) (map[string]string, error)
- func (db *Badger) HKeys(hashmap string) ([]string, error)
- func (db *Badger) HLen(hashmap string) (int, error)
- func (db *Badger) HSet(hashmap, key, value string) error
- func (db *Badger) Iter(prefetch, includeOffset bool, offset, prefix string, ...) error
- func (db *Badger) Open(path string) error
- func (db *Badger) Set(key, value string) error
- func (db *Badger) Size() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Badger ¶
type Badger struct {
DB *badger.DB
}
Badger represents a badger database instance.
var Database Badger
Database is an instance of the database backend.
func (*Badger) DBType ¶
DBType returns the name of the database as a string.
func (*Badger) Del ¶
Del deletes a key from the database.
func (*Badger) Get ¶
Get gets the value of a key from the database.
func (*Badger) HDel ¶
HDel deletes a key from a hashmap.
func (*Badger) HGet ¶
HGet gets the value of a key from a hashmap.
func (*Badger) HGetAll ¶
HGetAll gets all key-value pairs of a hashmap.
func (*Badger) HKeys ¶
HKeys gets all keys of a hashmap.
func (*Badger) HLen ¶
HLen gets the length of a hashmap.
func (*Badger) HSet ¶
HSet adds a key-value pair to a hashmap.
func (*Badger) Iter ¶
func (db *Badger) Iter(prefetch, includeOffset bool, offset, prefix string, handler func(key, value string) bool) error
Iter iterates through stuff in the database.
func (*Badger) Set ¶
Set adds a key-value pair to the database.
Click to show internal directories.
Click to hide internal directories.