leveldb

package
v6.4.2-rc1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LevelDBGets = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "factomd_database_leveldb_gets",
		Help: "Counts gets from the database",
	})
	LevelDBPuts = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "factomd_database_leveldb_puts",
		Help: "Count puts to the database",
	})
	LevelDBCacheblock = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "factomd_database_leveldb_cacheblock",
		Help: "Memory used by Level DB for caching",
	})
)

Functions

func CombineBucketAndKey

func CombineBucketAndKey(bucket []byte, key []byte) []byte

func ExtendBucket

func ExtendBucket(bucket []byte) []byte

func NewLevelDB

func NewLevelDB(filename string, create bool) (interfaces.IDatabase, error)

func RegisterPrometheus

func RegisterPrometheus()

RegisterPrometheus registers the variables to be exposed. This can only be run once, hence the boolean flag to prevent panics if launched more than once. This is called in NetStart

Types

type LevelDB

type LevelDB struct {
	// contains filtered or unexported fields
}

func (*LevelDB) Clear

func (db *LevelDB) Clear(bucket []byte) error

func (*LevelDB) Close

func (db *LevelDB) Close() error

func (*LevelDB) Delete

func (db *LevelDB) Delete(bucket []byte, key []byte) error

func (*LevelDB) DoesKeyExist

func (db *LevelDB) DoesKeyExist(bucket, key []byte) (bool, error)

func (*LevelDB) Get

func (db *LevelDB) Get(bucket []byte, key []byte, destination interfaces.BinaryMarshallable) (interfaces.BinaryMarshallable, error)

func (*LevelDB) GetAll

func (*LevelDB) ListAllBuckets

func (db *LevelDB) ListAllBuckets() ([][]byte, error)

func (*LevelDB) ListAllKeys

func (db *LevelDB) ListAllKeys(bucket []byte) (keys [][]byte, err error)

func (*LevelDB) Put

func (db *LevelDB) Put(bucket []byte, key []byte, data interfaces.BinaryMarshallable) error

func (*LevelDB) PutInBatch

func (db *LevelDB) PutInBatch(records []interfaces.Record) error

func (*LevelDB) Trim

func (db *LevelDB) Trim()

Can't trim a real database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL