Documentation ¶
Index ¶
- Variables
- func NewLevelDB(path string) (database.Database, error)
- func NewTestDatabase() (db database.Database, dispose func())
- func StartMetrics(db database.Database, dbname string, log *log.ScdoLog)
- type Batch
- type DBMetrics
- type LevelDB
- func (db *LevelDB) Close()
- func (db *LevelDB) Delete(key []byte) error
- func (db *LevelDB) DeleteSring(key string) error
- func (db *LevelDB) Get(key []byte) ([]byte, error)
- func (db *LevelDB) GetString(key string) (string, error)
- func (db *LevelDB) Has(key []byte) (ret bool, err error)
- func (db *LevelDB) HasString(key string) (ret bool, err error)
- func (db *LevelDB) NewBatch() database.Batch
- func (db *LevelDB) Put(key []byte, value []byte) error
- func (db *LevelDB) PutString(key string, value string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyKey key is empty ErrEmptyKey = errors.New("key could not be empty") )
Functions ¶
func NewLevelDB ¶
NewLevelDB constructs and returns a LevelDB instance
func NewTestDatabase ¶
NewTestDatabase creates a database instance under temp folder.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch implements batch for leveldb
type DBMetrics ¶
type DBMetrics struct {
// contains filtered or unexported fields
}
DBMetrics defines the metrics used by leveldb
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
LevelDB wraps the leveldb
func (*LevelDB) DeleteSring ¶
DeleteSring deletes the value for the given key.
Click to show internal directories.
Click to hide internal directories.