psql

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountEraSeqStore

type AccountEraSeqStore struct {
	// contains filtered or unexported fields
}

AccountEraSeqStore handles operations on accounts

func NewAccountEraSeqStore

func NewAccountEraSeqStore(db *gorm.DB) *AccountEraSeqStore

func (AccountEraSeqStore) BulkUpsert added in v0.5.0

func (s AccountEraSeqStore) BulkUpsert(records []model.AccountEraSeq) error

BulkUpsert imports new records and updates existing ones

func (AccountEraSeqStore) Create

func (s AccountEraSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (AccountEraSeqStore) DeleteByHeight

func (s AccountEraSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (AccountEraSeqStore) FindByEra

func (s AccountEraSeqStore) FindByEra(era int64) ([]model.AccountEraSeq, error)

FindByHeight finds account era sequences by era

func (AccountEraSeqStore) FindLastByStashAccount

func (s AccountEraSeqStore) FindLastByStashAccount(stashAccount string) ([]model.AccountEraSeq, error)

FindLastByStashAccount finds last account era sequences for given stash account

func (AccountEraSeqStore) FindLastByValidatorStashAccount

func (s AccountEraSeqStore) FindLastByValidatorStashAccount(validatorStashAccount string) ([]model.AccountEraSeq, error)

FindLastByValidatorStashAccount finds last account era sequences for given validator stash account

func (AccountEraSeqStore) GetAllByTime added in v0.9.0

func (s AccountEraSeqStore) GetAllByTime(stash string, start, end types.Time) ([]model.AccountEraSeq, error)

GetAllByTime Gets all seqs for given stash

func (AccountEraSeqStore) Import added in v0.5.0

func (s AccountEraSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (AccountEraSeqStore) Save

func (s AccountEraSeqStore) Save(record interface{}) error

Save saves record to database

func (AccountEraSeqStore) Truncate

func (s AccountEraSeqStore) Truncate() error

Truncate removes all records from the table

func (AccountEraSeqStore) Update

func (s AccountEraSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

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) CreateSeq

func (s BlockSeqStore) CreateSeq(block *model.BlockSeq) error

Create creates the block

func (BlockSeqStore) DeleteByHeight

func (s BlockSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*BlockSeqStore) DeleteSeqOlderThan

func (s *BlockSeqStore) DeleteSeqOlderThan(purgeThreshold time.Time, activityPeriods []store.ActivityPeriodRow) (*int64, error)

DeleteSeqOlderThan 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) FindByID

func (s BlockSeqStore) FindByID(id int64) (*model.BlockSeq, error)

FindByID returns a block with matching ID

func (*BlockSeqStore) FindMostRecentSeq

func (s *BlockSeqStore) FindMostRecentSeq() (*model.BlockSeq, error)

FindMostRecentSeq finds most recent block sequence

func (BlockSeqStore) FindSeqByHeight

func (s BlockSeqStore) FindSeqByHeight(height int64) (*model.BlockSeq, error)

FindSeqByHeight returns a block with the matching height

func (*BlockSeqStore) GetAvgRecentTimes

func (s *BlockSeqStore) GetAvgRecentTimes(limit int64) store.GetAvgRecentTimesResult

GetAvgRecentTimes Gets average block times for recent blocks by limit

func (BlockSeqStore) Import added in v0.5.0

func (s BlockSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (BlockSeqStore) Save

func (s BlockSeqStore) Save(record interface{}) error

Save saves record to database

func (BlockSeqStore) SaveSeq

func (s BlockSeqStore) SaveSeq(block *model.BlockSeq) error

Save saves the block

func (*BlockSeqStore) Summarize

func (s *BlockSeqStore) Summarize(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]model.BlockSeqSummary, error)

Summarize gets the summarized version of block sequences

func (BlockSeqStore) Truncate

func (s BlockSeqStore) Truncate() error

Truncate removes all records from the table

func (BlockSeqStore) Update

func (s BlockSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type BlockSummaryStore

type BlockSummaryStore struct {
	// contains filtered or unexported fields
}

BlockSummaryStore handles operations on block summary

func NewBlockSummaryStore

func NewBlockSummaryStore(db *gorm.DB) *BlockSummaryStore

func (BlockSummaryStore) Create

func (s BlockSummaryStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (BlockSummaryStore) CreateSummary

func (s BlockSummaryStore) CreateSummary(val *model.BlockSummary) error

CreateSummary creates the summary

func (BlockSummaryStore) DeleteByHeight

func (s BlockSummaryStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*BlockSummaryStore) DeleteOlderThan

func (s *BlockSummaryStore) DeleteOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)

DeleteOlderThan deletes block summary records older than given threshold

func (*BlockSummaryStore) FindActivityPeriods

func (s *BlockSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)

FindActivityPeriods Finds activity periods

func (*BlockSummaryStore) FindMostRecentByInterval

func (s *BlockSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.BlockSummary, error)

FindMostRecentByInterval finds most recent block summary for given time interval

func (*BlockSummaryStore) FindMostRecentSummary

func (s *BlockSummaryStore) FindMostRecentSummary() (*model.BlockSummary, error)

FindMostRecentSummary finds most recent block summary

func (*BlockSummaryStore) FindSummaries

func (s *BlockSummaryStore) FindSummaries(interval types.SummaryInterval, period string) ([]model.BlockSummary, error)

FindSummaries Gets summary of block sequences

func (BlockSummaryStore) FindSummary

func (s BlockSummaryStore) FindSummary(query *model.BlockSummary) (*model.BlockSummary, error)

FindSummary find block summary by query

func (BlockSummaryStore) Import added in v0.5.0

func (s BlockSummaryStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (BlockSummaryStore) Save

func (s BlockSummaryStore) Save(record interface{}) error

Save saves record to database

func (BlockSummaryStore) SaveSummary

func (s BlockSummaryStore) SaveSummary(val *model.BlockSummary) error

SaveSummary saves the summary

func (BlockSummaryStore) Truncate

func (s BlockSummaryStore) Truncate() error

Truncate removes all records from the table

func (BlockSummaryStore) Update

func (s BlockSummaryStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type DatabaseStore

type DatabaseStore struct {
	// contains filtered or unexported fields
}

DatabaseStore handles operations on blocks

func NewDatabaseStore

func NewDatabaseStore(db *gorm.DB) *DatabaseStore

func (*DatabaseStore) GetTotalSize

func (s *DatabaseStore) GetTotalSize() (*store.GetTotalSizeResult, error)

FindSummary Gets average block times for interval

type EventSeqStore

type EventSeqStore struct {
	// contains filtered or unexported fields
}

EventSeqStore handles operations on events

func NewEventSeqStore

func NewEventSeqStore(db *gorm.DB) *EventSeqStore

func (EventSeqStore) BulkUpsert added in v0.5.0

func (s EventSeqStore) BulkUpsert(records []model.EventSeq) error

BulkUpsert imports new records and updates existing ones

func (EventSeqStore) Create

func (s EventSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (EventSeqStore) DeleteByHeight

func (s EventSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*EventSeqStore) DeleteOlderThan

func (s *EventSeqStore) DeleteOlderThan(purgeThreshold time.Time) (*int64, error)

DeleteOlderThan deletes event sequence older than given threshold

func (EventSeqStore) FindBalanceDeposits

func (s EventSeqStore) FindBalanceDeposits(address string) ([]model.EventSeqWithTxHash, error)

FindBalanceDeposits finds balance deposits event sequences for given address

func (EventSeqStore) FindBalanceTransfers

func (s EventSeqStore) FindBalanceTransfers(address string) ([]model.EventSeqWithTxHash, error)

FindBalanceTransfers finds balance transfers event sequences for given address

func (EventSeqStore) FindBonded

func (s EventSeqStore) FindBonded(address string) ([]model.EventSeqWithTxHash, error)

FindBonded finds bonded event sequences for given address

func (EventSeqStore) FindByHeight

func (s EventSeqStore) FindByHeight(height int64) ([]model.EventSeq, error)

FindByHeight finds event sequences by height

func (EventSeqStore) FindByHeightAndIndex

func (s EventSeqStore) FindByHeightAndIndex(height int64, index int64) (*model.EventSeq, error)

FindByHeightAndStashAccount finds event by height and index

func (*EventSeqStore) FindMostRecent

func (s *EventSeqStore) FindMostRecent() (*model.EventSeq, error)

FindMostRecent finds most recent event session sequence

func (*EventSeqStore) FindRewardsForTimePeriod added in v0.7.0

func (s *EventSeqStore) FindRewardsForTimePeriod(address string, start, end time.Time) ([]model.EventSeq, error)

FindRewardsForTimePeriod find rewards events for an account for given time period

func (EventSeqStore) FindUnbonded

func (s EventSeqStore) FindUnbonded(address string) ([]model.EventSeqWithTxHash, error)

FindUnbonded finds unbonded event sequences for given address

func (EventSeqStore) FindWithdrawn

func (s EventSeqStore) FindWithdrawn(address string) ([]model.EventSeqWithTxHash, error)

FindWithdrawn finds withdrawn event sequences for given address

func (EventSeqStore) Import added in v0.5.0

func (s EventSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (EventSeqStore) Save

func (s EventSeqStore) Save(record interface{}) error

Save saves record to database

func (EventSeqStore) Truncate

func (s EventSeqStore) Truncate() error

Truncate removes all records from the table

func (EventSeqStore) Update

func (s EventSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

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 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

func (s ReportsStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ReportsStore) DeleteByKinds

func (s *ReportsStore) DeleteByKinds(kinds []model.ReportKind) error

DeleteByKinds deletes reports with kind reindexing sequential or parallel

func (ReportsStore) FindNotCompletedByIndexVersion

func (s ReportsStore) FindNotCompletedByIndexVersion(indexVersion int64, kinds ...model.ReportKind) (*model.Report, error)

FindNotCompletedByIndexVersion returns the report by index version and kind

func (ReportsStore) FindNotCompletedByKind

func (s ReportsStore) FindNotCompletedByKind(kinds ...model.ReportKind) (*model.Report, error)

Last returns the last report

func (ReportsStore) Import added in v0.5.0

func (s ReportsStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

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

func (ReportsStore) Truncate

func (s ReportsStore) Truncate() error

Truncate removes all records from the table

func (ReportsStore) Update

func (s ReportsStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type RewardEraSeqStore added in v0.6.0

type RewardEraSeqStore struct {
	// contains filtered or unexported fields
}

RewardEraSeqStore handles operations on rewardEraSeq

func NewRewardEraSeqStore added in v0.6.0

func NewRewardEraSeqStore(db *gorm.DB) *RewardEraSeqStore

func (RewardEraSeqStore) BulkUpsert added in v0.6.0

func (s RewardEraSeqStore) BulkUpsert(records []model.RewardEraSeq) error

BulkUpsert imports new records, and updates claimed and tx_hash fields for existing ones iff they are currently not claimed

func (RewardEraSeqStore) Create added in v0.6.0

func (s RewardEraSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (RewardEraSeqStore) DeleteByHeight added in v0.6.0

func (s RewardEraSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (RewardEraSeqStore) GetAll added in v0.6.0

func (s RewardEraSeqStore) GetAll(stash, validatorStash string, start, end int64) ([]model.RewardEraSeq, error)

GetAll Gets all rewards for given stash

func (RewardEraSeqStore) GetAllByTime added in v0.9.0

func (s RewardEraSeqStore) GetAllByTime(stash string, start, end types.Time) ([]model.RewardEraSeq, error)

GetAllByTime Gets all rewards for given stash

func (*RewardEraSeqStore) GetByStashAndEra added in v0.8.3

func (s *RewardEraSeqStore) GetByStashAndEra(validatorStash, stash string, era int64) ([]model.RewardEraSeq, error)

GetByStashAndEra returns for given stash for validatorStash and era

func (RewardEraSeqStore) Import added in v0.6.0

func (s RewardEraSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (RewardEraSeqStore) Save added in v0.6.0

func (s RewardEraSeqStore) Save(record interface{}) error

Save saves record to database

func (RewardEraSeqStore) Truncate added in v0.6.0

func (s RewardEraSeqStore) Truncate() error

Truncate removes all records from the table

func (RewardEraSeqStore) Update added in v0.6.0

func (s RewardEraSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(connStr string) (*Store, error)

New returns a new postgres store from the connection string

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection

func (*Store) GetAccounts

func (s *Store) GetAccounts() *accounts

GetAccounts gets accounts

func (*Store) GetBlocks

func (s *Store) GetBlocks() *blocks

GetBlocks gets blocks

func (*Store) GetDatabase

func (s *Store) GetDatabase() *database

GetDatabase gets database

func (*Store) GetEvents

func (s *Store) GetEvents() *events

GetEvents gets events

func (*Store) GetReports

func (s *Store) GetReports() *reports

GetReports gets reports

func (*Store) GetRewards added in v0.6.0

func (s *Store) GetRewards() *rewards

GetRewards gets rewards

func (*Store) GetSyncables

func (s *Store) GetSyncables() *syncables

GetSyncables gets syncables

func (*Store) GetSystemEvents added in v0.5.0

func (s *Store) GetSystemEvents() *systemEvents

GetSystemEvents gets syncables

func (*Store) GetTransactions

func (s *Store) GetTransactions() *transactions

GetTransactions gets transactions

func (*Store) GetValidators

func (s *Store) GetValidators() *validators

GetValidators gets validators

func (*Store) SetDebugMode

func (s *Store) SetDebugMode(enabled bool)

SetDebugMode enabled detailed query logging

func (*Store) Test

func (s *Store) Test() error

Test checks the connection status

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

func (s SyncablesStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (SyncablesStore) FindAllByLastInSessionOrEra added in v0.5.0

func (s SyncablesStore) FindAllByLastInSessionOrEra(indexVersion int64, isLastInSession, isLastInEra bool, start, end int64) ([]model.Syncable, error)

FindAllByLastInSessionOrEra returns end syncs of sessions and eras

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

func (s SyncablesStore) FindFirstByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)

FindFirstByDifferentIndexVersion returns first syncable with different index version

func (SyncablesStore) FindLastEndOfEra

func (s SyncablesStore) FindLastEndOfEra() (syncable *model.Syncable, err error)

FindLastEndOfEra finds last end of era syncable

func (SyncablesStore) FindLastEndOfSession

func (s SyncablesStore) FindLastEndOfSession() (syncable *model.Syncable, err error)

FindLastEndOfSession finds last end of session syncable

func (SyncablesStore) FindLastInEra

func (s SyncablesStore) FindLastInEra(era int64) (syncable *model.Syncable, err error)

FindLastInEra finds last syncable in given era

func (SyncablesStore) FindLastInSession

func (s SyncablesStore) FindLastInSession(session int64) (syncable *model.Syncable, err error)

FindLastInSession finds last syncable in given session

func (SyncablesStore) FindLastInSessionForHeight

func (s SyncablesStore) FindLastInSessionForHeight(height int64) (syncable *model.Syncable, err error)

FindLastInSessionForHeight finds last_in_session syncable for given height

func (SyncablesStore) FindMostRecent

func (s SyncablesStore) FindMostRecent() (*model.Syncable, error)

FindMostRecent returns the most recent syncable

func (SyncablesStore) FindMostRecentByDifferentIndexVersion

func (s SyncablesStore) FindMostRecentByDifferentIndexVersion(indexVersion int64) (*model.Syncable, error)

FindMostRecentByDifferentIndexVersion returns the most recent syncable with different index version

func (SyncablesStore) FindSmallestIndexVersion

func (s SyncablesStore) FindSmallestIndexVersion() (*int64, error)

FindSmallestIndexVersion returns smallest index version

func (SyncablesStore) Import added in v0.5.0

func (s SyncablesStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (SyncablesStore) Save

func (s SyncablesStore) Save(record interface{}) error

Save saves record to database

func (SyncablesStore) SaveSyncable

func (s SyncablesStore) SaveSyncable(val *model.Syncable) error

func (SyncablesStore) SetProcessedAtForRange

func (s SyncablesStore) SetProcessedAtForRange(reportID types.ID, startHeight int64, endHeight int64) error

SetProcessedAtForRange creates a new syncable or updates an existing one

func (SyncablesStore) Truncate

func (s SyncablesStore) Truncate() error

Truncate removes all records from the table

func (SyncablesStore) Update

func (s SyncablesStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type SystemEventStore added in v0.5.0

type SystemEventStore struct {
	// contains filtered or unexported fields
}

SystemEventStore handles operations on syncables

func NewSystemEventsStore added in v0.5.0

func NewSystemEventsStore(db *gorm.DB) *SystemEventStore

func (SystemEventStore) BulkUpsert added in v0.5.0

func (s SystemEventStore) BulkUpsert(records []model.SystemEvent) error

BulkUpsert imports new records and updates existing ones

func (SystemEventStore) Create added in v0.5.0

func (s SystemEventStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (SystemEventStore) DeleteByHeight added in v0.5.0

func (s SystemEventStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (SystemEventStore) FindByActor added in v0.5.0

func (s SystemEventStore) FindByActor(actorAddress string, kind *model.SystemEventKind, minHeight *int64) ([]model.SystemEvent, error)

FindByActor returns system events by actor

func (SystemEventStore) Import added in v0.5.0

func (s SystemEventStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (SystemEventStore) Save added in v0.5.0

func (s SystemEventStore) Save(record interface{}) error

Save saves record to database

func (SystemEventStore) Truncate added in v0.5.0

func (s SystemEventStore) Truncate() error

Truncate removes all records from the table

func (SystemEventStore) Update added in v0.5.0

func (s SystemEventStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type TransactionSeqStore

type TransactionSeqStore struct {
	// contains filtered or unexported fields
}

TransactionSeqStore handles operations on balance events

func NewTransactionSeqStore

func NewTransactionSeqStore(db *gorm.DB) *TransactionSeqStore

func (TransactionSeqStore) BulkUpsert added in v0.5.0

func (s TransactionSeqStore) BulkUpsert(records []model.TransactionSeq) error

BulkUpsert imports new records and updates existing ones

func (TransactionSeqStore) Create

func (s TransactionSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (TransactionSeqStore) DeleteByHeight

func (s TransactionSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (TransactionSeqStore) GetTransactionsByTransactionKind added in v0.8.0

func (s TransactionSeqStore) GetTransactionsByTransactionKind(kind model.TransactionKind, start, end int64) ([]model.TransactionSeq, error)

GetTransactionsByTransactionKind gets transactions by kind

func (TransactionSeqStore) Import added in v0.5.0

func (s TransactionSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (TransactionSeqStore) Save

func (s TransactionSeqStore) Save(record interface{}) error

Save saves record to database

func (TransactionSeqStore) Truncate

func (s TransactionSeqStore) Truncate() error

Truncate removes all records from the table

func (TransactionSeqStore) Update

func (s TransactionSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type ValidatorAggStore

type ValidatorAggStore struct {
	// contains filtered or unexported fields
}

ValidatorAgg handles operations on validators

func NewValidatorAggStore

func NewValidatorAggStore(db *gorm.DB) *ValidatorAggStore

func (ValidatorAggStore) All

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) CreateAgg

func (s ValidatorAggStore) CreateAgg(val *model.ValidatorAgg) error

CreateAgg creates the validator aggregate

func (ValidatorAggStore) DeleteByHeight

func (s ValidatorAggStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ValidatorAggStore) FindAggByStashAccount

func (s *ValidatorAggStore) FindAggByStashAccount(key string) (*model.ValidatorAgg, error)

FindAggByStashAccount return validator by stash account

func (ValidatorAggStore) FindBy

func (s ValidatorAggStore) FindBy(key string, value interface{}) (*model.ValidatorAgg, error)

FindBy returns an validator for a matching attribute

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) Import added in v0.5.0

func (s ValidatorAggStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (ValidatorAggStore) Save

func (s ValidatorAggStore) Save(record interface{}) error

Save saves record to database

func (ValidatorAggStore) SaveAgg

func (s ValidatorAggStore) SaveAgg(val *model.ValidatorAgg) error

SaveAgg creates the validator aggregate

func (ValidatorAggStore) Truncate

func (s ValidatorAggStore) Truncate() error

Truncate removes all records from the table

func (ValidatorAggStore) Update

func (s ValidatorAggStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type ValidatorEraSeqStore

type ValidatorEraSeqStore struct {
	// contains filtered or unexported fields
}

ValidatorEraSeqStore handles operations on validators

func NewValidatorEraSeqStore

func NewValidatorEraSeqStore(db *gorm.DB) *ValidatorEraSeqStore

func (ValidatorEraSeqStore) BulkUpsertEraSeqs added in v0.5.0

func (s ValidatorEraSeqStore) BulkUpsertEraSeqs(records []model.ValidatorEraSeq) error

BulkUpsertEraSeqs imports new records and updates existing ones

func (ValidatorEraSeqStore) Create

func (s ValidatorEraSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (ValidatorEraSeqStore) DeleteByHeight

func (s ValidatorEraSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ValidatorEraSeqStore) DeleteEraSeqsOlderThan

func (s *ValidatorEraSeqStore) DeleteEraSeqsOlderThan(purgeThreshold time.Time) (*int64, error)

DeleteEraSeqsOlderThan deletes validator sequence older than given threshold

func (ValidatorEraSeqStore) FindByEra

func (s ValidatorEraSeqStore) FindByEra(era int64) ([]model.ValidatorEraSeq, error)

FindByEra finds validator era sequences by era

func (ValidatorEraSeqStore) FindByEraAndStashAccount

func (s ValidatorEraSeqStore) FindByEraAndStashAccount(era int64, stash string) (*model.ValidatorEraSeq, error)

FindByEraAndStashAccount finds validator by era and stash account

func (ValidatorEraSeqStore) FindByHeightAndStashAccount

func (s ValidatorEraSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorEraSeq, error)

FindByHeightAndStashAccount finds validator by height and stash account

func (ValidatorEraSeqStore) FindEraSeqsByHeight

func (s ValidatorEraSeqStore) FindEraSeqsByHeight(h int64) ([]model.ValidatorEraSeq, error)

FindEraSeqsByHeight finds validator era sequences by height

func (ValidatorEraSeqStore) FindLastEraSeqByStashAccount

func (s ValidatorEraSeqStore) FindLastEraSeqByStashAccount(stashAccount string, limit int64) ([]model.ValidatorEraSeq, error)

FindLastEraSeqByStashAccount finds last validator era sequences for given stash account

func (*ValidatorEraSeqStore) FindMostRecentEraSeq

func (s *ValidatorEraSeqStore) FindMostRecentEraSeq() (*model.ValidatorEraSeq, error)

FindMostRecentEraSeq finds most recent validator era sequence

func (ValidatorEraSeqStore) Import added in v0.5.0

func (s ValidatorEraSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (ValidatorEraSeqStore) Save

func (s ValidatorEraSeqStore) Save(record interface{}) error

Save saves record to database

func (*ValidatorEraSeqStore) SummarizeEraSeqs

func (s *ValidatorEraSeqStore) SummarizeEraSeqs(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]model.ValidatorEraSeqSummary, error)

SummarizeEraSeqs gets the summarized version of validator sequences

func (ValidatorEraSeqStore) Truncate

func (s ValidatorEraSeqStore) Truncate() error

Truncate removes all records from the table

func (ValidatorEraSeqStore) Update

func (s ValidatorEraSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type ValidatorSeqStore added in v0.5.0

type ValidatorSeqStore struct {
	// contains filtered or unexported fields
}

ValidatorSeqStore handles operations on validators

func NewValidatorSeqStore added in v0.5.0

func NewValidatorSeqStore(db *gorm.DB) *ValidatorSeqStore

func (ValidatorSeqStore) BulkUpsertSeqs added in v0.5.0

func (s ValidatorSeqStore) BulkUpsertSeqs(records []model.ValidatorSeq) error

BulkUpsertSeqs imports new records and updates existing ones

func (ValidatorSeqStore) Create added in v0.5.0

func (s ValidatorSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (ValidatorSeqStore) DeleteByHeight added in v0.5.0

func (s ValidatorSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ValidatorSeqStore) DeleteSeqsOlderThan added in v0.5.0

func (s *ValidatorSeqStore) DeleteSeqsOlderThan(purgeThreshold time.Time) (*int64, error)

DeleteSeqsOlderThan deletes validator sequences older than given threshold

func (ValidatorSeqStore) FindAllByHeight added in v0.5.0

func (s ValidatorSeqStore) FindAllByHeight(height int64) ([]model.ValidatorSeq, error)

FindAllByHeight returns all validators for provided height

func (*ValidatorSeqStore) FindMostRecentSeq added in v0.5.0

func (s *ValidatorSeqStore) FindMostRecentSeq() (*model.ValidatorSeq, error)

FindMostRecentSeq finds most recent validator sequences

func (ValidatorSeqStore) Import added in v0.5.0

func (s ValidatorSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (ValidatorSeqStore) Save added in v0.5.0

func (s ValidatorSeqStore) Save(record interface{}) error

Save saves record to database

func (ValidatorSeqStore) Truncate added in v0.5.0

func (s ValidatorSeqStore) Truncate() error

Truncate removes all records from the table

func (ValidatorSeqStore) Update added in v0.5.0

func (s ValidatorSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type ValidatorSessionSeqStore

type ValidatorSessionSeqStore struct {
	// contains filtered or unexported fields
}

ValidatorSessionSeqStore handles operations on validators

func NewValidatorSessionSeqStore

func NewValidatorSessionSeqStore(db *gorm.DB) *ValidatorSessionSeqStore

func (ValidatorSessionSeqStore) BulkUpsertSessionSeqs added in v0.5.0

func (s ValidatorSessionSeqStore) BulkUpsertSessionSeqs(records []model.ValidatorSessionSeq) error

BulkUpsertSessionSeqs imports new records and updates existing ones

func (ValidatorSessionSeqStore) Create

func (s ValidatorSessionSeqStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (ValidatorSessionSeqStore) DeleteByHeight

func (s ValidatorSessionSeqStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ValidatorSessionSeqStore) DeleteSessionSeqsOlderThan

func (s *ValidatorSessionSeqStore) DeleteSessionSeqsOlderThan(purgeThreshold time.Time) (*int64, error)

DeleteSessionSeqsOlderThan deletes validator sequence older than given threshold

func (ValidatorSessionSeqStore) FindByHeightAndStashAccount

func (s ValidatorSessionSeqStore) FindByHeightAndStashAccount(height int64, stash string) (*model.ValidatorSessionSeq, error)

FindByHeightAndStashAccount finds validator by height and stash account

func (ValidatorSessionSeqStore) FindBySession

func (s ValidatorSessionSeqStore) FindBySession(session int64) ([]model.ValidatorSessionSeq, error)

FindBySession finds validator session sequences by session

func (ValidatorSessionSeqStore) FindBySessionAndStashAccount

func (s ValidatorSessionSeqStore) FindBySessionAndStashAccount(session int64, stash string) (*model.ValidatorSessionSeq, error)

FindBySessionAndStashAccount finds validator by session and stash account

func (ValidatorSessionSeqStore) FindLastSessionSeqByStashAccount

func (s ValidatorSessionSeqStore) FindLastSessionSeqByStashAccount(stashAccount string, limit int64) ([]model.ValidatorSessionSeq, error)

FindLastSessionSeqByStashAccount finds last validator session sequences for given stash account

func (*ValidatorSessionSeqStore) FindMostRecentSessionSeq

func (s *ValidatorSessionSeqStore) FindMostRecentSessionSeq() (*model.ValidatorSessionSeq, error)

FindMostRecentSessionSeq finds most recent validator session sequence

func (ValidatorSessionSeqStore) FindSessionSeqsByHeight

func (s ValidatorSessionSeqStore) FindSessionSeqsByHeight(h int64) ([]model.ValidatorSessionSeq, error)

FindSessionSeqsByHeight finds validator session sequences by height

func (ValidatorSessionSeqStore) Import added in v0.5.0

func (s ValidatorSessionSeqStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (ValidatorSessionSeqStore) Save

func (s ValidatorSessionSeqStore) Save(record interface{}) error

Save saves record to database

func (*ValidatorSessionSeqStore) SummarizeSessionSeqs

func (s *ValidatorSessionSeqStore) SummarizeSessionSeqs(interval types.SummaryInterval, activityPeriods []store.ActivityPeriodRow) ([]model.ValidatorSessionSeqSummary, error)

SummarizeSessionSeqs gets the summarized version of validator sequences

func (ValidatorSessionSeqStore) Truncate

func (s ValidatorSessionSeqStore) Truncate() error

Truncate removes all records from the table

func (ValidatorSessionSeqStore) Update

func (s ValidatorSessionSeqStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

type ValidatorSummaryStore

type ValidatorSummaryStore struct {
	// contains filtered or unexported fields
}

ValidatorSummaryStore handles operations on validators

func NewValidatorSummaryStore

func NewValidatorSummaryStore(db *gorm.DB) *ValidatorSummaryStore

func (ValidatorSummaryStore) Create

func (s ValidatorSummaryStore) Create(record interface{}) error

Create creates a new record. Must pass a pointer.

func (ValidatorSummaryStore) CreateSummary

func (s ValidatorSummaryStore) CreateSummary(val *model.ValidatorSummary) error

CreateSummary creates the validator aggregate

func (ValidatorSummaryStore) DeleteByHeight

func (s ValidatorSummaryStore) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (*ValidatorSummaryStore) DeleteSummaryOlderThan

func (s *ValidatorSummaryStore) DeleteSummaryOlderThan(interval types.SummaryInterval, purgeThreshold time.Time) (*int64, error)

DeleteSummaryOlderThan deleted validator summary records older than given threshold

func (*ValidatorSummaryStore) FindActivityPeriods

func (s *ValidatorSummaryStore) FindActivityPeriods(interval types.SummaryInterval, indexVersion int64) ([]store.ActivityPeriodRow, error)

FindActivityPeriods Finds activity periods

func (*ValidatorSummaryStore) FindMostRecentByInterval

func (s *ValidatorSummaryStore) FindMostRecentByInterval(interval types.SummaryInterval) (*model.ValidatorSummary, error)

FindMostRecentByInterval finds most recent validator summary for interval

func (*ValidatorSummaryStore) FindMostRecentSummary

func (s *ValidatorSummaryStore) FindMostRecentSummary() (*model.ValidatorSummary, error)

FindMostRecentSummary finds most recent validator summary

func (*ValidatorSummaryStore) FindSummaries

func (s *ValidatorSummaryStore) FindSummaries(interval types.SummaryInterval, period string) ([]store.ValidatorSummaryRow, error)

FindSummaries gets summary for validator summary

func (ValidatorSummaryStore) FindSummary

FindSummary find validator summary by query

func (*ValidatorSummaryStore) FindSummaryByStashAccount

func (s *ValidatorSummaryStore) FindSummaryByStashAccount(stashAccount string, interval types.SummaryInterval, period string) ([]store.ValidatorSummaryRow, error)

FindSummaryByStashAccount gets summary for given validator

func (ValidatorSummaryStore) Import added in v0.5.0

func (s ValidatorSummaryStore) Import(query string, rows int, fn bulk.RowFunc) error

Import imports records in bulk

func (ValidatorSummaryStore) Save

func (s ValidatorSummaryStore) Save(record interface{}) error

Save saves record to database

func (ValidatorSummaryStore) SaveSummary

func (s ValidatorSummaryStore) SaveSummary(val *model.ValidatorSummary) error

SaveSummary creates the validator aggregate

func (ValidatorSummaryStore) Truncate

func (s ValidatorSummaryStore) Truncate() error

Truncate removes all records from the table

func (ValidatorSummaryStore) Update

func (s ValidatorSummaryStore) Update(record interface{}) error

Update updates the existing record. Must pass a pointer.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL