ldb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2015 License: MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TBL_ENTRY uint8 = iota
	TBL_ENTRY_QUEUE
	TBL_ENTRY_INFO

	TBL_EB       //3
	TBL_EB_QUEUE //4
	TBL_EB_INFO  //5
	TBL_EB_CHAIN_NUM
	TBL_EB_MR

	TBL_DB //8
	TBL_DB_NUM
	TBL_DB_INFO

	TBL_CHAIN_HASH //11
	TBL_CHAIN_NAME

	TBL_CB //13
	TBL_CB_NUM
	TBL_CB_INFO

	TBL_FB //16
	TBL_FB_NUM
	TBL_FB_INFO
)

the "table" prefix

View Source
const (
	STATUS_IN_QUEUE uint8 = iota
	STATUS_PROCESSED
)

the process status in db

Variables

View Source
var CurrentDBVersion int32 = 1

Functions

func OpenLevelDB

func OpenLevelDB(dbpath string, create bool) (pbdb database.Db, err error)

to be removed??

Types

type LevelDb

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

func (*LevelDb) Close

func (db *LevelDb) Close() error

Close cleanly shuts down database, syncing all data.

func (*LevelDb) FetchAllCBlocks

func (db *LevelDb) FetchAllCBlocks() (cBlocks []notaryapi.CBlock, err error)

FetchAllCBlocks gets all of the entry credit blocks

func (*LevelDb) FetchAllChainIDsByName

func (db *LevelDb) FetchAllChainIDsByName(chainName [][]byte) (chainIDs *[]notaryapi.Hash, err error)

FetchAllChainIDsByName gets all of the chainIDs under the path - name

func (*LevelDb) FetchAllChainsByName

func (db *LevelDb) FetchAllChainsByName(chainName [][]byte) (chains *[]notaryapi.EChain, err error)

FetchAllChainByName gets all of the chains under the path - name

func (*LevelDb) FetchAllDBlocks

func (db *LevelDb) FetchAllDBlocks() (dBlocks []notaryapi.DBlock, err error)

FetchAllDBInfo gets all of the fbInfo

func (*LevelDb) FetchAllEBInfosByChain

func (db *LevelDb) FetchAllEBInfosByChain(chainID *notaryapi.Hash) (eBInfos *[]notaryapi.EBInfo, err error)

FetchAllEBInfosByChain gets all of the entry block infos by chain id

func (*LevelDb) FetchAllEBlocksByChain

func (db *LevelDb) FetchAllEBlocksByChain(chainID *notaryapi.Hash) (eBlocks *[]notaryapi.EBlock, err error)

FetchAllEBlocksByChain gets all of the blocks by chain id

func (*LevelDb) FetchAllFBlocks

func (db *LevelDb) FetchAllFBlocks() (fBlocks []factoid.FBlock, err error)

FetchAllFBlocks gets all of the factoid blocks

func (*LevelDb) FetchCBlockByHash

func (db *LevelDb) FetchCBlockByHash(cBlockHash *notaryapi.Hash) (cBlock *notaryapi.CBlock, err error)

FetchCntryBlock gets a block by hash from the database.

func (*LevelDb) FetchChainByHash

func (db *LevelDb) FetchChainByHash(chainID *notaryapi.Hash) (chain *notaryapi.EChain, err error)

FetchChainByHash gets a chain by chainID

func (*LevelDb) FetchChainByName

func (db *LevelDb) FetchChainByName(chainName [][]byte) (chain *notaryapi.EChain, err error)

FetchChainByName gets a chain by chain name

func (*LevelDb) FetchChainIDByName

func (db *LevelDb) FetchChainIDByName(chainName [][]byte) (chainID *notaryapi.Hash, err error)

FetchChainIDByName gets a chainID by chain name

func (*LevelDb) FetchDBEntriesFromQueue

func (db *LevelDb) FetchDBEntriesFromQueue(startTime *[]byte) (dbentries []*notaryapi.DBEntry, err error)

FetchDBEntriesFromQueue gets all of the dbentries that have not been processed

func (*LevelDb) FetchDBInfoByHash

func (db *LevelDb) FetchDBInfoByHash(dbHash *notaryapi.Hash) (dbInfo *notaryapi.DBInfo, err error)

FetchDBInfoByHash gets an DBInfo obj

func (*LevelDb) FetchDBlockByHash

