Documentation ¶
Index ¶
- type RangeSelectFilter
- type Repository
- func (repository Repository) GetAverageBlockTime() float64
- func (repository Repository) GetById(id uint64) *models.Block
- func (repository Repository) GetLastBlock() models.Block
- func (repository Repository) GetPaginated(pagination *tools.Pagination) []models.Block
- func (repository Repository) GetSumSlowBlocksTimeBy24h() float64
- type Resource
- type ValidatorResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RangeSelectFilter ¶
TODO: replace string to int
type Repository ¶
func NewRepository ¶
func NewRepository(db *pg.DB) *Repository
func (Repository) GetAverageBlockTime ¶
func (repository Repository) GetAverageBlockTime() float64
Get average block time
func (Repository) GetById ¶
func (repository Repository) GetById(id uint64) *models.Block
Get block by height (id)
func (Repository) GetLastBlock ¶
func (repository Repository) GetLastBlock() models.Block
Get last block
func (Repository) GetPaginated ¶
func (repository Repository) GetPaginated(pagination *tools.Pagination) []models.Block
Get paginated list of blocks
func (Repository) GetSumSlowBlocksTimeBy24h ¶
func (repository Repository) GetSumSlowBlocksTimeBy24h() float64
Get sum of delta slow time
type Resource ¶
type Resource struct { ID uint64 `json:"height"` Size uint64 `json:"size"` NumTxs uint32 `json:"txCount"` BlockTime float64 `json:"blockTime"` CreatedAt string `json:"created_at"` BlockReward string `json:"reward"` Hash string `json:"hash"` Validators []resource.Interface `json:"validators"` }
func (Resource) Transform ¶
func (Resource) Transform(model resource.ItemInterface, params ...resource.ParamInterface) resource.Interface
lastBlockId - uint64 pointer to the last block height, optional field.
type ValidatorResource ¶
type ValidatorResource struct { PublicKey string `json:"publicKey"` ValidatorMeta resource.Interface `json:"validator_meta"` Signed bool `json:"signed"` }
func (ValidatorResource) Transform ¶
func (ValidatorResource) Transform(model resource.ItemInterface, params ...resource.ParamInterface) resource.Interface
Click to show internal directories.
Click to hide internal directories.