Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultStorageEngine default storage engine
DefaultStorageEngine = "ldb"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Badger ¶
type Badger struct {
// contains filtered or unexported fields
}
Badger is badger.KV
func (*Badger) Close ¶
Close closes a KV. It's crucial to call it to ensure all the pending updates make their way to disk.
func (*Badger) Delete ¶
Delete deletes a key. Exposing this so that user does not have to specify the Entry directly. For example, BitDelete seems internal to badger.
type Storage ¶
type Storage interface { Set(k, v []byte) error Get(k []byte) ([]byte, error) Delete(k []byte) error Has(k []byte) (bool, error) ForEach(fn func(k, v []byte) error) error Close() error WALName() string }
Storage is storage interface
func OpenBadgerStorage ¶
OpenBadgerStorage open Badger storage
func OpenBoltStorage ¶
OpenBoltStorage open Bolt storage
func OpenLeveldbStorage ¶
OpenLeveldbStorage opens or creates a DB for the given storage. The DB will be created if not exist, unless ErrorIfMissing is true. Also, if ErrorIfExist is true and the DB exist Open will returns os.ErrExist error.
Click to show internal directories.
Click to hide internal directories.