psql

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

func (s AccountActivitySeq) DeleteByHeight(height int64) error

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, kinds []string, limit int64) ([]model.AccountActivitySeq, error)

FindLastByAddressAndKind finds last account activity sequences for given address and kinds

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

func (AccountActivitySeq) Truncate

func (s AccountActivitySeq) Truncate() error

Truncate removes all records from the table

func (AccountActivitySeq) Update

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

Update updates the existing record. Must pass a pointer.

type BlockSeq

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

BlockSeq handles operations on blocks

func NewBlockSeqStore

func NewBlockSeqStore(db *gorm.DB) *BlockSeq

func (BlockSeq) BulkUpsert

func (s BlockSeq) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

BulkUpsert imports records in bulk

func (BlockSeq) Create

func (s BlockSeq) Create(block *model.BlockSeq) error

Create creates the block

func (BlockSeq) CreateIfNotExists

func (s BlockSeq) CreateIfNotExists(block *model.BlockSeq) error

CreateIfNotExists creates the block if it does not exist

func (BlockSeq) DeleteByHeight

func (s BlockSeq) DeleteByHeight(height int64) error

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

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

FindBy returns a block for a matching attribute

func (BlockSeq) FindByHeight

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

FindByHeight returns a block with the matching height

func (BlockSeq) FindByID

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

FindByID returns a block with matching ID

func (*BlockSeq) FindMostRecent

func (s *BlockSeq) FindMostRecent() (*model.BlockSeq, error)

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

func (s BlockSeq) Save(block *model.BlockSeq) error

Save saves the block

func (*BlockSeq) Summarize

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

Summarize gets the summarized version of block sequences

func (BlockSeq) Truncate

func (s BlockSeq) Truncate() error

Truncate removes all records from the table

func (BlockSeq) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s BlockSummary) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

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

func (s BlockSummary) DeleteByHeight(height int64) error

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

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

func (BlockSummary) Truncate

func (s BlockSummary) Truncate() error

Truncate removes all records from the table

func (BlockSummary) Update

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

Update updates the existing record. Must pass a pointer.

type Database

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

Database handles operations on blocks

func NewDatabaseStore

func NewDatabaseStore(db *gorm.DB) *Database

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

func (s GovernanceActivitySeq) DeleteByHeight(height int64) error

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

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

func (GovernanceActivitySeq) Truncate

func (s GovernanceActivitySeq) Truncate() error

Truncate removes all records from the table

func (GovernanceActivitySeq) Update

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

Update updates the existing record. Must pass a pointer.

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 NewJobsStore(db *gorm.DB) *Jobs

func (Jobs) BulkUpsert added in v0.2.0

func (s Jobs) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

BulkUpsert imports records in bulk

func (Jobs) Create added in v0.2.0

func (s Jobs) Create(jobs []model.Job) error

Create bulk-inserts the job records

func (Jobs) DeleteByHeight added in v0.2.0

func (s Jobs) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (Jobs) FindAllUnfinished added in v0.2.0

func (s Jobs) FindAllUnfinished() ([]model.Job, error)

FindAllUnfinished retrieves all of the unfinished jobs

func (Jobs) FindByHeight added in v0.2.0

func (s Jobs) FindByHeight(height int64) (*model.Job, error)

FindByHeight retrieves a job record for a given height

func (Jobs) LastFinishedHeight added in v0.2.0

func (s Jobs) LastFinishedHeight() (int64, error)

LastFinishedHeight returns the most recent finished height

func (Jobs) LastSyncedHeight added in v0.2.0

func (s Jobs) LastSyncedHeight() (int64, error)

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

func (Jobs) Truncate added in v0.2.0

func (s Jobs) Truncate() error

Truncate removes all records from the table

func (Jobs) Update added in v0.2.0

func (s Jobs) Update(job *model.Job, fields ...string) error

Update updates the selected fields of the job record

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

func (s ProposalAgg) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

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

func (s ProposalAgg) DeleteByHeight(height int64) error

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

func (ProposalAgg) Truncate

func (s ProposalAgg) Truncate() error

Truncate removes all records from the table

func (ProposalAgg) Update

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

Update updates the existing record. Must pass a pointer.

type Reports

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

Reports handles operations on reports

func NewReportsStore

func NewReportsStore(db *gorm.DB) *Reports

func (Reports) BulkUpsert

func (s Reports) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

BulkUpsert imports records in bulk

func (Reports) Create

func (s Reports) Create(val *model.Report) error

Create creates the report

func (Reports) DeleteByHeight

func (s Reports) DeleteByHeight(height int64) error

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

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

Last returns the last report

func (Reports) Last

