postgres

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllVotings

type AllVotings struct {
	Cvotings      []data.ConstitutionVoting
	GUvotings     []data.GeneralUpdateVoting
	EUvotings     []data.EmergencyUpdateVoting
	Rvotings      []data.RootsVoting
	RSvotings     []data.RootnodesSlashingVoting
	VSvotings     []data.ValidatorsSlashingVoting
	EPQFIMvotings []data.EpqfiMembershipVoting
	EPQFIPvotings []data.EpqfiParametersVoting
	EPDRMvotings  []data.EpdrMembershipVoting
	EPDRPvotings  []data.EpdrParametersVoting
	EPRSMvotings  []data.EprsMembershipVoting
	EPRSPvotings  []data.EprsParametersVoting
	CRAvotings    []data.ContractRegistryAddressVoting
	CRUvotings    []data.ContractRegistryUpgradeVoting
}

type BlockStorage

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

BlockStorage implements data.BlockStorage.

func (*BlockStorage) Erase

func (s *BlockStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*BlockStorage) GetBlockEarlierThan

func (s *BlockStorage) GetBlockEarlierThan(timestamp int64) (*data.Block, error)

func (*BlockStorage) GetByNumber

func (s *BlockStorage) GetByNumber(number uint64) (*data.Block, error)

func (*BlockStorage) GetLatest

func (s *BlockStorage) GetLatest() (*data.Block, error)

GetLatest block.

func (*BlockStorage) Insert

func (s *BlockStorage) Insert(block *data.Block) error

func (*BlockStorage) Select

func (s *BlockStorage) Select(params *data.SelectBlocksParams) ([]data.Block, error)

Select blocks with params.

type ConstitutionVotingStorage

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

ConstitutionVotingStorage implements data.ConstitutionVotingStorage.

func (*ConstitutionVotingStorage) Erase

func (s *ConstitutionVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*ConstitutionVotingStorage) GetByNumber

func (s *ConstitutionVotingStorage) GetByNumber(number uint64) (*data.ConstitutionVoting, error)

func (*ConstitutionVotingStorage) GetEarliestUnfinishedVotings

func (s *ConstitutionVotingStorage) GetEarliestUnfinishedVotings() ([]data.ConstitutionVoting, error)

func (*ConstitutionVotingStorage) GetLatest

GetLatest block.

func (*ConstitutionVotingStorage) Insert

func (*ConstitutionVotingStorage) Select

Select votings with params.

func (*ConstitutionVotingStorage) Update

type ContractRegistryAddressVotingStorage

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

ContractRegistryAddressVotingStorage implements data.ContractRegistryAddressVotingStorage.

func (*ContractRegistryAddressVotingStorage) Erase

Erase all history starting fromID inclusively.

func (*ContractRegistryAddressVotingStorage) GetByNumber

func (*ContractRegistryAddressVotingStorage) GetEarliestUnfinishedVotings

func (s *ContractRegistryAddressVotingStorage) GetEarliestUnfinishedVotings() ([]data.ContractRegistryAddressVoting, error)

func (*ContractRegistryAddressVotingStorage) GetLatest

GetLatest block.

func (*ContractRegistryAddressVotingStorage) Insert

func (*ContractRegistryAddressVotingStorage) Select

Select votings with params.

func (*ContractRegistryAddressVotingStorage) Update

type ContractRegistryUpgradeVotingStorage

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

ContractRegistryUpgradeVotingStorage implements data.ContractRegistryUpgradeVotingStorage.

func (*ContractRegistryUpgradeVotingStorage) Erase

Erase all history starting fromID inclusively.

func (*ContractRegistryUpgradeVotingStorage) GetByNumber

func (*ContractRegistryUpgradeVotingStorage) GetEarliestUnfinishedVotings

func (s *ContractRegistryUpgradeVotingStorage) GetEarliestUnfinishedVotings() ([]data.ContractRegistryUpgradeVoting, error)

func (*ContractRegistryUpgradeVotingStorage) GetLatest

GetLatest block.

func (*ContractRegistryUpgradeVotingStorage) Insert

func (*ContractRegistryUpgradeVotingStorage) Select

Select votings with params.

func (*ContractRegistryUpgradeVotingStorage) Update

type EmergencyUpdateVotingStorage

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

EmergencyUpdateVotingStorage implements data.EmergencyUpdateVotingStorage.

func (*EmergencyUpdateVotingStorage) Erase

