Documentation
¶
Index ¶
- Constants
- type BlockchainDB
- func (blockchainDB *BlockchainDB) AtomicWrite(writeBatchs []*WriteBatch) error
- func (blockchainDB *BlockchainDB) Close()
- func (blockchainDB *BlockchainDB) Delete(cfName string, key []byte) error
- func (blockchainDB *BlockchainDB) Get(cfName string, key []byte) ([]byte, error)
- func (blockchainDB *BlockchainDB) GetByPrefix(prefix []byte, resCh chan map[string][]byte)
- func (blockchainDB *BlockchainDB) Put(cfName string, key []byte, value []byte) error
- type CfHandlerMap
- type Config
- type WriteBatch
Constants ¶
View Source
const ( // OperationPut represents put operation OperationPut uint = iota // OperationDelete represents delete operation OperationDelete )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockchainDB ¶
BlockchainDB encapsulates rocksdb's structures
func (*BlockchainDB) AtomicWrite ¶
func (blockchainDB *BlockchainDB) AtomicWrite(writeBatchs []*WriteBatch) error
AtomicWrite writes batch
func (*BlockchainDB) Close ¶
func (blockchainDB *BlockchainDB) Close()
Close releases all column family handles and closes rocksdb
func (*BlockchainDB) Delete ¶
func (blockchainDB *BlockchainDB) Delete(cfName string, key []byte) error
Delete deletes the given key in the specified column family
func (*BlockchainDB) Get ¶
func (blockchainDB *BlockchainDB) Get(cfName string, key []byte) ([]byte, error)
Get returns the value for the given column family and key
func (*BlockchainDB) GetByPrefix ¶
func (blockchainDB *BlockchainDB) GetByPrefix(prefix []byte, resCh chan map[string][]byte)
GetByPrefix for bulk reads
type CfHandlerMap ¶
type CfHandlerMap map[string]*gorocksdb.ColumnFamilyHandle
CfHandlerMap is columnfamilies handler set
type Config ¶
type Config struct {
DbPath string
Columnfamilies []string
KeepLogFileNumber int
MaxLogFileSize int
LogLevel string
}
Config is the configuration of the gorocksdb
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig defines the default configuration of the rocksdb
type WriteBatch ¶
WriteBatch wrappers batch operation
func NewWriteBatch ¶
func NewWriteBatch(cfName string, operation uint, key, value []byte) *WriteBatch
NewWriteBatch returns a writebatch instance
Click to show internal directories.
Click to hide internal directories.