func (db *LevelDb) FetchDBlockByHash(dBlockHash *notaryapi.Hash) (dBlock *notaryapi.DBlock, err error)

FetchDBlock gets an entry by hash from the database.

func (*LevelDb) FetchEBEntriesFromQueue

func (db *LevelDb) FetchEBEntriesFromQueue(chainID *[]byte, startTime *[]byte) (ebentries []*notaryapi.EBEntry, err error)

FetchEBEntriesFromQueue gets all of the ebentries that have not been processed

func (*LevelDb) FetchEBHashByMR

func (db *LevelDb) FetchEBHashByMR(eBMR *notaryapi.Hash) (eBlockHash *notaryapi.Hash, err error)

FetchEBHashByMR gets an entry by hash from the database.

func (*LevelDb) FetchEBInfoByHash

func (db *LevelDb) FetchEBInfoByHash(ebHash *notaryapi.Hash) (ebInfo *notaryapi.EBInfo, err error)

FetchEBInfoByHash gets an EBInfo obj

func (*LevelDb) FetchEBlockByHash

func (db *LevelDb) FetchEBlockByHash(eBlockHash *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)

FetchEntryBlock gets an entry by hash from the database.

func (*LevelDb) FetchEBlockByMR

func (db *LevelDb) FetchEBlockByMR(eBMR *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)

FetchEBlockByMR gets an entry block by merkle root from the database.

func (*LevelDb) FetchEntryByHash

func (db *LevelDb) FetchEntryByHash(entrySha *notaryapi.Hash) (entry *notaryapi.Entry, err error)

FetchEntry gets an entry by hash from the database.

func (*LevelDb) FetchEntryInfoBranchByHash

func (db *LevelDb) FetchEntryInfoBranchByHash(entryHash *notaryapi.Hash) (entryInfoBranch *notaryapi.EntryInfoBranch, err error)

FetchEntryInfoBranchByHash gets an EntryInfoBranch obj

func (*LevelDb) FetchEntryInfoByHash

func (db *LevelDb) FetchEntryInfoByHash(entryHash *notaryapi.Hash) (entryInfo *notaryapi.EntryInfo, err error)

FetchEntryInfoBranchByHash gets an EntryInfo obj

func (*LevelDb) FetchFBlockByHash

func (db *LevelDb) FetchFBlockByHash(fBlockHash *notaryapi.Hash) (fBlock *factoid.FBlock, err error)

FetchCntryBlock gets a block by hash from the database.

func (*LevelDb) InitializeExternalIDMap

func (db *LevelDb) InitializeExternalIDMap() (extIDMap map[string]bool, err error)

Initialize External ID map for explorer search

func (*LevelDb) InsertChain

func (db *LevelDb) InsertChain(chain *notaryapi.EChain) (err error)

InsertChain inserts the newly created chain into db

func (*LevelDb) InsertDBInfo

func (db *LevelDb) InsertDBInfo(dbInfo notaryapi.DBInfo) (err error)

Insert the Directory Block meta data into db

func (*LevelDb) InsertEntryAndQueue

func (db *LevelDb) InsertEntryAndQueue(entrySha *notaryapi.Hash, binaryEntry *[]byte, entry *notaryapi.Entry, chainID *[]byte) (err error)

InsertEntry inserts an entry and put it in queue

func (*LevelDb) ProcessCBlockBatch

func (db *LevelDb) ProcessCBlockBatch(block *notaryapi.CBlock) error

ProcessCBlockBatche inserts the CBlock and update all it's cbentries in DB

func (*LevelDb) ProcessDBlockBatch

func (db *LevelDb) ProcessDBlockBatch(dblock *notaryapi.DBlock) error

ProcessDBlockBatche inserts the DBlock and update all it's dbentries in DB

func (*LevelDb) ProcessEBlockBatch

func (db *LevelDb) ProcessEBlockBatch(eblock *notaryapi.EBlock) error

ProcessEBlockBatche inserts the EBlock and update all it's ebentries in DB

func (*LevelDb) ProcessFBlockBatch

func (db *LevelDb) ProcessFBlockBatch(block *factoid.FBlock) error

ProcessFBlockBatche inserts the FBlock

func (*LevelDb) RollbackClose

func (db *LevelDb) RollbackClose() error

func (*LevelDb) Sync

func (db *LevelDb) Sync() error

Sync verifies that the database is coherent on disk, and no outstanding transactions are in flight.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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