func (s *EmergencyUpdateVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EmergencyUpdateVotingStorage) GetByNumber

func (*EmergencyUpdateVotingStorage) GetEarliestUnfinishedVotings

func (s *EmergencyUpdateVotingStorage) GetEarliestUnfinishedVotings() ([]data.EmergencyUpdateVoting, error)

func (*EmergencyUpdateVotingStorage) GetLatest

GetLatest block.

func (*EmergencyUpdateVotingStorage) Insert

func (*EmergencyUpdateVotingStorage) Select

Select votings with params.

func (*EmergencyUpdateVotingStorage) Update

type EpdrMembershipVotingStorage

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

EpdrMembershipVotingStorage implements data.EpdrMembershipVotingStorage.

func (*EpdrMembershipVotingStorage) Erase

func (s *EpdrMembershipVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EpdrMembershipVotingStorage) GetByNumber

func (*EpdrMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EpdrMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpdrMembershipVoting, error)

func (*EpdrMembershipVotingStorage) GetLatest

GetLatest block.

func (*EpdrMembershipVotingStorage) Insert

func (*EpdrMembershipVotingStorage) Select

Select votings with params.

func (*EpdrMembershipVotingStorage) Update

type EpdrParametersVotingStorage

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

EpdrParametersVotingStorage implements data.EpdrParametersVotingStorage.

func (*EpdrParametersVotingStorage) Erase

func (s *EpdrParametersVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EpdrParametersVotingStorage) GetByNumber

func (*EpdrParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EpdrParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpdrParametersVoting, error)

func (*EpdrParametersVotingStorage) GetLatest

GetLatest epdr parameters voting.

func (*EpdrParametersVotingStorage) Insert

func (*EpdrParametersVotingStorage) Select

Select votings with params.

func (*EpdrParametersVotingStorage) Update

type EpqfiMembershipVotingStorage

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

EpqfiMembershipVotingStorage implements data.EpqfiMembershipVotingStorage.

func (*EpqfiMembershipVotingStorage) Erase

func (s *EpqfiMembershipVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EpqfiMembershipVotingStorage) GetByNumber

func (*EpqfiMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EpqfiMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpqfiMembershipVoting, error)

func (*EpqfiMembershipVotingStorage) GetLatest

GetLatest epqfi membership voting.

func (*EpqfiMembershipVotingStorage) Insert

func (*EpqfiMembershipVotingStorage) Select

Select votings with params.

func (*EpqfiMembershipVotingStorage) Update

type EpqfiParametersVotingStorage

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

EpqfiParametersVotingStorage implements data.EpqfiParametersVotingStorage.

func (*EpqfiParametersVotingStorage) Erase

func (s *EpqfiParametersVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EpqfiParametersVotingStorage) GetByNumber

func (*EpqfiParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EpqfiParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EpqfiParametersVoting, error)

func (*EpqfiParametersVotingStorage) GetLatest

GetLatest epqfi parameters voting.

func (*EpqfiParametersVotingStorage) Insert

func (*EpqfiParametersVotingStorage) Select

Select votings with params.

func (*EpqfiParametersVotingStorage) Update

type EprsMembershipVotingStorage

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

EprsMembershipVotingStorage implements data.EprsMembershipVotingStorage.

func (*EprsMembershipVotingStorage) Erase

func (s *EprsMembershipVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EprsMembershipVotingStorage) GetByNumber

func (*EprsMembershipVotingStorage) GetEarliestUnfinishedVotings

func (s *EprsMembershipVotingStorage) GetEarliestUnfinishedVotings() ([]data.EprsMembershipVoting, error)

func (*EprsMembershipVotingStorage) GetLatest

GetLatest eprs membership voting.

func (*EprsMembershipVotingStorage) Insert

func (*EprsMembershipVotingStorage) Select

Select votings with params.

func (*EprsMembershipVotingStorage) Update

type EprsParametersVotingStorage

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

EprsParametersVotingStorage implements data.EprsParametersVotingStorage.

func (*EprsParametersVotingStorage) Erase

func (s *EprsParametersVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*EprsParametersVotingStorage) GetByNumber

func (*EprsParametersVotingStorage) GetEarliestUnfinishedVotings

func (s *EprsParametersVotingStorage) GetEarliestUnfinishedVotings() ([]data.EprsParametersVoting, error)

func (*EprsParametersVotingStorage) GetLatest

GetLatest eprs parameters voting.

