postgresql

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingParameter = errors.New("missing parameter")
	ErrNotFound         = errors.New("record not found")
)

Functions

This section is empty.

Types

type Driver

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

Driver is postgres database driver implementation

func NewDriver

func NewDriver(ctx context.Context, db *sql.DB, l *zap.Logger) *Driver

NewDriver is Driver constructor

func (*Driver) GetAccounts

func (d *Driver) GetAccounts(ctx context.Context, params structs.AccountParams) (accounts []structs.Account, err error)

GetAccounts gets accounts

func (*Driver) GetContractEvents

func (d *Driver) GetContractEvents(ctx context.Context, params structs.EventParams) (contractEvents []structs.ContractEvent, err error)

GetContractEvents gets contract events

func (*Driver) GetDelegationTimeline

func (d *Driver) GetDelegationTimeline(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)

GetDelegationTimeline gets all delegation information over time

func (*Driver) GetDelegations

func (d *Driver) GetDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.Delegation, err error)

func (*Driver) GetNodes

func (d *Driver) GetNodes(ctx context.Context, params structs.NodeParams) (nodes []structs.Node, err error)

GetNodes gets nodes

func (*Driver) GetSystemEvents

func (d *Driver) GetSystemEvents(ctx context.Context, params structs.SystemEventParams) (systemEvents []structs.SystemEvent, err error)

GetSystemEvents gets contract events

func (*Driver) GetTypesSummaryDelegations added in v0.0.4

func (d *Driver) GetTypesSummaryDelegations(ctx context.Context, params structs.DelegationParams) (delegations []structs.DelegationSummary, err error)

func (*Driver) GetValidatorStatistics

func (d *Driver) GetValidatorStatistics(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)

func (*Driver) GetValidatorStatisticsTimeline

func (d *Driver) GetValidatorStatisticsTimeline(ctx context.Context, params structs.ValidatorStatisticsParams) (validatorStatistics []structs.ValidatorStatistics, err error)

func (*Driver) GetValidators

func (d *Driver) GetValidators(ctx context.Context, params structs.ValidatorParams) (validators []structs.Validator, err error)

GetValidators gets validators by params

func (*Driver) SaveAccount

func (d *Driver) SaveAccount(ctx context.Context, a structs.Account) error

SaveAccount saves account

func (*Driver) SaveContractEvent

func (d *Driver) SaveContractEvent(ctx context.Context, ce structs.ContractEvent) error

SaveEvent saves contract events

func (*Driver) SaveDelegation

func (d *Driver) SaveDelegation(ctx context.Context, dl structs.Delegation) error

SaveDelegation saves delegation

func (*Driver) SaveNodes

func (d *Driver) SaveNodes(ctx context.Context, nodes []structs.Node, removedNodeAddress common.Address) error

SaveNodes saves nodes

func (*Driver) SaveSystemEvent

func (d *Driver) SaveSystemEvent(ctx context.Context, se structs.SystemEvent) error

SaveSystemEvent saves system events

func (*Driver) SaveValidator

func (d *Driver) SaveValidator(ctx context.Context, v structs.Validator) error

SaveValidator saves validator

func (*Driver) SaveValidatorStatistic

func (d *Driver) SaveValidatorStatistic(ctx context.Context, validatorID *big.Int, blockHeight uint64, blockTime time.Time, statisticsType structs.StatisticTypeVS, amount *big.Int) (err error)

func (*Driver) UpdateCountsOfValidator

func (d *Driver) UpdateCountsOfValidator(ctx context.Context, validatorID *big.Int) error

UpdateCountsOfValidator updates linked ,active node count as well as total stake information of validator

Jump to

Keyboard shortcuts

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