Documentation ¶
Index ¶
Constants ¶
View Source
const ( BlockAggregation = "blocks" TransactionAggregation = "transactions" )
Variables ¶
This section is empty.
Functions ¶
func NewViewHandler ¶
func NewViewHandler(t Transaction, b Block, o Overview) handler
Types ¶
type Block ¶
type Block interface { List(BlockArg) ([]models.Block, int64, error) Get(BlockArg) (models.Block, error) }
func NewBlockHandler ¶
func NewBlockHandler(db *pg.DB) Block
func NewBlockLoggerHandler ¶
func NewBlockLoggerHandler() Block
type BlockArg ¶
type BySegResp ¶
type BySegResp struct { Start int64 `json:"start"` End int64 `json:"end"` Count int64 `json:"count"` }
func QueryBlocks ¶
QueryByBlocks from=0,interval=5,number=2 [-5,0),[0-5), [5-10)
type Overview ¶
type Overview interface { // Summary returns block height, number of transactions, number of nodes, total number of contracts. Summary(string) (SummaryResp, error) // QueryBySeg query the total number of transactions or blocks for a number of time periods // from, interval,number of time periods QueryBySeg(int64, int64, int64, string, string) ([]BySegResp, error) }
func NewOverview ¶
func NewOverview(db *pg.DB) Overview
func NewOverviewLogger ¶
func NewOverviewLogger() Overview
type SummaryResp ¶
type TransArg ¶
type Transaction ¶
type Transaction interface { // List : query transactions List(ta TransArg) ([]models.Transaction, int64, error) // Get : query transaction by transaction hash Get(ta TransArg) (*models.Transaction, error) // CountByOrg : count how many transactions are created by each organization CountByOrg(ta TransArg) ([]Count, error) }
func NewTxHandler ¶
func NewTxHandler(db *pg.DB) Transaction
Click to show internal directories.
Click to hide internal directories.