func (*EprsParametersVotingStorage) Insert

func (*EprsParametersVotingStorage) Select

Select votings with params.

func (*EprsParametersVotingStorage) Update

type GeneralUpdateVotingStorage

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

GeneralUpdateVotingStorage implements data.GeneralUpdateVotingStorage.

func (*GeneralUpdateVotingStorage) Erase

func (s *GeneralUpdateVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*GeneralUpdateVotingStorage) GetByNumber

func (s *GeneralUpdateVotingStorage) GetByNumber(number uint64) (*data.GeneralUpdateVoting, error)

func (*GeneralUpdateVotingStorage) GetEarliestUnfinishedVotings

func (s *GeneralUpdateVotingStorage) GetEarliestUnfinishedVotings() ([]data.GeneralUpdateVoting, error)

func (*GeneralUpdateVotingStorage) GetLatest

GetLatest general update voting.

func (*GeneralUpdateVotingStorage) Insert

func (*GeneralUpdateVotingStorage) Select

Select votings with params.

func (*GeneralUpdateVotingStorage) Update

type PaymentStorage

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

func (*PaymentStorage) Get

func (s *PaymentStorage) Get(txHash string) (*data.Payment, error)

func (*PaymentStorage) Insert

func (s *PaymentStorage) Insert(payments ...data.Payment) error

func (*PaymentStorage) Select

func (s *PaymentStorage) Select(params *data.SelectPaymentsParams) ([]data.Payment, error)

type RootnodesSlashingVotingStorage

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

RootnodesSlashingVotingStorage implements data.RootnodesSlashingVotingStorage.

func (*RootnodesSlashingVotingStorage) Erase

func (s *RootnodesSlashingVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*RootnodesSlashingVotingStorage) GetByNumber

func (*RootnodesSlashingVotingStorage) GetEarliestUnfinishedVotings

func (s *RootnodesSlashingVotingStorage) GetEarliestUnfinishedVotings() ([]data.RootnodesSlashingVoting, error)

func (*RootnodesSlashingVotingStorage) GetLatest

GetLatest rootnodes slashing voting.

func (*RootnodesSlashingVotingStorage) Insert

func (*RootnodesSlashingVotingStorage) Select

Select votings with params.

func (*RootnodesSlashingVotingStorage) Update

type RootsVotingStorage

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

RootsVotingStorage implements data.RootsVotingStorage.

func (*RootsVotingStorage) Erase

func (s *RootsVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*RootsVotingStorage) GetByNumber

func (s *RootsVotingStorage) GetByNumber(number uint64) (*data.RootsVoting, error)

func (*RootsVotingStorage) GetEarliestUnfinishedVoting

func (s *RootsVotingStorage) GetEarliestUnfinishedVoting() (*data.RootsVoting, error)

func (*RootsVotingStorage) GetEarliestUnfinishedVotings

func (s *RootsVotingStorage) GetEarliestUnfinishedVotings() ([]data.RootsVoting, error)

func (*RootsVotingStorage) GetLatest

func (s *RootsVotingStorage) GetLatest() (*data.RootsVoting, error)

GetLatest roots voting.

func (*RootsVotingStorage) Insert

func (s *RootsVotingStorage) Insert(voting *data.RootsVoting) error

func (*RootsVotingStorage) Select

Select votings with params.

func (*RootsVotingStorage) Update

func (s *RootsVotingStorage) Update(voting *data.RootsVoting) error

type Storage

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

Storage backed by postgres.

func New

func New(db *pgdb.DB) *Storage

New Storage.

func (*Storage) Blocks

func (s *Storage) Blocks() data.BlockStorage

Blocks.

func (*Storage) Clone

func (s *Storage) Clone() data.Storage

Clone Storage for a new tx.

func (*Storage) ConstitutionVotings

func (s *Storage) ConstitutionVotings() data.ConstitutionVotingStorage

ConstitutionVotings storage.

func (*Storage) ContractRegistryAddressVotings

func (s *Storage) ContractRegistryAddressVotings() data.ContractRegistryAddressVotingStorage

ContractRegistryAddressVotings storage.

func (*Storage) ContractRegistryUpgradeVotings

func (s *Storage) ContractRegistryUpgradeVotings() data.ContractRegistryUpgradeVotingStorage

ContractRegistryUpgradeVotings storage.

func (*Storage) EmergencyUpdateVotings

