Documentation
¶
Index ¶
- Constants
- Variables
- func OpenLevelDB(dbpath string, create bool) (pbdb database.Db, err error)
- type LevelDb
- func (db *LevelDb) Close() error
- func (db *LevelDb) FetchAllCBlocks() (cBlocks []notaryapi.CBlock, err error)
- func (db *LevelDb) FetchAllChainIDsByName(chainName [][]byte) (chainIDs *[]notaryapi.Hash, err error)
- func (db *LevelDb) FetchAllChainsByName(chainName [][]byte) (chains *[]notaryapi.EChain, err error)
- func (db *LevelDb) FetchAllDBlocks() (dBlocks []notaryapi.DBlock, err error)
- func (db *LevelDb) FetchAllEBInfosByChain(chainID *notaryapi.Hash) (eBInfos *[]notaryapi.EBInfo, err error)
- func (db *LevelDb) FetchAllEBlocksByChain(chainID *notaryapi.Hash) (eBlocks *[]notaryapi.EBlock, err error)
- func (db *LevelDb) FetchAllFBlocks() (fBlocks []factoid.FBlock, err error)
- func (db *LevelDb) FetchCBlockByHash(cBlockHash *notaryapi.Hash) (cBlock *notaryapi.CBlock, err error)
- func (db *LevelDb) FetchChainByHash(chainID *notaryapi.Hash) (chain *notaryapi.EChain, err error)
- func (db *LevelDb) FetchChainByName(chainName [][]byte) (chain *notaryapi.EChain, err error)
- func (db *LevelDb) FetchChainIDByName(chainName [][]byte) (chainID *notaryapi.Hash, err error)
- func (db *LevelDb) FetchDBEntriesFromQueue(startTime *[]byte) (dbentries []*notaryapi.DBEntry, err error)
- func (db *LevelDb) FetchDBInfoByHash(dbHash *notaryapi.Hash) (dbInfo *notaryapi.DBInfo, err error)
- func (db *LevelDb) FetchDBlockByHash(dBlockHash *notaryapi.Hash) (dBlock *notaryapi.DBlock, err error)
- func (db *LevelDb) FetchEBEntriesFromQueue(chainID *[]byte, startTime *[]byte) (ebentries []*notaryapi.EBEntry, err error)
- func (db *LevelDb) FetchEBHashByMR(eBMR *notaryapi.Hash) (eBlockHash *notaryapi.Hash, err error)
- func (db *LevelDb) FetchEBInfoByHash(ebHash *notaryapi.Hash) (ebInfo *notaryapi.EBInfo, err error)
- func (db *LevelDb) FetchEBlockByHash(eBlockHash *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)
- func (db *LevelDb) FetchEBlockByMR(eBMR *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)
- func (db *LevelDb) FetchEntryByHash(entrySha *notaryapi.Hash) (entry *notaryapi.Entry, err error)
- func (db *LevelDb) FetchEntryInfoBranchByHash(entryHash *notaryapi.Hash) (entryInfoBranch *notaryapi.EntryInfoBranch, err error)
- func (db *LevelDb) FetchEntryInfoByHash(entryHash *notaryapi.Hash) (entryInfo *notaryapi.EntryInfo, err error)
- func (db *LevelDb) FetchFBlockByHash(fBlockHash *notaryapi.Hash) (fBlock *factoid.FBlock, err error)
- func (db *LevelDb) InitializeExternalIDMap() (extIDMap map[string]bool, err error)
- func (db *LevelDb) InsertChain(chain *notaryapi.EChain) (err error)
- func (db *LevelDb) InsertDBInfo(dbInfo notaryapi.DBInfo) (err error)
- func (db *LevelDb) InsertEntryAndQueue(entrySha *notaryapi.Hash, binaryEntry *[]byte, entry *notaryapi.Entry, ...) (err error)
- func (db *LevelDb) ProcessCBlockBatch(block *notaryapi.CBlock) error
- func (db *LevelDb) ProcessDBlockBatch(dblock *notaryapi.DBlock) error
- func (db *LevelDb) ProcessEBlockBatch(eblock *notaryapi.EBlock) error
- func (db *LevelDb) ProcessFBlockBatch(block *factoid.FBlock) error
- func (db *LevelDb) RollbackClose() error
- func (db *LevelDb) Sync() error
Constants ¶
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
const ( STATUS_IN_QUEUE uint8 = iota STATUS_PROCESSED )
the process status in db
Variables ¶
var CurrentDBVersion int32 = 1
Functions ¶
Types ¶
type LevelDb ¶
type LevelDb struct {
// contains filtered or unexported fields
}
func (*LevelDb) FetchAllCBlocks ¶
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 ¶
FetchAllChainByName gets all of the chains under the path - name
func (*LevelDb) FetchAllDBlocks ¶
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 ¶
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 ¶
FetchChainByHash gets a chain by chainID
func (*LevelDb) FetchChainByName ¶
FetchChainByName gets a chain by chain name
func (*LevelDb) FetchChainIDByName ¶
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 ¶
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 ¶
FetchEBHashByMR gets an entry by hash from the database.
func (*LevelDb) FetchEBInfoByHash ¶
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 ¶
FetchEBlockByMR gets an entry block by merkle root from the database.
func (*LevelDb) FetchEntryByHash ¶
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 ¶
Initialize External ID map for explorer search
func (*LevelDb) InsertChain ¶
InsertChain inserts the newly created chain into db
func (*LevelDb) InsertDBInfo ¶
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 ¶
ProcessCBlockBatche inserts the CBlock and update all it's cbentries in DB
func (*LevelDb) ProcessDBlockBatch ¶
ProcessDBlockBatche inserts the DBlock and update all it's dbentries in DB
func (*LevelDb) ProcessEBlockBatch ¶
ProcessEBlockBatche inserts the EBlock and update all it's ebentries in DB
func (*LevelDb) ProcessFBlockBatch ¶
ProcessFBlockBatche inserts the FBlock