Documentation ¶
Index ¶
- Variables
- type AccountAggStore
- func (s AccountAggStore) All() ([]model.AccountAgg, error)
- func (s AccountAggStore) Create(record interface{}) error
- func (s AccountAggStore) CreateOrUpdate(acc *model.AccountAgg) error
- func (s AccountAggStore) DeleteByHeight(height int64) error
- func (s AccountAggStore) FindBy(key string, value interface{}) (*model.AccountAgg, error)
- func (s AccountAggStore) FindByID(id int64) (*model.AccountAgg, error)
- func (s AccountAggStore) FindByPublicKey(key string) (*model.AccountAgg, error)
- func (s AccountAggStore) Save(record interface{}) error
- func (s AccountAggStore) Truncate() error
- func (s AccountAggStore) Update(record interface{}) error
- type ActivityPeriodRow
- type BlockSeqStore
- func (s BlockSeqStore) Create(record interface{}) error
- func (s BlockSeqStore) CreateIfNotExists(block *model.BlockSeq) error
- func (s BlockSeqStore) DeleteByHeight(height int64) error
- func (s *BlockSeqStore) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []ActivityPeriodRow) (*int64, error)
- func (s BlockSeqStore) FindBy(key string, value interface{}) (*model.BlockSeq, error)
- func (s BlockSeqStore) FindByHeight(height int64) (*model.BlockSeq, error)
- func (s BlockSeqStore) FindByID(id int64) (*model.BlockSeq, error)
- func (s *BlockSeqStore) FindMostRecent() (*model.BlockSeq, error)
- func (s *BlockSeqStore) GetAvgRecentTimes(limit int64) GetAvgRecentTimesResult
- func (s BlockSeqStore) Save(record interface{}) error
- func (s *BlockSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]BlockSeqSummary, error)
- func (s BlockSeqStore) Truncate() error
- func (s BlockSeqStore) Update(record interface{}) error
- type BlockSeqSummary
- type BlockSummaryStore
- func (s BlockSummaryStore) Create(record interface{}) error
- func (s BlockSummaryStore) DeleteByHeight(height int64) error
- func (s *BlockSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s BlockSummaryStore) Find(query *model.BlockSummary) (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
- func (s *BlockSummaryStore) FindMostRecent() (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
- func (s *BlockSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
- func (s BlockSummaryStore) Save(record interface{}) error
- func (s BlockSummaryStore) Truncate() error
- func (s BlockSummaryStore) Update(record interface{}) error
- type DatabaseStore
- type DebondingDelegationSeqStore
- func (s DebondingDelegationSeqStore) Create(record interface{}) error
- func (s DebondingDelegationSeqStore) CreateIfNotExists(debondingDelegation *model.DebondingDelegationSeq) error
- func (s DebondingDelegationSeqStore) DeleteByHeight(height int64) error
- func (s DebondingDelegationSeqStore) FindByHeight(h int64) ([]model.DebondingDelegationSeq, error)
- func (s *DebondingDelegationSeqStore) FindRecentByDelegatorUID(key string, limit int64) ([]model.DebondingDelegationSeq, error)
- func (s *DebondingDelegationSeqStore) FindRecentByValidatorUID(key string, limit int64) ([]model.DebondingDelegationSeq, error)
- func (s DebondingDelegationSeqStore) Save(record interface{}) error
- func (s DebondingDelegationSeqStore) Truncate() error
- func (s DebondingDelegationSeqStore) Update(record interface{}) error
- type DelegationSeqStore
- func (s DelegationSeqStore) Create(record interface{}) error
- func (s DelegationSeqStore) CreateIfNotExists(delegation *model.DelegationSeq) error
- func (s DelegationSeqStore) DeleteByHeight(height int64) error
- func (s DelegationSeqStore) FindByHeight(h int64) ([]model.DelegationSeq, error)
- func (s *DelegationSeqStore) FindCurrentByDelegatorUID(key string) ([]model.DelegationSeq, error)
- func (s *DelegationSeqStore) FindLastByValidatorUID(key string) ([]model.DelegationSeq, error)
- func (s DelegationSeqStore) Save(record interface{}) error
- func (s DelegationSeqStore) Truncate() error
- func (s DelegationSeqStore) Update(record interface{}) error
- type GetAvgRecentTimesResult
- type GetAvgTimesForIntervalRow
- type GetTotalSizeResult
- type ReportsStore
- func (s ReportsStore) Create(record interface{}) error
- func (s ReportsStore) DeleteByHeight(height int64) error
- func (s *ReportsStore) DeleteReindexing() error
- func (s ReportsStore) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
- func (s ReportsStore) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
- func (s ReportsStore) Last() (*model.Report, error)
- func (s ReportsStore) Save(record interface{}) error
- func (s ReportsStore) Truncate() error
- func (s ReportsStore) Update(record interface{}) error
- type StakingSeqStore
- func (s StakingSeqStore) Create(record interface{}) error
- func (s StakingSeqStore) CreateIfNotExists(staking *model.StakingSeq) error
- func (s StakingSeqStore) DeleteByHeight(height int64) error
- func (s StakingSeqStore) FindBy(key string, value interface{}) (*model.StakingSeq, error)
- func (s StakingSeqStore) FindByHeight(height int64) (*model.StakingSeq, error)
- func (s StakingSeqStore) FindByID(id int64) (*model.StakingSeq, error)
- func (s StakingSeqStore) Recent() (*model.StakingSeq, error)
- func (s StakingSeqStore) Save(record interface{}) error
- func (s StakingSeqStore) Truncate() error
- func (s StakingSeqStore) Update(record interface{}) error
- type Store
- type SyncablesStore
- func (s SyncablesStore) Create(record interface{}) error
- func (s SyncablesStore) CreateOrUpdate(val *model.Syncable) error
- func (s SyncablesStore) DeleteByHeight(height int64) error
- func (s SyncablesStore) FindByHeight(height int64) (syncable *model.Syncable, err error)
- func (s SyncablesStore) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s SyncablesStore) FindMostRecent() (*model.Syncable, error)
- func (s SyncablesStore) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s SyncablesStore) Save(record interface{}) error
- func (s SyncablesStore) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
- func (s SyncablesStore) Truncate() error
- func (s SyncablesStore) Update(record interface{}) error
- type TransactionSeqStore
- func (s TransactionSeqStore) Create(record interface{}) error
- func (s TransactionSeqStore) CreateIfNotExists(transaction *model.TransactionSeq) error
- func (s TransactionSeqStore) DeleteByHeight(height int64) error
- func (s TransactionSeqStore) FindByHeight(h int64) ([]model.TransactionSeq, error)
- func (s TransactionSeqStore) Save(record interface{}) error
- func (s TransactionSeqStore) Truncate() error
- func (s TransactionSeqStore) Update(record interface{}) error
- type ValidatorAggStore
- func (s ValidatorAggStore) All() ([]model.ValidatorAgg, error)
- func (s ValidatorAggStore) Create(record interface{}) error
- func (s ValidatorAggStore) CreateOrUpdate(val *model.ValidatorAgg) error
- func (s ValidatorAggStore) DeleteByHeight(height int64) error
- func (s ValidatorAggStore) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
- func (s *ValidatorAggStore) FindByAddress(address string) (*model.ValidatorAgg, error)
- func (s *ValidatorAggStore) FindByEntityUID(key string) (*model.ValidatorAgg, error)
- func (s ValidatorAggStore) FindByID(id int64) (*model.ValidatorAgg, error)
- func (s *ValidatorAggStore) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
- func (s ValidatorAggStore) Save(record interface{}) error
- func (s ValidatorAggStore) Truncate() error
- func (s ValidatorAggStore) Update(record interface{}) error
- type ValidatorSeqStore
- func (s ValidatorSeqStore) Create(record interface{}) error
- func (s ValidatorSeqStore) CreateIfNotExists(validator *model.ValidatorSeq) error
- func (s ValidatorSeqStore) CreateOrUpdate(val *model.ValidatorSeq) error
- func (s ValidatorSeqStore) DeleteByHeight(height int64) error
- func (s *ValidatorSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSeqStore) FindByHeight(h int64) ([]model.ValidatorSeq, error)
- func (s ValidatorSeqStore) FindByHeightAndEntityUID(h int64, key string) (*model.ValidatorSeq, error)
- func (s ValidatorSeqStore) FindLastByAddress(address string, limit int64) ([]model.ValidatorSeq, error)
- func (s *ValidatorSeqStore) FindMostRecent() (*model.ValidatorSeq, error)
- func (s ValidatorSeqStore) Save(record interface{}) error
- func (s *ValidatorSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorSeqSummary, error)
- func (s ValidatorSeqStore) Truncate() error
- func (s ValidatorSeqStore) Update(record interface{}) error
- type ValidatorSeqSummary
- type ValidatorSummaryRow
- type ValidatorSummaryStore
- func (s ValidatorSummaryStore) Create(record interface{}) error
- func (s ValidatorSummaryStore) DeleteByHeight(height int64) error
- func (s *ValidatorSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSummaryStore) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
- func (s *ValidatorSummaryStore) FindMostRecent() (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
- func (s *ValidatorSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
- func (s *ValidatorSummaryStore) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
- func (s ValidatorSummaryStore) Save(record interface{}) error
- func (s ValidatorSummaryStore) Truncate() error
- func (s ValidatorSummaryStore) Update(record interface{}) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type AccountAggStore ¶
type AccountAggStore struct {
// contains filtered or unexported fields
}
AccountAggStore handles operations on accounts
func NewAccountAggStore ¶
func NewAccountAggStore(db *gorm.DB) *AccountAggStore
func (AccountAggStore) All ¶
func (s AccountAggStore) All() ([]model.AccountAgg, error)
All returns all accounts
func (AccountAggStore) Create ¶
func (s AccountAggStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (AccountAggStore) CreateOrUpdate ¶
func (s AccountAggStore) CreateOrUpdate(acc *model.AccountAgg) error
CreateOrUpdate creates a new account or updates an existing one
func (AccountAggStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (AccountAggStore) FindBy ¶
func (s AccountAggStore) FindBy(key string, value interface{}) (*model.AccountAgg, error)
FindBy returns an account for a matching attribute
func (AccountAggStore) FindByID ¶
func (s AccountAggStore) FindByID(id int64) (*model.AccountAgg, error)
FindByID returns an account for the ID
func (AccountAggStore) FindByPublicKey ¶
func (s AccountAggStore) FindByPublicKey(key string) (*model.AccountAgg, error)
FindByPublicKey returns an account for the public key
func (AccountAggStore) Save ¶
func (s AccountAggStore) Save(record interface{}) error
Save saves record to database
type ActivityPeriodRow ¶ added in v0.4.2
type BlockSeqStore ¶
type BlockSeqStore struct {
// contains filtered or unexported fields
}
BlockSeqStore handles operations on blocks
func NewBlockSeqStore ¶
func NewBlockSeqStore(db *gorm.DB) *BlockSeqStore
func (BlockSeqStore) Create ¶
func (s BlockSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlockSeqStore) CreateIfNotExists ¶
func (s BlockSeqStore) CreateIfNotExists(block *model.BlockSeq) error
CreateIfNotExists creates the block if it does not exist
func (BlockSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*BlockSeqStore) DeleteOlderThan ¶ added in v0.4.0
func (s *BlockSeqStore) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []ActivityPeriodRow) (*int64, error)
DeleteOlderThan deletes block sequence older than given threshold
func (BlockSeqStore) FindBy ¶
func (s BlockSeqStore) FindBy(key string, value interface{}) (*model.BlockSeq, error)
FindBy returns a block for a matching attribute
func (BlockSeqStore) FindByHeight ¶
func (s BlockSeqStore) FindByHeight(height int64) (*model.BlockSeq, error)
FindByHeight returns a block with the matching height
func (BlockSeqStore) FindByID ¶
func (s BlockSeqStore) FindByID(id int64) (*model.BlockSeq, error)
FindByID returns a block with matching ID
func (*BlockSeqStore) FindMostRecent ¶ added in v0.4.0
func (s *BlockSeqStore) FindMostRecent() (*model.BlockSeq, error)
FindMostRecent finds most recent block sequence
func (*BlockSeqStore) GetAvgRecentTimes ¶
func (s *BlockSeqStore) GetAvgRecentTimes(limit int64) GetAvgRecentTimesResult
GetAvgRecentTimes Gets average block times for recent blocks by limit
func (BlockSeqStore) Save ¶
func (s BlockSeqStore) Save(record interface{}) error
Save saves record to database
func (*BlockSeqStore) Summarize ¶ added in v0.4.0
func (s *BlockSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]BlockSeqSummary, error)
Summarize gets the summarized version of block sequences
type BlockSeqSummary ¶ added in v0.4.0
type BlockSummaryStore ¶ added in v0.4.0
type BlockSummaryStore struct {
// contains filtered or unexported fields
}
BlockSummaryStore handles operations on block summary
func NewBlockSummaryStore ¶ added in v0.4.0
func NewBlockSummaryStore(db *gorm.DB) *BlockSummaryStore
func (BlockSummaryStore) Create ¶ added in v0.4.0
func (s BlockSummaryStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlockSummaryStore) DeleteByHeight ¶ added in v0.4.0
DeleteByHeight removes all records associated with a height
func (*BlockSummaryStore) DeleteOlderThan ¶ added in v0.4.0
func (s *BlockSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes block summary records older than given threshold
func (BlockSummaryStore) Find ¶ added in v0.4.0
func (s BlockSummaryStore) Find(query *model.BlockSummary) (*model.BlockSummary, error)
Find find block summary by query
func (*BlockSummaryStore) FindActivityPeriods ¶ added in v0.4.2
func (s *BlockSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*BlockSummaryStore) FindMostRecent ¶ added in v0.4.0
func (s *BlockSummaryStore) FindMostRecent() (*model.BlockSummary, error)
FindMostRecent finds most recent block summary
func (*BlockSummaryStore) FindMostRecentByInterval ¶ added in v0.4.0
func (s *BlockSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
FindMostRecentByInterval finds most recent block summary for given time interval
func (*BlockSummaryStore) FindSummary ¶ added in v0.4.0
func (s *BlockSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
FindSummary Gets summary of block sequences
func (BlockSummaryStore) Save ¶ added in v0.4.0
func (s BlockSummaryStore) Save(record interface{}) error
Save saves record to database
type DatabaseStore ¶ added in v0.4.0
type DatabaseStore struct {
// contains filtered or unexported fields
}
DatabaseStore handles operations on blocks
func NewDatabaseStore ¶ added in v0.4.0
func NewDatabaseStore(db *gorm.DB) *DatabaseStore
func (*DatabaseStore) GetTotalSize ¶ added in v0.4.0
func (s *DatabaseStore) GetTotalSize() (*GetTotalSizeResult, error)
FindSummary Gets average block times for interval
type DebondingDelegationSeqStore ¶
type DebondingDelegationSeqStore struct {
// contains filtered or unexported fields
}
DebondingDelegationSeqStore handles operations on debondingDelegations
func NewDebondingDelegationSeqStore ¶
func NewDebondingDelegationSeqStore(db *gorm.DB) *DebondingDelegationSeqStore
func (DebondingDelegationSeqStore) Create ¶
func (s DebondingDelegationSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (DebondingDelegationSeqStore) CreateIfNotExists ¶
func (s DebondingDelegationSeqStore) CreateIfNotExists(debondingDelegation *model.DebondingDelegationSeq) error
CreateIfNotExists creates the debondingDelegation if it does not exist
func (DebondingDelegationSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (DebondingDelegationSeqStore) FindByHeight ¶
func (s DebondingDelegationSeqStore) FindByHeight(h int64) ([]model.DebondingDelegationSeq, error)
FindByHeight finds debonding delegations by height
func (*DebondingDelegationSeqStore) FindRecentByDelegatorUID ¶
func (s *DebondingDelegationSeqStore) FindRecentByDelegatorUID(key string, limit int64) ([]model.DebondingDelegationSeq, error)
FindRecentByDelegatorUID gets recent debonding delegations for delegator
func (*DebondingDelegationSeqStore) FindRecentByValidatorUID ¶
func (s *DebondingDelegationSeqStore) FindRecentByValidatorUID(key string, limit int64) ([]model.DebondingDelegationSeq, error)
FindRecentByValidatorUID gets recent debonding delegations for validator
func (DebondingDelegationSeqStore) Save ¶
func (s DebondingDelegationSeqStore) Save(record interface{}) error
Save saves record to database
type DelegationSeqStore ¶
type DelegationSeqStore struct {
// contains filtered or unexported fields
}
DelegationSeqStore handles operations on delegations
func NewDelegationSeqStore ¶
func NewDelegationSeqStore(db *gorm.DB) *DelegationSeqStore
func (DelegationSeqStore) Create ¶
func (s DelegationSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (DelegationSeqStore) CreateIfNotExists ¶
func (s DelegationSeqStore) CreateIfNotExists(delegation *model.DelegationSeq) error
CreateIfNotExists creates the delegation if it does not exist
func (DelegationSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (DelegationSeqStore) FindByHeight ¶
func (s DelegationSeqStore) FindByHeight(h int64) ([]model.DelegationSeq, error)
FindByHeight finds delegation by height
func (*DelegationSeqStore) FindCurrentByDelegatorUID ¶
func (s *DelegationSeqStore) FindCurrentByDelegatorUID(key string) ([]model.DelegationSeq, error)
GetCurrentByDelegatorUID gets current delegations for delegator
func (*DelegationSeqStore) FindLastByValidatorUID ¶
func (s *DelegationSeqStore) FindLastByValidatorUID(key string) ([]model.DelegationSeq, error)
GetLastByValidatorUID finds last delegations for validator
func (DelegationSeqStore) Save ¶
func (s DelegationSeqStore) Save(record interface{}) error
Save saves record to database
type GetAvgRecentTimesResult ¶
type GetAvgRecentTimesResult struct { StartHeight int64 `json:"start_height"` EndHeight int64 `json:"end_height"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` Count int64 `json:"count"` Diff float64 `json:"diff"` Avg float64 `json:"avg"` }
GetAvgRecentTimesResult Contains results for GetAvgRecentTimes query
type GetAvgTimesForIntervalRow ¶
type GetAvgTimesForIntervalRow struct { TimeInterval string `json:"time_interval"` Count int64 `json:"count"` Avg float64 `json:"avg"` }
GetAvgTimesForIntervalRow Contains row of data for FindSummary query
type GetTotalSizeResult ¶ added in v0.4.0
type GetTotalSizeResult struct {
Size float64 `json:"size"`
}
GetAvgTimesForIntervalRow Contains row of data for FindSummary query
type ReportsStore ¶
type ReportsStore struct {
// contains filtered or unexported fields
}
ReportsStore handles operations on reports
func NewReportsStore ¶
func NewReportsStore(db *gorm.DB) *ReportsStore
func (ReportsStore) Create ¶
func (s ReportsStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ReportsStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ReportsStore) DeleteReindexing ¶ added in v0.4.2
func (s *ReportsStore) DeleteReindexing() error
DeleteReindexing deletes reports with kind reindexing sequential or parallel
func (ReportsStore) FindNotCompletedByIndexVersion ¶ added in v0.4.2
func (s ReportsStore) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
FindNotCompletedByIndexVersion returns the report by index version and kind
func (ReportsStore) FindNotCompletedByKind ¶ added in v0.4.2
func (s ReportsStore) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
Last returns the last report
func (ReportsStore) Last ¶
func (s ReportsStore) Last() (*model.Report, error)
Last returns the last report
func (ReportsStore) Save ¶
func (s ReportsStore) Save(record interface{}) error
Save saves record to database
type StakingSeqStore ¶
type StakingSeqStore struct {
// contains filtered or unexported fields
}
StakingSeqStore handles operations on staking
func NewStakingSeqStore ¶
func NewStakingSeqStore(db *gorm.DB) *StakingSeqStore
func (StakingSeqStore) Create ¶
func (s StakingSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (StakingSeqStore) CreateIfNotExists ¶
func (s StakingSeqStore) CreateIfNotExists(staking *model.StakingSeq) error
CreateIfNotExists creates the staking if it does not exist
func (StakingSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (StakingSeqStore) FindBy ¶
func (s StakingSeqStore) FindBy(key string, value interface{}) (*model.StakingSeq, error)
FindBy returns a staking for a matching attribute
func (StakingSeqStore) FindByHeight ¶
func (s StakingSeqStore) FindByHeight(height int64) (*model.StakingSeq, error)
FindByHeight returns a staking with the matching height
func (StakingSeqStore) FindByID ¶
func (s StakingSeqStore) FindByID(id int64) (*model.StakingSeq, error)
FindByID returns a staking with matching ID
func (StakingSeqStore) Recent ¶
func (s StakingSeqStore) Recent() (*model.StakingSeq, error)
Recent returns the most recent staking
func (StakingSeqStore) Save ¶
func (s StakingSeqStore) Save(record interface{}) error
Save saves record to database
type Store ¶
type Store struct { Database *DatabaseStore Syncables *SyncablesStore Reports *ReportsStore BlockSeq *BlockSeqStore DebondingDelegationSeq *DebondingDelegationSeqStore DelegationSeq *DelegationSeqStore StakingSeq *StakingSeqStore TransactionSeq *TransactionSeqStore ValidatorSeq *ValidatorSeqStore ValidatorSummary *ValidatorSummaryStore BlockSummary *BlockSummaryStore AccountAgg *AccountAggStore ValidatorAgg *ValidatorAggStore // contains filtered or unexported fields }
Store handles all database operations
func (*Store) SetDebugMode ¶
SetDebugMode enabled detailed query logging
type SyncablesStore ¶
type SyncablesStore struct {
// contains filtered or unexported fields
}
SyncablesStore handles operations on syncables
func NewSyncablesStore ¶
func NewSyncablesStore(db *gorm.DB) *SyncablesStore
func (SyncablesStore) Create ¶
func (s SyncablesStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (SyncablesStore) CreateOrUpdate ¶
func (s SyncablesStore) CreateOrUpdate(val *model.Syncable) error
CreateOrUpdate creates a new syncable or updates an existing one
func (SyncablesStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (SyncablesStore) FindByHeight ¶
func (s SyncablesStore) FindByHeight(height int64) (syncable *model.Syncable, err error)
Exists returns true if a syncable exists at give height
func (SyncablesStore) FindFirstByDifferentIndexVersion ¶ added in v0.4.2
func (s SyncablesStore) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
FindFirstByDifferentIndexVersion returns first syncable with different index version
func (SyncablesStore) FindMostRecent ¶
func (s SyncablesStore) FindMostRecent() (*model.Syncable, error)
FindMostRecent returns the most recent syncable
func (SyncablesStore) FindMostRecentByDifferentIndexVersion ¶ added in v0.4.2
func (s SyncablesStore) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
FindMostRecentByDifferentIndexVersion returns the most recent syncable with different index version
func (SyncablesStore) Save ¶
func (s SyncablesStore) Save(record interface{}) error
Save saves record to database
func (SyncablesStore) SetProcessedAtForRange ¶ added in v0.4.2
func (s SyncablesStore) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
CreateOrUpdate creates a new syncable or updates an existing one
type TransactionSeqStore ¶
type TransactionSeqStore struct {
// contains filtered or unexported fields
}
TransactionSeqStore handles operations on transactions
func NewTransactionSeqStore ¶
func NewTransactionSeqStore(db *gorm.DB) *TransactionSeqStore
func (TransactionSeqStore) Create ¶
func (s TransactionSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (TransactionSeqStore) CreateIfNotExists ¶
func (s TransactionSeqStore) CreateIfNotExists(transaction *model.TransactionSeq) error
CreateIfNotExists creates the transaction if it does not exist
func (TransactionSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (TransactionSeqStore) FindByHeight ¶
func (s TransactionSeqStore) FindByHeight(h int64) ([]model.TransactionSeq, error)
func (TransactionSeqStore) Save ¶
func (s TransactionSeqStore) Save(record interface{}) error
Save saves record to database
type ValidatorAggStore ¶
type ValidatorAggStore struct {
// contains filtered or unexported fields
}
ValidatorAggStore handles operations on validators
func NewValidatorAggStore ¶
func NewValidatorAggStore(db *gorm.DB) *ValidatorAggStore
func (ValidatorAggStore) All ¶
func (s ValidatorAggStore) All() ([]model.ValidatorAgg, error)
All returns all validators
func (ValidatorAggStore) Create ¶
func (s ValidatorAggStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorAggStore) CreateOrUpdate ¶
func (s ValidatorAggStore) CreateOrUpdate(val *model.ValidatorAgg) error
CreateOrUpdate creates a new validator or updates an existing one
func (ValidatorAggStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (ValidatorAggStore) FindBy ¶
func (s ValidatorAggStore) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
FindBy returns an validator for a matching attribute
func (*ValidatorAggStore) FindByAddress ¶ added in v0.4.2
func (s *ValidatorAggStore) FindByAddress(address string) (*model.ValidatorAgg, error)
FindByAddress return validator by entity UID
func (*ValidatorAggStore) FindByEntityUID ¶
func (s *ValidatorAggStore) FindByEntityUID(key string) (*model.ValidatorAgg, error)
FindByEntityUID return validator by entity UID
func (ValidatorAggStore) FindByID ¶
func (s ValidatorAggStore) FindByID(id int64) (*model.ValidatorAgg, error)
FindByID returns an validator for the ID
func (*ValidatorAggStore) GetAllForHeightGreaterThan ¶
func (s *ValidatorAggStore) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
GetAllForHeightGreaterThan returns validators who have been validating since given height
func (ValidatorAggStore) Save ¶
func (s ValidatorAggStore) Save(record interface{}) error
Save saves record to database
type ValidatorSeqStore ¶
type ValidatorSeqStore struct {
// contains filtered or unexported fields
}
ValidatorSeqStore handles operations on validators
func NewValidatorSeqStore ¶
func NewValidatorSeqStore(db *gorm.DB) *ValidatorSeqStore
func (ValidatorSeqStore) Create ¶
func (s ValidatorSeqStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSeqStore) CreateIfNotExists ¶
func (s ValidatorSeqStore) CreateIfNotExists(validator *model.ValidatorSeq) error
CreateIfNotExists creates the validator if it does not exist
func (ValidatorSeqStore) CreateOrUpdate ¶ added in v0.4.2
func (s ValidatorSeqStore) CreateOrUpdate(val *model.ValidatorSeq) error
TODO: FIX CreateOrUpdate creates a new validator sequence or updates an existing one
func (ValidatorSeqStore) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ValidatorSeqStore) DeleteOlderThan ¶ added in v0.4.0
func (s *ValidatorSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes validator sequence older than given threshold
func (ValidatorSeqStore) FindByHeight ¶
func (s ValidatorSeqStore) FindByHeight(h int64) ([]model.ValidatorSeq, error)
FindByHeight finds validator by height
func (ValidatorSeqStore) FindByHeightAndEntityUID ¶ added in v0.4.2
func (s ValidatorSeqStore) FindByHeightAndEntityUID(h int64, key string) (*model.ValidatorSeq, error)
FindByHeight finds validator by height
func (ValidatorSeqStore) FindLastByAddress ¶ added in v0.4.2
func (s ValidatorSeqStore) FindLastByAddress(address string, limit int64) ([]model.ValidatorSeq, error)
FindLastByAddress finds last validator sequences for given entity uid
func (*ValidatorSeqStore) FindMostRecent ¶ added in v0.4.0
func (s *ValidatorSeqStore) FindMostRecent() (*model.ValidatorSeq, error)
FindMostRecent finds most recent validator sequence
func (ValidatorSeqStore) Save ¶
func (s ValidatorSeqStore) Save(record interface{}) error
Save saves record to database
func (*ValidatorSeqStore) Summarize ¶ added in v0.4.0
func (s *ValidatorSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []ActivityPeriodRow) ([]ValidatorSeqSummary, error)
Summarize gets the summarized version of validator sequences
type ValidatorSeqSummary ¶ added in v0.4.0
type ValidatorSeqSummary struct { Address string `json:"address"` TimeBucket types.Time `json:"time_bucket"` VotingPowerAvg float64 `json:"voting_power_avg"` VotingPowerMax float64 `json:"voting_power_max"` VotingPowerMin float64 `json:"voting_power_min"` ValidatedSum int64 `json:"validated_sum"` NotValidatedSum int64 `json:"not_validated_sum"` ProposedSum int64 `json:"proposed_sum"` UptimeAvg float64 `json:"uptime_avg"` }
type ValidatorSummaryRow ¶ added in v0.4.0
type ValidatorSummaryRow struct { TimeBucket string `json:"time_bucket"` TimeInterval string `json:"time_interval"` VotingPowerAvg float64 `json:"voting_power_avg"` VotingPowerMax float64 `json:"voting_power_max"` VotingPowerMin float64 `json:"voting_power_min"` ValidatedSum int64 `json:"validated_sum"` NotValidatedSum int64 `json:"not_validated_sum"` ProposedSum int64 `json:"proposed_sum"` UptimeAvg float64 `json:"uptime_avg"` }
type ValidatorSummaryStore ¶ added in v0.4.0
type ValidatorSummaryStore struct {
// contains filtered or unexported fields
}
ValidatorSummaryStore handles operations on validators
func NewValidatorSummaryStore ¶ added in v0.4.0
func NewValidatorSummaryStore(db *gorm.DB) *ValidatorSummaryStore
func (ValidatorSummaryStore) Create ¶ added in v0.4.0
func (s ValidatorSummaryStore) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSummaryStore) DeleteByHeight ¶ added in v0.4.0
DeleteByHeight removes all records associated with a height
func (*ValidatorSummaryStore) DeleteOlderThan ¶ added in v0.4.0
func (s *ValidatorSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deleted validator summary records older than given threshold
func (ValidatorSummaryStore) Find ¶ added in v0.4.0
func (s ValidatorSummaryStore) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
Find find validator summary by query
func (*ValidatorSummaryStore) FindActivityPeriods ¶ added in v0.4.2
func (s *ValidatorSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*ValidatorSummaryStore) FindMostRecent ¶ added in v0.4.0
func (s *ValidatorSummaryStore) FindMostRecent() (*model.ValidatorSummary, error)
FindMostRecent finds most recent validator summary
func (*ValidatorSummaryStore) FindMostRecentByInterval ¶ added in v0.4.0
func (s *ValidatorSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
FindMostRecentByInterval finds most recent validator summary for interval
func (*ValidatorSummaryStore) FindSummary ¶ added in v0.4.0
func (s *ValidatorSummaryStore) FindSummary(interval types.SummaryInterval, period string) ([]ValidatorSummaryRow, error)
FindSummary gets summary for validator summary
func (*ValidatorSummaryStore) FindSummaryByAddress ¶ added in v0.4.2
func (s *ValidatorSummaryStore) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
FindSummaryByAddress gets summary for given validator
func (ValidatorSummaryStore) Save ¶ added in v0.4.0
func (s ValidatorSummaryStore) Save(record interface{}) error
Save saves record to database
Source Files ¶
- account_agg_store.go
- base_store.go
- block_seq_queries.go
- block_seq_store.go
- block_summary_queries.go
- block_summary_store.go
- database_store.go
- debonding_delegation_seq_store.go
- delegation_seq_store.go
- reports_store.go
- staking_seq_store.go
- store.go
- syncables_store.go
- transaction_seq_store.go
- validator_agg_store.go
- validator_seq_queries.go
- validator_seq_store.go
- validator_summary_queries.go
- validator_summary_store.go