func (s *Storage) EmergencyUpdateVotings() data.EmergencyUpdateVotingStorage

EmergencyUpdateVotings storage.

func (*Storage) EpdrMembershipVotings

func (s *Storage) EpdrMembershipVotings() data.EpdrMembershipVotingStorage

EpdrMembershipVotings storage.

func (*Storage) EpdrParametersVotings

func (s *Storage) EpdrParametersVotings() data.EpdrParametersVotingStorage

EpdrParametersVotings storage.

func (*Storage) EpqfiMembershipVotings

func (s *Storage) EpqfiMembershipVotings() data.EpqfiMembershipVotingStorage

EpqfiMembershipVotings storage.

func (*Storage) EpqfiParametersVotings

func (s *Storage) EpqfiParametersVotings() data.EpqfiParametersVotingStorage

EpqfiParametersVotings storage.

func (*Storage) EprsMembershipVotings

func (s *Storage) EprsMembershipVotings() data.EprsMembershipVotingStorage

EprsMembershipVotings storage.

func (*Storage) EprsParametersVotings

func (s *Storage) EprsParametersVotings() data.EprsParametersVotingStorage

EprsParametersVotings storage.

func (*Storage) ExecInTx

func (s *Storage) ExecInTx(fn func() error) error

ExecInTx isolates execution of fn within sql transaction.

func (*Storage) GeneralUpdateVotings

func (s *Storage) GeneralUpdateVotings() data.GeneralUpdateVotingStorage

GeneralUpdateVotings storage.

func (*Storage) Payments

func (s *Storage) Payments() data.PaymentsStorage

Payments storage.

func (*Storage) RootnodesSlashingVotings

func (s *Storage) RootnodesSlashingVotings() data.RootnodesSlashingVotingStorage

RootnodesSlashingVotings storage.

func (*Storage) RootsVotings

func (s *Storage) RootsVotings() data.RootsVotingStorage

RootsVotings storage.

func (*Storage) SummaryMetrics

func (s *Storage) SummaryMetrics() data.SummaryMetricsStorage

SummaryMetrics.

func (*Storage) Transactions

func (s *Storage) Transactions() data.TransactionStorage

Transactions.

func (*Storage) ValidatorsSlashingVotings

func (s *Storage) ValidatorsSlashingVotings() data.ValidatorsSlashingVotingStorage

ValidatorsSlashingVotings storage.

func (*Storage) Votings

func (s *Storage) Votings() data.VotingStorage

Payments storage.

type SummaryMetricsStorage

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

SummaryMetricsStorage implements data.SummaryMetricsStorage.

func (*SummaryMetricsStorage) Select

Select blocks with params.

type TransactionStorage

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

func (*TransactionStorage) Get

func (s *TransactionStorage) Get(hash string) (*data.Transaction, error)

Get Transaction by hash.

func (*TransactionStorage) Insert

func (s *TransactionStorage) Insert(txs ...data.Transaction) error

Insert txs.

func (*TransactionStorage) Select

func (s *TransactionStorage) Select(params *data.SelectTxsParams) ([]data.Transaction, error)

Select txs.

type ValidatorsSlashingVotingStorage

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

ValidatorsSlashingVotingStorage implements data.ValidatorsSlashingVotingStorage.

func (*ValidatorsSlashingVotingStorage) Erase

func (s *ValidatorsSlashingVotingStorage) Erase(fromID uint64) error

Erase all history starting fromID inclusively.

func (*ValidatorsSlashingVotingStorage) GetByNumber

func (*ValidatorsSlashingVotingStorage) GetEarliestUnfinishedVotings

func (s *ValidatorsSlashingVotingStorage) GetEarliestUnfinishedVotings() ([]data.ValidatorsSlashingVoting, error)

func (*ValidatorsSlashingVotingStorage) GetLatest

GetLatest validators slashing voting.

func (*ValidatorsSlashingVotingStorage) Insert

func (*ValidatorsSlashingVotingStorage) Select

Select votings with params.

func (*ValidatorsSlashingVotingStorage) Update

type VotingStorage

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

VotingStorage implements all votings from package data.

func (*VotingStorage) Select

func (s *VotingStorage) Select(params *data.SelectVotingsParams) ([]interface{}, error)

Select blocks with params.

func (*VotingStorage) Union

func (s *VotingStorage) Union(mainQuery *squirrel.SelectBuilder, query squirrel.SelectBuilder) error

Jump to

Keyboard shortcuts

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