Documentation ¶
Index ¶
- type Manager
- func (m *Manager) AddBucket(bucket string)
- func (m *Manager) AddLabel(label string)
- func (m *Manager) BeginBatch()
- func (m *Manager) Close()
- func (m *Manager) EndBatch()
- func (m *Manager) Get(Bucket, Label string, key []byte) (value []byte)
- func (m *Manager) GetCount() int64
- func (m *Manager) GetIndex(element []byte) int64
- func (m *Manager) GetInt64(Bucket, Label string, key []byte) (value int64)
- func (m *Manager) GetKey(Bucket, Label string, key []byte) (DBKey [storage.KeyLength]byte)
- func (m *Manager) GetString(Bucket, Label string, key []byte) (value string)
- func (m *Manager) Init(database, filename string) error
- func (m *Manager) Put(Bucket, Label string, key []byte, value []byte) (err error)
- func (m *Manager) PutBatch(Bucket, Label string, key []byte, value []byte) error
- func (m *Manager) PutInt64(Bucket, Label string, key []byte, value int64) error
- func (m *Manager) PutString(Bucket, Label string, key []byte, value string) error
- type TXList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { DB storage.KeyValueDB // Underlying database implementation Buckets map[string]byte // one byte to indicate a bucket Labels map[string]byte // one byte to indicate a label TXList TXList // Transaction List Count int64 // The number of elements in this database }
func (*Manager) AddBucket ¶
AddBucket Add a bucket to be used in the database. Initializing a database requires that buckets and labels be added in the correct order.
func (*Manager) AddLabel ¶ added in v0.0.18
AddLabel Add a Label to be used in the database. Initializing a database requires that buckets and labels be added in the correct order.
func (*Manager) BeginBatch ¶ added in v0.0.14
func (m *Manager) BeginBatch()
func (*Manager) Close ¶
func (m *Manager) Close()
Close Do any cleanup required to close the manager
func (*Manager) Get ¶
Get Get a []byte value from the underlying database. Returns a nil if not found, or on an error
func (*Manager) GetCount ¶ added in v0.0.16
GetCount The number of elements as recorded in the Database. Note that this may differ from the count in the the actual Merkle Tree in memory due to batching transactions
func (*Manager) GetIndex ¶
GetIndex Return the int64 value tied to the element hash in the ElementIndex bucket
func (*Manager) GetInt64 ¶
GetInt64 Get a string value from the underlying database. Returns a nil if not found, or on an error
func (*Manager) GetKey ¶
GetKey Given a Bucket Name, a Label name, and a key, GetKey returns a single key to be used in a key/value database
func (*Manager) GetString ¶
GetString Get a string value from the underlying database. Returns a nil if not found, or on an error