Documentation ¶
Index ¶
- Variables
- func CombineBucketAndKey(bucket []byte, key []byte) []byte
- func ExtendBucket(bucket []byte) []byte
- func NewLevelDB(filename string, create bool) (interfaces.IDatabase, error)
- func RegisterPrometheus()
- type LevelDB
- func (db *LevelDB) Clear(bucket []byte) error
- func (db *LevelDB) Close() error
- func (db *LevelDB) Delete(bucket []byte, key []byte) error
- func (db *LevelDB) DoesKeyExist(bucket, key []byte) (bool, error)
- func (db *LevelDB) Get(bucket []byte, key []byte, destination interfaces.BinaryMarshallable) (interfaces.BinaryMarshallable, error)
- func (db *LevelDB) GetAll(bucket []byte, sample interfaces.BinaryMarshallableAndCopyable) ([]interfaces.BinaryMarshallableAndCopyable, [][]byte, error)
- func (db *LevelDB) ListAllBuckets() ([][]byte, error)
- func (db *LevelDB) ListAllKeys(bucket []byte) (keys [][]byte, err error)
- func (db *LevelDB) Put(bucket []byte, key []byte, data interfaces.BinaryMarshallable) error
- func (db *LevelDB) PutInBatch(records []interfaces.Record) error
- func (db *LevelDB) Trim()
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 ExtendBucket ¶
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) Get ¶
func (db *LevelDB) Get(bucket []byte, key []byte, destination interfaces.BinaryMarshallable) (interfaces.BinaryMarshallable, error)
func (*LevelDB) GetAll ¶
func (db *LevelDB) GetAll(bucket []byte, sample interfaces.BinaryMarshallableAndCopyable) ([]interfaces.BinaryMarshallableAndCopyable, [][]byte, error)
func (*LevelDB) ListAllBuckets ¶
func (*LevelDB) ListAllKeys ¶
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
Click to show internal directories.
Click to hide internal directories.