Documentation ¶
Index ¶
- Constants
- Variables
- func NewRaw(connStr string) (*gorm.DB, error)
- type AddressesStore
- type DB
- type DelegationsSearch
- type DelegatorsStore
- type NetworksStore
- type Row
- type RowFunc
- type ValidatorsSearch
- type ValidatorsStore
- func (s ValidatorsStore) CreateStats(t time.Time, bucket string) error
- func (s ValidatorsStore) FindByNodeID(id string) (*model.Validator, error)
- func (s ValidatorsStore) GetStats(id string, bucket string, limit int) ([]model.ValidatorStat, error)
- func (s ValidatorsStore) Import(records []model.Validator) error
- func (s ValidatorsStore) ImportSeq(records []model.ValidatorSeq) error
- func (s ValidatorsStore) LastHeight() (int64, error)
- func (s ValidatorsStore) LastTime() (*time.Time, error)
- func (s ValidatorsStore) PurgeSeq(before time.Time) (int64, error)
- func (s ValidatorsStore) Search(search ValidatorsSearch) ([]model.Validator, error)
Constants ¶
View Source
const (
DelegationsBatchSize = 1000 // max number of delegations to import per batch
)
Variables ¶
View Source
var ErrNotFound = gorm.ErrRecordNotFound
Functions ¶
Types ¶
type AddressesStore ¶
type DB ¶
type DB struct { Addresses AddressesStore Validators ValidatorsStore Delegators DelegatorsStore Networks NetworksStore // contains filtered or unexported fields }
func (DB) ResetTableSeqCounters ¶
type DelegationsSearch ¶ added in v0.2.1
type DelegatorsStore ¶
func (DelegatorsStore) Import ¶
func (s DelegatorsStore) Import(records []model.Delegation, batchSize int) error
Import imports delegations records in bulk
func (DelegatorsStore) Search ¶ added in v0.2.1
func (s DelegatorsStore) Search(search DelegationsSearch) ([]model.Delegation, error)
Search performs a seach on delegations
type NetworksStore ¶
func (NetworksStore) CreateMetric ¶
func (s NetworksStore) CreateMetric(record *model.NetworkMetric) error
CreateMetric creates a new network metric record
func (NetworksStore) CreateStats ¶
func (s NetworksStore) CreateStats(t time.Time, bucket string) error
CreateStats creates a stat for a given time bucket
func (NetworksStore) GetStats ¶
func (s NetworksStore) GetStats(bucket string, limit int) ([]model.NetworkStat, error)
GetStats returns a set of stats for a given time bucket
type ValidatorsSearch ¶ added in v0.2.1
type ValidatorsSearch struct { RewardAddress string `form:"reward_address"` CapacityPercentMin uint `form:"capacity_percent_min"` CapacityPercentMax uint `form:"capacity_percent_max"` }
func (ValidatorsSearch) Validate ¶ added in v0.2.1
func (s ValidatorsSearch) Validate() error
type ValidatorsStore ¶
func (ValidatorsStore) CreateStats ¶
func (s ValidatorsStore) CreateStats(t time.Time, bucket string) error
func (ValidatorsStore) FindByNodeID ¶
func (s ValidatorsStore) FindByNodeID(id string) (*model.Validator, error)
func (ValidatorsStore) GetStats ¶
func (s ValidatorsStore) GetStats(id string, bucket string, limit int) ([]model.ValidatorStat, error)
func (ValidatorsStore) ImportSeq ¶
func (s ValidatorsStore) ImportSeq(records []model.ValidatorSeq) error
func (ValidatorsStore) LastHeight ¶
func (s ValidatorsStore) LastHeight() (int64, error)
func (ValidatorsStore) LastTime ¶ added in v0.2.1
func (s ValidatorsStore) LastTime() (*time.Time, error)
func (ValidatorsStore) PurgeSeq ¶
func (s ValidatorsStore) PurgeSeq(before time.Time) (int64, error)
func (ValidatorsStore) Search ¶ added in v0.2.1
func (s ValidatorsStore) Search(search ValidatorsSearch) ([]model.Validator, error)
Click to show internal directories.
Click to hide internal directories.