Documentation ¶
Overview ¶
Package leveldb contains ledger implementation on top of Go's LevelDB engine
Index ¶
- Variables
- func DropDB() error
- type LevelLedger
- func (ll *LevelLedger) Close() error
- func (ll *LevelLedger) GetClassIndex(ref *record.Reference) (*index.ClassLifeline, error)
- func (ll *LevelLedger) GetObjectIndex(ref *record.Reference) (*index.ObjectLifeline, error)
- func (ll *LevelLedger) GetRecord(ref *record.Reference) (record.Record, error)
- func (ll *LevelLedger) SetClassIndex(ref *record.Reference, idx *index.ClassLifeline) error
- func (ll *LevelLedger) SetObjectIndex(ref *record.Reference, idx *index.ObjectLifeline) error
- func (ll *LevelLedger) SetRecord(rec record.Record) (*record.Reference, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound returns if record/index not found in leveldb storage. ErrNotFound = errors.New("record not found") )
Functions ¶
Types ¶
type LevelLedger ¶
type LevelLedger struct {
// contains filtered or unexported fields
}
LevelLedger represents ledger's LevelDB storage.
func InitDB ¶
func InitDB() (*LevelLedger, error)
InitDB returns LevelLedger with LevelDB initialized with default settings.
func (*LevelLedger) GetClassIndex ¶
func (ll *LevelLedger) GetClassIndex(ref *record.Reference) (*index.ClassLifeline, error)
GetClassIndex fetches lifeline index from leveldb
func (*LevelLedger) GetObjectIndex ¶
func (ll *LevelLedger) GetObjectIndex(ref *record.Reference) (*index.ObjectLifeline, error)
GetObjectIndex fetches lifeline index from leveldb
func (*LevelLedger) GetRecord ¶
GetRecord returns record from leveldb by *record.Reference.
It returns ErrNotFound if the DB does not contains the key.
func (*LevelLedger) SetClassIndex ¶
func (ll *LevelLedger) SetClassIndex(ref *record.Reference, idx *index.ClassLifeline) error
SetClassIndex stores lifeline index into leveldb
func (*LevelLedger) SetObjectIndex ¶
func (ll *LevelLedger) SetObjectIndex(ref *record.Reference, idx *index.ObjectLifeline) error
SetObjectIndex stores lifeline index into leveldb
Click to show internal directories.
Click to hide internal directories.