func (s Reports) Last() (*model.Report, error)

Last returns the last report

func (Reports) Save

func (s Reports) Save(val *model.Report) error

Save creates the report

func (Reports) Truncate

func (s Reports) Truncate() error

Truncate removes all records from the table

func (Reports) Update

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

Update updates the existing record. Must pass a pointer.

type Store

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

Store handles all database operations

func New

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

NewIndexerMetric returns a new 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) GetCore

func (s *Store) GetCore() *core

GetDatabase gets database

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

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 Syncables

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

Syncables handles operations on syncables

func NewSyncablesStore

func NewSyncablesStore(db *gorm.DB) *Syncables

func (Syncables) BulkUpsert

func (s Syncables) BulkUpsert(query string, rows int, fn bulk.RowFunc) error

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

func (s Syncables) CreateOrUpdate(val *model.Syncable) error

CreateOrUpdate creates a new syncable or updates an existing one

func (Syncables) DeleteByHeight

func (s Syncables) DeleteByHeight(height int64) error

DeleteByHeight removes all records associated with a height

func (Syncables) FindByHeight

func (s Syncables) FindByHeight(height int64) (syncable *model.Syncable, err error)

Exists returns true if a syncable exists at give height

func (Syncables) FindFirstByDifferentIndexVersion

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

FindFirstByDifferentIndexVersion returns first syncable with different index version

func (Syncables) FindLastInEpoch

func (s Syncables) FindLastInEpoch(epoch int64) (syncable *model.Syncable, err error)

FindLastInEpoch finds last syncable in given epoch

func (Syncables) FindLastInEpochForHeight

func (s Syncables) FindLastInEpochForHeight(height int64) (syncable *model.Syncable, err error)

FindLastInEpochForHeight finds last_in_epoch syncable for given height

func (Syncables) FindMostRecent

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

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

func (s Syncables) FindMostRecentProcessed() (*model.Syncable, error)

FindMostRecentProcessed returns the most recent processed syncable

func (Syncables) FindSmallestIndexVersion

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

FindSmallestIndexVersion returns smallest index version

func (Syncables) Save

func (s Syncables) Save(val *model.Syncable) error

Save creates the syncable

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

func (Syncables) Truncate

func (s Syncables) Truncate() error

Truncate removes all records from the table

func (Syncables) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s SystemEvents) DeleteByHeight(height int64) error

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) (*store.PaginatedResult, 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

func (SystemEvents) Truncate

func (s SystemEvents) Truncate() error

Truncate removes all records from the table

func (SystemEvents) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s ValidatorAgg) BulkUpsert(records []model.ValidatorAgg) error

BulkUpsert inserts validator aggregates in bulk

func (ValidatorAgg) Create

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

Create creates a new record. Must pass a pointer.

func (ValidatorAgg) DeleteByHeight

func (s ValidatorAgg) DeleteByHeight(height int64) error

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(record interface{}) error

Save saves record to database

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

All returns all validator groups

func (ValidatorGroupAgg) BulkUpsert

func (s ValidatorGroupAgg) BulkUpsert(records []model.ValidatorGroupAgg) error

BulkUpsert inserts validator group aggregates in bulk

func (ValidatorGroupAgg) Create

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

Create creates a new record. Must pass a pointer.

func (ValidatorGroupAgg) DeleteByHeight

func (s ValidatorGroupAgg) DeleteByHeight(height int64) error

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

FindByID returns an validator group for the ID

func (ValidatorGroupAgg) Save

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

Save saves record to database

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

func (s ValidatorGroupSeq) DeleteByHeight(height int64) error

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

func (ValidatorGroupSeq) Truncate

func (s ValidatorGroupSeq) Truncate() error

Truncate removes all records from the table

func (ValidatorGroupSeq) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s ValidatorGroupSummary) DeleteByHeight(height int64) error

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

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

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

func (ValidatorGroupSummary) Truncate

func (s ValidatorGroupSummary) Truncate() error

Truncate removes all records from the table

func (ValidatorGroupSummary) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s ValidatorSeq) DeleteByHeight(height int64) error

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

func (ValidatorSeq) Truncate

func (s ValidatorSeq) Truncate() error

Truncate removes all records from the table

func (ValidatorSeq) Update

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

Update updates the existing record. Must pass a pointer.

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

func (s ValidatorSummary) DeleteByHeight(height int64) error

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

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

func (ValidatorSummary) Truncate

func (s ValidatorSummary) Truncate() error

Truncate removes all records from the table

func (ValidatorSummary) Update

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

Update updates the existing record. Must pass a pointer.

Jump to

Keyboard shortcuts

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