Documentation ¶
Index ¶
- Variables
- type AccountActivitySeq
- func (s AccountActivitySeq) BulkUpsert(records []model.AccountActivitySeq) error
- func (s AccountActivitySeq) Create(record interface{}) error
- func (s AccountActivitySeq) DeleteByHeight(height int64) error
- func (s *AccountActivitySeq) DeleteForHeight(h int64) (*int64, error)
- func (s *AccountActivitySeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s AccountActivitySeq) FindByHeight(h int64) ([]model.AccountActivitySeq, error)
- func (s AccountActivitySeq) FindByHeightAndAddress(height int64, address string) ([]model.AccountActivitySeq, error)
- func (s AccountActivitySeq) FindLastByAddress(address string, limit int64) ([]model.AccountActivitySeq, error)
- func (s AccountActivitySeq) FindLastByAddressAndKind(address string, kind string, limit int64) ([]model.AccountActivitySeq, error)
- func (s *AccountActivitySeq) FindMostRecent() (*model.AccountActivitySeq, error)
- func (s AccountActivitySeq) Save(record interface{}) error
- func (s AccountActivitySeq) Truncate() error
- func (s AccountActivitySeq) Update(record interface{}) error
- type BlockSeq
- func (s BlockSeq) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s BlockSeq) Create(block *model.BlockSeq) error
- func (s BlockSeq) CreateIfNotExists(block *model.BlockSeq) error
- func (s BlockSeq) DeleteByHeight(height int64) error
- func (s *BlockSeq) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []store.ActivityPeriodRow) (*int64, error)
- func (s BlockSeq) FindBy(key string, value interface{}) (*model.BlockSeq, error)
- func (s BlockSeq) FindByHeight(height int64) (*model.BlockSeq, error)
- func (s BlockSeq) FindByID(id int64) (*model.BlockSeq, error)
- func (s *BlockSeq) FindMostRecent() (*model.BlockSeq, error)
- func (s *BlockSeq) GetAvgRecentTimes(limit int64) store.GetAvgRecentTimesResult
- func (s BlockSeq) Save(block *model.BlockSeq) error
- func (s *BlockSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.BlockSeqSummary, error)
- func (s BlockSeq) Truncate() error
- func (s BlockSeq) Update(record interface{}) error
- type BlockSummary
- func (s BlockSummary) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s BlockSummary) Create(record interface{}) error
- func (s BlockSummary) DeleteByHeight(height int64) error
- func (s *BlockSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s BlockSummary) Find(query *model.BlockSummary) (*model.BlockSummary, error)
- func (s *BlockSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
- func (s *BlockSummary) FindMostRecent() (*model.BlockSummary, error)
- func (s *BlockSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
- func (s *BlockSummary) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
- func (s BlockSummary) Save(record interface{}) error
- func (s BlockSummary) Truncate() error
- func (s BlockSummary) Update(record interface{}) error
- type Database
- type GovernanceActivitySeq
- func (s GovernanceActivitySeq) BulkUpsert(records []model.GovernanceActivitySeq) error
- func (s GovernanceActivitySeq) Create(record interface{}) error
- func (s GovernanceActivitySeq) CreateIfNotExists(governanceActivity *model.GovernanceActivitySeq) error
- func (s GovernanceActivitySeq) DeleteByHeight(height int64) error
- func (s *GovernanceActivitySeq) DeleteForHeight(h int64) (*int64, error)
- func (s *GovernanceActivitySeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s GovernanceActivitySeq) FindByHeight(h int64) ([]model.GovernanceActivitySeq, error)
- func (s GovernanceActivitySeq) FindByHeightAndProposalId(height int64, proposalId uint64) ([]model.GovernanceActivitySeq, error)
- func (s GovernanceActivitySeq) FindByProposalId(proposalId uint64, limit int64, cursor *int64) ([]model.GovernanceActivitySeq, *int64, error)
- func (s GovernanceActivitySeq) FindLastByProposalId(proposalId uint64, limit int64) ([]model.GovernanceActivitySeq, error)
- func (s GovernanceActivitySeq) FindLastByProposalIdAndKind(proposalId uint64, kind string, limit int64) ([]model.GovernanceActivitySeq, error)
- func (s *GovernanceActivitySeq) FindMostRecent() (*model.GovernanceActivitySeq, error)
- func (s GovernanceActivitySeq) Save(record interface{}) error
- func (s GovernanceActivitySeq) Truncate() error
- func (s GovernanceActivitySeq) Update(record interface{}) error
- type Jobs
- func (s Jobs) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s Jobs) Create(jobs []model.Job) error
- func (s Jobs) DeleteByHeight(height int64) error
- func (s Jobs) FindAllUnfinished() ([]model.Job, error)
- func (s Jobs) FindByHeight(height int64) (*model.Job, error)
- func (s Jobs) LastFinishedHeight() (int64, error)
- func (s Jobs) LastSyncedHeight() (int64, error)
- func (s Jobs) Save(record interface{}) error
- func (s Jobs) Truncate() error
- func (s Jobs) Update(job *model.Job, fields ...string) error
- type ProposalAgg
- func (s ProposalAgg) All(limit int64, cursor *int64) ([]model.ProposalAgg, *int64, error)
- func (s ProposalAgg) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s ProposalAgg) Create(val *model.ProposalAgg) error
- func (s ProposalAgg) CreateOrUpdate(val *model.ProposalAgg) error
- func (s ProposalAgg) DeleteByHeight(height int64) error
- func (s ProposalAgg) FindBy(key string, value interface{}) (*model.ProposalAgg, error)
- func (s ProposalAgg) FindByID(id int64) (*model.ProposalAgg, error)
- func (s *ProposalAgg) FindByProposalId(proposalId uint64) (*model.ProposalAgg, error)
- func (s ProposalAgg) Save(val *model.ProposalAgg) error
- func (s ProposalAgg) Truncate() error
- func (s ProposalAgg) Update(record interface{}) error
- type Reports
- func (s Reports) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s Reports) Create(val *model.Report) error
- func (s Reports) DeleteByHeight(height int64) error
- func (s *Reports) DeleteByKinds(kinds []model.ReportKind) error
- func (s Reports) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
- func (s Reports) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)
- func (s Reports) Last() (*model.Report, error)
- func (s Reports) Save(val *model.Report) error
- func (s Reports) Truncate() error
- func (s Reports) Update(record interface{}) error
- type Store
- func (s *Store) Close() error
- func (s *Store) GetAccounts() *accounts
- func (s *Store) GetBlocks() *blocks
- func (s *Store) GetCore() *core
- func (s *Store) GetGovernance() *governance
- func (s *Store) GetValidatorGroups() *validatorGroups
- func (s *Store) GetValidators() *validators
- func (s *Store) SetDebugMode(enabled bool)
- func (s *Store) Test() error
- type Syncables
- func (s Syncables) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s Syncables) Create(record interface{}) error
- func (s Syncables) CreateOrUpdate(val *model.Syncable) error
- func (s Syncables) DeleteByHeight(height int64) error
- func (s Syncables) FindByHeight(height int64) (syncable *model.Syncable, err error)
- func (s Syncables) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s Syncables) FindLastInEpoch(epoch int64) (syncable *model.Syncable, err error)
- func (s Syncables) FindLastInEpochForHeight(height int64) (syncable *model.Syncable, err error)
- func (s Syncables) FindMostRecent() (*model.Syncable, error)
- func (s Syncables) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
- func (s Syncables) FindMostRecentProcessed() (*model.Syncable, error)
- func (s Syncables) FindSmallestIndexVersion() (*int64, error)
- func (s Syncables) Save(val *model.Syncable) error
- func (s Syncables) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
- func (s Syncables) Truncate() error
- func (s Syncables) Update(record interface{}) error
- type SystemEvents
- func (s SystemEvents) BulkUpsert(records []model.SystemEvent) error
- func (s SystemEvents) Create(record interface{}) error
- func (s SystemEvents) CreateOrUpdate(val *model.SystemEvent) error
- func (s SystemEvents) DeleteByHeight(height int64) error
- func (s *SystemEvents) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s SystemEvents) FindAll(query store.FindAll) ([]model.SystemEvent, error)
- func (s SystemEvents) FindByActor(actorAddress string, query store.FindSystemEventByActorQuery) ([]model.SystemEvent, error)
- func (s SystemEvents) FindByHeight(height int64) ([]model.SystemEvent, error)
- func (s *SystemEvents) FindMostRecent() (*model.SystemEvent, error)
- func (s SystemEvents) FindUnique(height int64, address string, kind model.SystemEventKind) (*model.SystemEvent, error)
- func (s SystemEvents) Save(record interface{}) error
- func (s SystemEvents) Truncate() error
- func (s SystemEvents) Update(record interface{}) error
- type ValidatorAgg
- func (s ValidatorAgg) All() ([]model.ValidatorAgg, error)
- func (s ValidatorAgg) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s ValidatorAgg) Create(val *model.ValidatorAgg) error
- func (s ValidatorAgg) DeleteByHeight(height int64) error
- func (s ValidatorAgg) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
- func (s *ValidatorAgg) FindByAddress(key string) (*model.ValidatorAgg, error)
- func (s ValidatorAgg) FindByID(id int64) (*model.ValidatorAgg, error)
- func (s *ValidatorAgg) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
- func (s ValidatorAgg) Save(val *model.ValidatorAgg) error
- func (s ValidatorAgg) Truncate() error
- func (s ValidatorAgg) Update(record interface{}) error
- func (s ValidatorAgg) UpdateIdentity(val *model.ValidatorAgg) error
- type ValidatorGroupAgg
- func (s ValidatorGroupAgg) All() ([]model.ValidatorGroupAgg, error)
- func (s ValidatorGroupAgg) BulkUpsert(query string, rows int, fn bulk.RowFunc) error
- func (s ValidatorGroupAgg) Create(val *model.ValidatorGroupAgg) error
- func (s ValidatorGroupAgg) CreateOrUpdate(val *model.ValidatorGroupAgg) error
- func (s ValidatorGroupAgg) DeleteByHeight(height int64) error
- func (s ValidatorGroupAgg) FindBy(key string, value interface{}) (*model.ValidatorGroupAgg, error)
- func (s *ValidatorGroupAgg) FindByAddress(key string) (*model.ValidatorGroupAgg, error)
- func (s ValidatorGroupAgg) FindByID(id int64) (*model.ValidatorGroupAgg, error)
- func (s ValidatorGroupAgg) Save(val *model.ValidatorGroupAgg) error
- func (s ValidatorGroupAgg) Truncate() error
- func (s ValidatorGroupAgg) Update(record interface{}) error
- func (s ValidatorGroupAgg) UpdateIdentity(val *model.ValidatorGroupAgg) error
- type ValidatorGroupSeq
- func (s ValidatorGroupSeq) BulkUpsert(records []model.ValidatorGroupSeq) error
- func (s ValidatorGroupSeq) Create(record interface{}) error
- func (s ValidatorGroupSeq) DeleteByHeight(height int64) error
- func (s *ValidatorGroupSeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s ValidatorGroupSeq) FindByHeight(h int64) ([]model.ValidatorGroupSeq, error)
- func (s ValidatorGroupSeq) FindByHeightAndAddress(height int64, address string) (*model.ValidatorGroupSeq, error)
- func (s ValidatorGroupSeq) FindLastByAddress(address string, limit int64) ([]model.ValidatorGroupSeq, error)
- func (s *ValidatorGroupSeq) FindMostRecent() (*model.ValidatorGroupSeq, error)
- func (s ValidatorGroupSeq) Save(record interface{}) error
- func (s *ValidatorGroupSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.ValidatorGroupSeqSummary, error)
- func (s ValidatorGroupSeq) Truncate() error
- func (s ValidatorGroupSeq) Update(record interface{}) error
- type ValidatorGroupSummary
- func (s ValidatorGroupSummary) BulkUpsert(records []model.ValidatorGroupSummary) error
- func (s ValidatorGroupSummary) Create(record interface{}) error
- func (s ValidatorGroupSummary) DeleteByHeight(height int64) error
- func (s *ValidatorGroupSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s ValidatorGroupSummary) Find(query *model.ValidatorGroupSummary) (*model.ValidatorGroupSummary, error)
- func (s *ValidatorGroupSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
- func (s *ValidatorGroupSummary) FindMostRecent() (*model.ValidatorGroupSummary, error)
- func (s *ValidatorGroupSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorGroupSummary, error)
- func (s *ValidatorGroupSummary) FindSummary(interval types.SummaryInterval, period string) ([]store.ValidatorGroupSummaryRow, error)
- func (s *ValidatorGroupSummary) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorGroupSummary, error)
- func (s ValidatorGroupSummary) Save(record interface{}) error
- func (s ValidatorGroupSummary) Truncate() error
- func (s ValidatorGroupSummary) Update(record interface{}) error
- type ValidatorSeq
- func (s ValidatorSeq) BulkUpsert(records []model.ValidatorSeq) error
- func (s ValidatorSeq) Create(record interface{}) error
- func (s ValidatorSeq) DeleteByHeight(height int64) error
- func (s *ValidatorSeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSeq) FindByHeight(height int64) ([]model.ValidatorSeq, error)
- func (s ValidatorSeq) FindByHeightAndAddress(height int64, address string) (*model.ValidatorSeq, error)
- func (s ValidatorSeq) FindLastByAddress(address string, limit int64) ([]model.ValidatorSeq, error)
- func (s *ValidatorSeq) FindMostRecent() (*model.ValidatorSeq, error)
- func (s ValidatorSeq) Save(record interface{}) error
- func (s *ValidatorSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.ValidatorSeqSummary, error)
- func (s ValidatorSeq) Truncate() error
- func (s ValidatorSeq) Update(record interface{}) error
- type ValidatorSummary
- func (s ValidatorSummary) BulkUpsert(records []model.ValidatorSummary) error
- func (s ValidatorSummary) Create(record interface{}) error
- func (s ValidatorSummary) DeleteByHeight(height int64) error
- func (s *ValidatorSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
- func (s ValidatorSummary) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
- func (s *ValidatorSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
- func (s *ValidatorSummary) FindMostRecent() (*model.ValidatorSummary, error)
- func (s *ValidatorSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
- func (s *ValidatorSummary) FindSummary(interval types.SummaryInterval, period string) ([]store.ValidatorSummaryRow, error)
- func (s *ValidatorSummary) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
- func (s ValidatorSummary) Save(record interface{}) error
- func (s ValidatorSummary) Truncate() error
- func (s ValidatorSummary) Update(record interface{}) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("record not found")
)
Functions ¶
This section is empty.
Types ¶
type AccountActivitySeq ¶
type AccountActivitySeq struct {
// contains filtered or unexported fields
}
AccountActivitySeq handles operations on account activities
func NewAccountActivitySeqStore ¶
func NewAccountActivitySeqStore(db *gorm.DB) *AccountActivitySeq
func (AccountActivitySeq) BulkUpsert ¶
func (s AccountActivitySeq) BulkUpsert(records []model.AccountActivitySeq) error
BulkUpsert insert account activity sequences in bulk
func (AccountActivitySeq) Create ¶
func (s AccountActivitySeq) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (AccountActivitySeq) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*AccountActivitySeq) DeleteForHeight ¶
func (s *AccountActivitySeq) DeleteForHeight(h int64) (*int64, error)
DeleteForHeight deletes account activity sequence for given height
func (*AccountActivitySeq) DeleteOlderThan ¶
func (s *AccountActivitySeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes account activity sequence older than given threshold
func (AccountActivitySeq) FindByHeight ¶
func (s AccountActivitySeq) FindByHeight(h int64) ([]model.AccountActivitySeq, error)
FindByHeight finds account activity sequences by height
func (AccountActivitySeq) FindByHeightAndAddress ¶
func (s AccountActivitySeq) FindByHeightAndAddress(height int64, address string) ([]model.AccountActivitySeq, error)
FindByHeightAndAddress finds account activities by height and address
func (AccountActivitySeq) FindLastByAddress ¶
func (s AccountActivitySeq) FindLastByAddress(address string, limit int64) ([]model.AccountActivitySeq, error)
FindLastByAddress finds last account activity sequences for given address
func (AccountActivitySeq) FindLastByAddressAndKind ¶
func (s AccountActivitySeq) FindLastByAddressAndKind(address string, kind string, limit int64) ([]model.AccountActivitySeq, error)
FindLastByAddressAndKind finds last account activity sequences for given address and kind
func (*AccountActivitySeq) FindMostRecent ¶
func (s *AccountActivitySeq) FindMostRecent() (*model.AccountActivitySeq, error)
FindMostRecent finds most recent account activity sequence
func (AccountActivitySeq) Save ¶
func (s AccountActivitySeq) Save(record interface{}) error
Save saves record to database
type BlockSeq ¶
type BlockSeq struct {
// contains filtered or unexported fields
}
BlockSeq handles operations on blocks
func NewBlockSeqStore ¶
func (BlockSeq) BulkUpsert ¶
BulkUpsert imports records in bulk
func (BlockSeq) CreateIfNotExists ¶
CreateIfNotExists creates the block if it does not exist
func (BlockSeq) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*BlockSeq) DeleteOlderThan ¶
func (s *BlockSeq) DeleteOlderThan(purgeThreshold time.Time, activityPeriods []store.ActivityPeriodRow) (*int64, error)
DeleteOlderThan deletes block sequence older than given threshold
func (BlockSeq) FindByHeight ¶
FindByHeight returns a block with the matching height
func (*BlockSeq) FindMostRecent ¶
FindMostRecent finds most recent block sequence
func (*BlockSeq) GetAvgRecentTimes ¶
func (s *BlockSeq) GetAvgRecentTimes(limit int64) store.GetAvgRecentTimesResult
GetAvgRecentTimes Gets average block times for recent blocks by limit
func (*BlockSeq) Summarize ¶
func (s *BlockSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.BlockSeqSummary, error)
Summarize gets the summarized version of block sequences
type BlockSummary ¶
type BlockSummary struct {
// contains filtered or unexported fields
}
BlockSummary handles operations on block summary
func NewBlockSummaryStore ¶
func NewBlockSummaryStore(db *gorm.DB) *BlockSummary
func (BlockSummary) BulkUpsert ¶
BulkUpsert imports records in bulk
func (BlockSummary) Create ¶
func (s BlockSummary) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (BlockSummary) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*BlockSummary) DeleteOlderThan ¶
func (s *BlockSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes block summary records older than given threshold
func (BlockSummary) Find ¶
func (s BlockSummary) Find(query *model.BlockSummary) (*model.BlockSummary, error)
Find find block summary by query
func (*BlockSummary) FindActivityPeriods ¶
func (s *BlockSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*BlockSummary) FindMostRecent ¶
func (s *BlockSummary) FindMostRecent() (*model.BlockSummary, error)
FindMostRecent finds most recent block summary
func (*BlockSummary) FindMostRecentByInterval ¶
func (s *BlockSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)
FindMostRecentByInterval finds most recent block summary for given time interval
func (*BlockSummary) FindSummary ¶
func (s *BlockSummary) FindSummary(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)
FindSummary Gets summary of block sequences
func (BlockSummary) Save ¶
func (s BlockSummary) Save(record interface{}) error
Save saves record to database
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database handles operations on blocks
func NewDatabaseStore ¶
func (*Database) GetTotalSize ¶
func (s *Database) GetTotalSize() (*store.GetTotalSizeResult, error)
FindSummary Gets average block times for interval
type GovernanceActivitySeq ¶
type GovernanceActivitySeq struct {
// contains filtered or unexported fields
}
GovernanceActivitySeq handles operations on governance activities
func NewGovernanceActivitySeqStore ¶
func NewGovernanceActivitySeqStore(db *gorm.DB) *GovernanceActivitySeq
func (GovernanceActivitySeq) BulkUpsert ¶
func (s GovernanceActivitySeq) BulkUpsert(records []model.GovernanceActivitySeq) error
BulkUpsert insert validator sequences in bulk
func (GovernanceActivitySeq) Create ¶
func (s GovernanceActivitySeq) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (GovernanceActivitySeq) CreateIfNotExists ¶
func (s GovernanceActivitySeq) CreateIfNotExists(governanceActivity *model.GovernanceActivitySeq) error
CreateIfNotExists creates the governance activity if it does not exist
func (GovernanceActivitySeq) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*GovernanceActivitySeq) DeleteForHeight ¶
func (s *GovernanceActivitySeq) DeleteForHeight(h int64) (*int64, error)
DeleteForHeight deletes governance activity sequence for given height
func (*GovernanceActivitySeq) DeleteOlderThan ¶
func (s *GovernanceActivitySeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes governance activity sequence older than given threshold
func (GovernanceActivitySeq) FindByHeight ¶
func (s GovernanceActivitySeq) FindByHeight(h int64) ([]model.GovernanceActivitySeq, error)
FindByHeight finds governance activity sequences by height
func (GovernanceActivitySeq) FindByHeightAndProposalId ¶
func (s GovernanceActivitySeq) FindByHeightAndProposalId(height int64, proposalId uint64) ([]model.GovernanceActivitySeq, error)
FindByHeightAndProposalId finds governance activities by height and proposal Id
func (GovernanceActivitySeq) FindByProposalId ¶
func (s GovernanceActivitySeq) FindByProposalId(proposalId uint64, limit int64, cursor *int64) ([]model.GovernanceActivitySeq, *int64, error)
FindByProposalId finds governance activities by proposal Id
func (GovernanceActivitySeq) FindLastByProposalId ¶
func (s GovernanceActivitySeq) FindLastByProposalId(proposalId uint64, limit int64) ([]model.GovernanceActivitySeq, error)
FindLastByProposalId finds last governance activity sequences for given proposal Id
func (GovernanceActivitySeq) FindLastByProposalIdAndKind ¶
func (s GovernanceActivitySeq) FindLastByProposalIdAndKind(proposalId uint64, kind string, limit int64) ([]model.GovernanceActivitySeq, error)
FindLastByProposalIdAndKind finds last governance activity sequences for given proposal Id and kind
func (*GovernanceActivitySeq) FindMostRecent ¶
func (s *GovernanceActivitySeq) FindMostRecent() (*model.GovernanceActivitySeq, error)
FindMostRecent finds most recent governance activity sequence
func (GovernanceActivitySeq) Save ¶
func (s GovernanceActivitySeq) Save(record interface{}) error
Save saves record to database
type Jobs ¶ added in v0.2.0
type Jobs struct {
// contains filtered or unexported fields
}
Jobs handles operations on jobs
func NewJobsStore ¶ added in v0.2.0
func (Jobs) BulkUpsert ¶ added in v0.2.0
BulkUpsert imports records in bulk
func (Jobs) DeleteByHeight ¶ added in v0.2.0
DeleteByHeight removes all records associated with a height
func (Jobs) FindAllUnfinished ¶ added in v0.2.0
FindAllUnfinished retrieves all of the unfinished jobs
func (Jobs) FindByHeight ¶ added in v0.2.0
FindByHeight retrieves a job record for a given height
func (Jobs) LastFinishedHeight ¶ added in v0.2.0
LastFinishedHeight returns the most recent finished height
func (Jobs) LastSyncedHeight ¶ added in v0.2.0
LastSyncedHeight returns the most recent synced height
func (Jobs) Save ¶ added in v0.2.0
func (s Jobs) Save(record interface{}) error
Save saves record to database
type ProposalAgg ¶
type ProposalAgg struct {
// contains filtered or unexported fields
}
ProposalAgg handles operations on proposals
func NewProposalAggStore ¶
func NewProposalAggStore(db *gorm.DB) *ProposalAgg
func (ProposalAgg) All ¶
func (s ProposalAgg) All(limit int64, cursor *int64) ([]model.ProposalAgg, *int64, error)
All returns all proposals
func (ProposalAgg) BulkUpsert ¶
BulkUpsert imports records in bulk
func (ProposalAgg) Create ¶
func (s ProposalAgg) Create(val *model.ProposalAgg) error
Create creates the proposal aggregate
func (ProposalAgg) CreateOrUpdate ¶
func (s ProposalAgg) CreateOrUpdate(val *model.ProposalAgg) error
CreateOrUpdate creates a new proposal or updates an existing one
func (ProposalAgg) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (ProposalAgg) FindBy ¶
func (s ProposalAgg) FindBy(key string, value interface{}) (*model.ProposalAgg, error)
FindBy returns an proposal for a matching attribute
func (ProposalAgg) FindByID ¶
func (s ProposalAgg) FindByID(id int64) (*model.ProposalAgg, error)
FindByID returns an proposal for the ID
func (*ProposalAgg) FindByProposalId ¶
func (s *ProposalAgg) FindByProposalId(proposalId uint64) (*model.ProposalAgg, error)
FindByProposalId return proposal by proposal Id
func (ProposalAgg) Save ¶
func (s ProposalAgg) Save(val *model.ProposalAgg) error
Save creates the proposal aggregate
type Reports ¶
type Reports struct {
// contains filtered or unexported fields
}
Reports handles operations on reports
func NewReportsStore ¶
func (Reports) BulkUpsert ¶
BulkUpsert imports records in bulk
func (Reports) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*Reports) DeleteByKinds ¶
func (s *Reports) DeleteByKinds(kinds []model.ReportKind) error
DeleteByKinds deletes reports with kind reindexing sequential or parallel
func (Reports) FindNotCompletedByIndexVersion ¶
func (s Reports) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)
FindNotCompletedByIndexVersion returns the report by index version and kind
func (Reports) FindNotCompletedByKind ¶
Last returns the last report
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store handles all database operations
func (*Store) GetGovernance ¶
func (s *Store) GetGovernance() *governance
GetGovernance gets governance
func (*Store) GetValidatorGroups ¶
func (s *Store) GetValidatorGroups() *validatorGroups
GetValidatorGroups gets validator groups
func (*Store) GetValidators ¶
func (s *Store) GetValidators() *validators
GetValidators gets validators
func (*Store) SetDebugMode ¶
SetDebugMode enabled detailed query logging
type Syncables ¶
type Syncables struct {
// contains filtered or unexported fields
}
Syncables handles operations on syncables
func NewSyncablesStore ¶
func (Syncables) BulkUpsert ¶
BulkUpsert imports records in bulk
func (Syncables) Create ¶
func (s Syncables) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (Syncables) CreateOrUpdate ¶
CreateOrUpdate creates a new syncable or updates an existing one
func (Syncables) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (Syncables) FindByHeight ¶
Exists returns true if a syncable exists at give height
func (Syncables) FindFirstByDifferentIndexVersion ¶
FindFirstByDifferentIndexVersion returns first syncable with different index version
func (Syncables) FindLastInEpoch ¶
FindLastInEpoch finds last syncable in given epoch
func (Syncables) FindLastInEpochForHeight ¶
FindLastInEpochForHeight finds last_in_epoch syncable for given height
func (Syncables) FindMostRecent ¶
FindMostRecent returns the most recent syncable
func (Syncables) FindMostRecentByDifferentIndexVersion ¶
func (s Syncables) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)
FindMostRecentByDifferentIndexVersion returns the most recent syncable with different index version
func (Syncables) FindMostRecentProcessed ¶ added in v0.2.1
FindMostRecentProcessed returns the most recent processed syncable
func (Syncables) FindSmallestIndexVersion ¶
FindSmallestIndexVersion returns smallest index version
func (Syncables) SetProcessedAtForRange ¶
func (s Syncables) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error
CreateOrUpdate creates a new syncable or updates an existing one
type SystemEvents ¶
type SystemEvents struct {
// contains filtered or unexported fields
}
SystemEvents handles operations on syncables
func NewSystemEventsStore ¶
func NewSystemEventsStore(db *gorm.DB) *SystemEvents
func (SystemEvents) BulkUpsert ¶
func (s SystemEvents) BulkUpsert(records []model.SystemEvent) error
BulkUpsert insert system events in bulk
func (SystemEvents) Create ¶
func (s SystemEvents) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (SystemEvents) CreateOrUpdate ¶
func (s SystemEvents) CreateOrUpdate(val *model.SystemEvent) error
CreateOrUpdate creates a new system event or updates an existing one
func (SystemEvents) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*SystemEvents) DeleteOlderThan ¶
func (s *SystemEvents) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes system events older than given threshold
func (SystemEvents) FindAll ¶ added in v0.2.0
func (s SystemEvents) FindAll(query store.FindAll) ([]model.SystemEvent, error)
func (SystemEvents) FindByActor ¶
func (s SystemEvents) FindByActor(actorAddress string, query store.FindSystemEventByActorQuery) ([]model.SystemEvent, error)
FindByActor returns system events by actor
func (SystemEvents) FindByHeight ¶
func (s SystemEvents) FindByHeight(height int64) ([]model.SystemEvent, error)
FindByHeight returns system events by height
func (*SystemEvents) FindMostRecent ¶
func (s *SystemEvents) FindMostRecent() (*model.SystemEvent, error)
FindMostRecent finds most recent system event
func (SystemEvents) FindUnique ¶
func (s SystemEvents) FindUnique(height int64, address string, kind model.SystemEventKind) (*model.SystemEvent, error)
FindUnique returns unique system
func (SystemEvents) Save ¶
func (s SystemEvents) Save(record interface{}) error
Save saves record to database
type ValidatorAgg ¶
type ValidatorAgg struct {
// contains filtered or unexported fields
}
ValidatorAgg handles operations on validators
func NewValidatorAggStore ¶
func NewValidatorAggStore(db *gorm.DB) *ValidatorAgg
func (ValidatorAgg) All ¶
func (s ValidatorAgg) All() ([]model.ValidatorAgg, error)
All returns all validators
func (ValidatorAgg) BulkUpsert ¶
BulkUpsert imports records in bulk
func (ValidatorAgg) Create ¶
func (s ValidatorAgg) Create(val *model.ValidatorAgg) error
Create creates the validator aggregate
func (ValidatorAgg) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (ValidatorAgg) FindBy ¶
func (s ValidatorAgg) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)
FindBy returns an validator for a matching attribute
func (*ValidatorAgg) FindByAddress ¶
func (s *ValidatorAgg) FindByAddress(key string) (*model.ValidatorAgg, error)
FindByAddress return validator by address
func (ValidatorAgg) FindByID ¶
func (s ValidatorAgg) FindByID(id int64) (*model.ValidatorAgg, error)
FindByID returns an validator for the ID
func (*ValidatorAgg) GetAllForHeightGreaterThan ¶
func (s *ValidatorAgg) GetAllForHeightGreaterThan(height int64) ([]model.ValidatorAgg, error)
GetAllForHeightGreaterThan returns validators who have been validating since given height
func (ValidatorAgg) Save ¶
func (s ValidatorAgg) Save(val *model.ValidatorAgg) error
Save creates the validator aggregate
func (ValidatorAgg) Truncate ¶
func (s ValidatorAgg) Truncate() error
Truncate removes all records from the table
func (ValidatorAgg) Update ¶
func (s ValidatorAgg) Update(record interface{}) error
Update updates the existing record. Must pass a pointer.
func (ValidatorAgg) UpdateIdentity ¶ added in v0.2.0
func (s ValidatorAgg) UpdateIdentity(val *model.ValidatorAgg) error
UpdateIdentity updates the identity of a validator
type ValidatorGroupAgg ¶
type ValidatorGroupAgg struct {
// contains filtered or unexported fields
}
ValidatorGroupAgg handles operations on validators
func NewValidatorGroupAggStore ¶
func NewValidatorGroupAggStore(db *gorm.DB) *ValidatorGroupAgg
func (ValidatorGroupAgg) All ¶
func (s ValidatorGroupAgg) All() ([]model.ValidatorGroupAgg, error)
All returns all validator groups
func (ValidatorGroupAgg) BulkUpsert ¶
BulkUpsert imports records in bulk
func (ValidatorGroupAgg) Create ¶
func (s ValidatorGroupAgg) Create(val *model.ValidatorGroupAgg) error
Create creates the validator group aggregate
func (ValidatorGroupAgg) CreateOrUpdate ¶
func (s ValidatorGroupAgg) CreateOrUpdate(val *model.ValidatorGroupAgg) error
CreateOrUpdate creates a new validator group or updates an existing one
func (ValidatorGroupAgg) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (ValidatorGroupAgg) FindBy ¶
func (s ValidatorGroupAgg) FindBy(key string, value interface{}) (*model.ValidatorGroupAgg, error)
FindBy returns an validator group for a matching attribute
func (*ValidatorGroupAgg) FindByAddress ¶
func (s *ValidatorGroupAgg) FindByAddress(key string) (*model.ValidatorGroupAgg, error)
FindByAddress return validator group by address
func (ValidatorGroupAgg) FindByID ¶
func (s ValidatorGroupAgg) FindByID(id int64) (*model.ValidatorGroupAgg, error)
FindByID returns an validator group for the ID
func (ValidatorGroupAgg) Save ¶
func (s ValidatorGroupAgg) Save(val *model.ValidatorGroupAgg) error
Save creates the validator group aggregate
func (ValidatorGroupAgg) Truncate ¶
func (s ValidatorGroupAgg) Truncate() error
Truncate removes all records from the table
func (ValidatorGroupAgg) Update ¶
func (s ValidatorGroupAgg) Update(record interface{}) error
Update updates the existing record. Must pass a pointer.
func (ValidatorGroupAgg) UpdateIdentity ¶ added in v0.2.0
func (s ValidatorGroupAgg) UpdateIdentity(val *model.ValidatorGroupAgg) error
UpdateIdentity updates the identity of a validator group
type ValidatorGroupSeq ¶
type ValidatorGroupSeq struct {
// contains filtered or unexported fields
}
ValidatorGroupSeq handles operations on validator groups
func NewValidatorGroupSeqStore ¶
func NewValidatorGroupSeqStore(db *gorm.DB) *ValidatorGroupSeq
func (ValidatorGroupSeq) BulkUpsert ¶
func (s ValidatorGroupSeq) BulkUpsert(records []model.ValidatorGroupSeq) error
BulkUpsert insert validator group sequences in bulk
func (ValidatorGroupSeq) Create ¶
func (s ValidatorGroupSeq) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorGroupSeq) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ValidatorGroupSeq) DeleteOlderThan ¶
func (s *ValidatorGroupSeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes validator group sequence older than given threshold
func (ValidatorGroupSeq) FindByHeight ¶
func (s ValidatorGroupSeq) FindByHeight(h int64) ([]model.ValidatorGroupSeq, error)
FindByHeight finds validator group sequences by height
func (ValidatorGroupSeq) FindByHeightAndAddress ¶
func (s ValidatorGroupSeq) FindByHeightAndAddress(height int64, address string) (*model.ValidatorGroupSeq, error)
FindByHeightAndAddress finds validator group by height and address
func (ValidatorGroupSeq) FindLastByAddress ¶
func (s ValidatorGroupSeq) FindLastByAddress(address string, limit int64) ([]model.ValidatorGroupSeq, error)
FindLastByAddress finds last validator group sequences for given address
func (*ValidatorGroupSeq) FindMostRecent ¶
func (s *ValidatorGroupSeq) FindMostRecent() (*model.ValidatorGroupSeq, error)
FindMostRecent finds most recent validator group sequence
func (ValidatorGroupSeq) Save ¶
func (s ValidatorGroupSeq) Save(record interface{}) error
Save saves record to database
func (*ValidatorGroupSeq) Summarize ¶
func (s *ValidatorGroupSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.ValidatorGroupSeqSummary, error)
Summarize gets the summarized version of validator sequences
type ValidatorGroupSummary ¶
type ValidatorGroupSummary struct {
// contains filtered or unexported fields
}
ValidatorGroupSummary handles operations on validator group summaries
func NewValidatorGroupSummaryStore ¶
func NewValidatorGroupSummaryStore(db *gorm.DB) *ValidatorGroupSummary
func (ValidatorGroupSummary) BulkUpsert ¶
func (s ValidatorGroupSummary) BulkUpsert(records []model.ValidatorGroupSummary) error
BulkUpsert insert validator sequences in bulk
func (ValidatorGroupSummary) Create ¶
func (s ValidatorGroupSummary) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorGroupSummary) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ValidatorGroupSummary) DeleteOlderThan ¶
func (s *ValidatorGroupSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deleted validator group summary records older than given threshold
func (ValidatorGroupSummary) Find ¶
func (s ValidatorGroupSummary) Find(query *model.ValidatorGroupSummary) (*model.ValidatorGroupSummary, error)
Find find validator group summary by query
func (*ValidatorGroupSummary) FindActivityPeriods ¶
func (s *ValidatorGroupSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*ValidatorGroupSummary) FindMostRecent ¶
func (s *ValidatorGroupSummary) FindMostRecent() (*model.ValidatorGroupSummary, error)
FindMostRecent finds most recent validator group summary
func (*ValidatorGroupSummary) FindMostRecentByInterval ¶
func (s *ValidatorGroupSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorGroupSummary, error)
FindMostRecentByInterval finds most recent validator group summary for interval
func (*ValidatorGroupSummary) FindSummary ¶
func (s *ValidatorGroupSummary) FindSummary(interval types.SummaryInterval, period string) ([]store.ValidatorGroupSummaryRow, error)
FindSummary gets summary for validator group summary
func (*ValidatorGroupSummary) FindSummaryByAddress ¶
func (s *ValidatorGroupSummary) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorGroupSummary, error)
FindSummaryByAddress gets summary for given validator group
func (ValidatorGroupSummary) Save ¶
func (s ValidatorGroupSummary) Save(record interface{}) error
Save saves record to database
type ValidatorSeq ¶
type ValidatorSeq struct {
// contains filtered or unexported fields
}
ValidatorSeq handles operations on validators
func NewValidatorSeqStore ¶
func NewValidatorSeqStore(db *gorm.DB) *ValidatorSeq
func (ValidatorSeq) BulkUpsert ¶
func (s ValidatorSeq) BulkUpsert(records []model.ValidatorSeq) error
BulkUpsert insert validator sequences in bulk
func (ValidatorSeq) Create ¶
func (s ValidatorSeq) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSeq) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ValidatorSeq) DeleteOlderThan ¶
func (s *ValidatorSeq) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deletes validator sequence older than given threshold
func (ValidatorSeq) FindByHeight ¶
func (s ValidatorSeq) FindByHeight(height int64) ([]model.ValidatorSeq, error)
FindByHeight finds validator sequences by height
func (ValidatorSeq) FindByHeightAndAddress ¶
func (s ValidatorSeq) FindByHeightAndAddress(height int64, address string) (*model.ValidatorSeq, error)
FindByHeightAndAddress finds validator by height and address
func (ValidatorSeq) FindLastByAddress ¶
func (s ValidatorSeq) FindLastByAddress(address string, limit int64) ([]model.ValidatorSeq, error)
FindLastByAddress finds last validator sequences for given address
func (*ValidatorSeq) FindMostRecent ¶
func (s *ValidatorSeq) FindMostRecent() (*model.ValidatorSeq, error)
FindMostRecent finds most recent validator era sequence
func (ValidatorSeq) Save ¶
func (s ValidatorSeq) Save(record interface{}) error
Save saves record to database
func (*ValidatorSeq) Summarize ¶
func (s *ValidatorSeq) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]store.ValidatorSeqSummary, error)
Summarize gets the summarized version of validator sequences
type ValidatorSummary ¶
type ValidatorSummary struct {
// contains filtered or unexported fields
}
ValidatorSummary handles operations on validators
func NewValidatorSummaryStore ¶
func NewValidatorSummaryStore(db *gorm.DB) *ValidatorSummary
func (ValidatorSummary) BulkUpsert ¶
func (s ValidatorSummary) BulkUpsert(records []model.ValidatorSummary) error
BulkUpsert insert validator sequences in bulk
func (ValidatorSummary) Create ¶
func (s ValidatorSummary) Create(record interface{}) error
Create creates a new record. Must pass a pointer.
func (ValidatorSummary) DeleteByHeight ¶
DeleteByHeight removes all records associated with a height
func (*ValidatorSummary) DeleteOlderThan ¶
func (s *ValidatorSummary) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)
DeleteOlderThan deleted validator summary records older than given threshold
func (ValidatorSummary) Find ¶
func (s ValidatorSummary) Find(query *model.ValidatorSummary) (*model.ValidatorSummary, error)
Find find validator summary by query
func (*ValidatorSummary) FindActivityPeriods ¶
func (s *ValidatorSummary) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)
FindActivityPeriods Finds activity periods
func (*ValidatorSummary) FindMostRecent ¶
func (s *ValidatorSummary) FindMostRecent() (*model.ValidatorSummary, error)
FindMostRecent finds most recent validator summary
func (*ValidatorSummary) FindMostRecentByInterval ¶
func (s *ValidatorSummary) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)
FindMostRecentByInterval finds most recent validator summary for interval
func (*ValidatorSummary) FindSummary ¶
func (s *ValidatorSummary) FindSummary(interval types.SummaryInterval, period string) ([]store.ValidatorSummaryRow, error)
FindSummary gets summary for validator summary
func (*ValidatorSummary) FindSummaryByAddress ¶
func (s *ValidatorSummary) FindSummaryByAddress(address string, interval types.SummaryInterval, period string) ([]model.ValidatorSummary, error)
FindSummaryByAddress gets summary for given validator
func (ValidatorSummary) Save ¶
func (s ValidatorSummary) Save(record interface{}) error
Save saves record to database
Source Files ¶
- account_activity_seq_queries.go
- account_activity_seq_store.go
- base_store.go
- block_seq_queries.go
- block_seq_store.go
- block_summary_queries.go
- block_summary_store.go
- database_store.go
- governance_activity_seq_queries.go
- governance_activity_seq_store.go
- jobs_queries.go
- jobs_store.go
- proposal_agg_store.go
- reports_store.go
- store.go
- syncables_store.go
- system_events_queries.go
- system_events_store.go
- validator_agg_store.go
- validator_group_agg_store.go
- validator_group_seq_queries.go
- validator_group_seq_store.go
- validator_group_summary_queries.go
- validator_group_summary_store.go
- validator_seq_queries.go
- validator_seq_store.go
- validator_summary_queries.go
- validator_summary_store.go