database

package
v2.0.0-...-d626aa2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(conn *pgx.Conn) error

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetStateByKey

func (q *Queries) GetStateByKey(ctx context.Context, key string) (State, error)

func (*Queries) SetState

func (q *Queries) SetState(ctx context.Context, arg SetStateParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Repository

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

func NewRepository

func NewRepository(db DBTX) *Repository

func (*Repository) SetBlockState

func (r *Repository) SetBlockState(
	ctx context.Context,
	chain entities.Chain,
	blocks []entities.BlockHash,
) error

type SetStateParams

type SetStateParams struct {
	Key   string
	Value []byte
}

type State

type State struct {
	Key       string
	Value     []byte
	CreatedAt pgtype.Timestamp
	UpdatedAt pgtype.Timestamp
}

Jump to

Keyboard shortcuts

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