Documentation ¶
Overview ¶
Package db provides a postgresql database client
Index ¶
- func OpenDB(url string) *bun.DB
- type Database
- func (d *Database) CreateSchema(ctx context.Context) error
- func (d *Database) GetLatestVotesForNetwork(ctx context.Context, network string) ([]VoteEvent, error)
- func (d *Database) GetNewRoundSteps(ctx context.Context, network string) (steps []NewRoundStepEvent, err error)
- func (d *Database) GetNewRounds(ctx context.Context, network string) (rounds []NewRoundEvent, err error)
- func (d *Database) GetValidators(ctx context.Context, network string) (validators Validators, err error)
- func (d *Database) GetVotes(ctx context.Context, network string) (votes []VoteEvent, err error)
- func (d *Database) StoreNewRound(ctx context.Context, network string, roundInfo common.ParsedNewRound) error
- func (d *Database) StoreNewRoundStep(ctx context.Context, network string, roundInfo common.ParsedNewRoundStep) error
- func (d *Database) StoreOrUpdateValidators(ctx context.Context, network string, data map[string]interface{}) error
- func (d *Database) StoreVote(ctx context.Context, network string, vote common.ParsedVote) error
- type NewRoundEvent
- type NewRoundStepEvent
- type Validators
- type VoteEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
func (*Database) GetLatestVotesForNetwork ¶
func (*Database) GetNewRoundSteps ¶
func (*Database) GetNewRounds ¶
func (*Database) GetValidators ¶
func (*Database) StoreNewRound ¶
func (*Database) StoreNewRoundStep ¶
func (*Database) StoreOrUpdateValidators ¶
type NewRoundEvent ¶
type NewRoundStepEvent ¶
type Validators ¶
Click to show internal directories.
Click to hide internal directories.