Documentation
¶
Index ¶
Constants ¶
View Source
const AllShas = int64(^uint64(0) >> 1)
AllShas is a special value that can be used as the final sha when requesting a range of shas by height to request them all.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db interface {
// Close cleanly shuts down the database and syncs all data.
Close() (err error)
// RollbackClose discards the recent database changes to the previously
// saved data at last Sync and closes the database.
RollbackClose() (err error)
// Sync verifies that the database is coherent on disk and no
// outstanding transactions are in flight.
Sync() (err error)
// InsertEntry inserts an entry and put it on a process queue
InsertEntryAndQueue(entrySha *notaryapi.Hash, binaryEntry *[]byte, entry *notaryapi.Entry, chainID *[]byte) (err error)
// FetchEntry gets an entry by hash from the database.
FetchEntryByHash(entrySha *notaryapi.Hash) (entry *notaryapi.Entry, err error)
// FetchEBEntriesFromQueue gets all of the ebentries that have not been processed
FetchEBEntriesFromQueue(chainID *[]byte, startTime *[]byte) (ebentries []*notaryapi.EBEntry, err error)
// ProcessEBlockBatche inserts the EBlock and update all it's ebentries in DB
ProcessEBlockBatch(eblock *notaryapi.EBlock) error
// FetchDBEntriesFromQueue gets all of the dbentries that have not been processed
FetchDBEntriesFromQueue(startTime *[]byte) (dbentries []*notaryapi.DBEntry, err error)
// InsertChain inserts the newly created chain into db
InsertChain(chain *notaryapi.EChain) (err error)
// FetchEBInfoByHash gets a chain by chainID
FetchChainByHash(chainID *notaryapi.Hash) (chain *notaryapi.EChain, err error)
// FetchChainByName gets a chain by chain name
FetchChainByName(chainName [][]byte) (chain *notaryapi.EChain, err error)
// FetchAllChainByName gets all of the chains under the path - name
FetchAllChainsByName(chainName [][]byte) (chains *[]notaryapi.EChain, err error)
// FetchEntryInfoBranchByHash gets an EntryInfo obj
FetchEntryInfoByHash(entryHash *notaryapi.Hash) (entryInfo *notaryapi.EntryInfo, err error)
// FetchEntryInfoBranchByHash gets an EntryInfoBranch obj
FetchEntryInfoBranchByHash(entryHash *notaryapi.Hash) (entryInfoBranch *notaryapi.EntryInfoBranch, err error)
// FetchEntryBlock gets an entry by hash from the database.
FetchEBlockByHash(eBlockHash *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)
// FetchEBlockByMR gets an entry block by merkle root from the database.
FetchEBlockByMR(eBMR *notaryapi.Hash) (eBlock *notaryapi.EBlock, err error)
// FetchEBHashByMR gets an entry by hash from the database.
FetchEBHashByMR(eBMR *notaryapi.Hash) (eBlockHash *notaryapi.Hash, err error)
// FetchEBInfoByHash gets an EBInfo obj
FetchEBInfoByHash(ebHash *notaryapi.Hash) (ebInfo *notaryapi.EBInfo, err error)
// FetchAllEBlocksByChain gets all of the blocks by chain id
FetchAllEBlocksByChain(chainID *notaryapi.Hash) (eBlocks *[]notaryapi.EBlock, err error)
// FetchAllEBInfosByChain gets all of the entry block infos by chain id
FetchAllEBInfosByChain(chainID *notaryapi.Hash) (eBInfos *[]notaryapi.EBInfo, err error)
// FetchDBlock gets an entry by hash from the database.
FetchDBlockByHash(dBlockHash *notaryapi.Hash) (dBlock *notaryapi.DBlock, err error)
// FetchDBBatchByHash gets an FBBatch obj
FetchDBInfoByHash(dbHash *notaryapi.Hash) (dbInfo *notaryapi.DBInfo, err error)
// Insert the Directory Block meta data into db
InsertDBInfo(dbInfo notaryapi.DBInfo) (err error)
// ProcessDBlockBatche inserts the EBlock and update all it's ebentries in DB
ProcessDBlockBatch(block *notaryapi.DBlock) error
// FetchAllCBlocks gets all of the entry credit blocks
FetchAllCBlocks() (cBlocks []notaryapi.CBlock, err error)
// FetchAllFBInfo gets all of the fbInfo
FetchAllDBlocks() (fBlocks []notaryapi.DBlock, err error)
// ProcessCBlockBatche inserts the CBlock and update all it's cbentries in DB
ProcessCBlockBatch(block *notaryapi.CBlock) (err error)
// Initialize External ID map for explorer search
InitializeExternalIDMap() (extIDMap map[string]bool, err error)
// ProcessFBlockBatche inserts the FBlock
ProcessFBlockBatch(block *factoid.FBlock) error
// FetchAllFBlocks gets all of the factoid blocks
FetchAllFBlocks() (fBlocks []factoid.FBlock, err error)
}
Db defines a generic interface that is used to request and insert data into db
Click to show internal directories.
Click to hide internal directories.