dbpg

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilterRepositoryImpl

func NewFilterRepositoryImpl(db *DbService) (repository.FilterRepository, error)

func NewHeaderRepositoryImpl

func NewHeaderRepositoryImpl(db *DbService) (repository.BlockHeaderRepository, error)

Types

type BlockHeader

type BlockHeader struct {
	Hash        string `db:"hash"`
	Height      uint32 `db:"height"`
	HeaderBytes []byte `db:"header_bytes"`
}

type DbConfig

type DbConfig struct {
	DbUser             string
	DbPassword         string
	DbHost             string
	DbPort             int
	DbName             string
	MigrationSourceURL string
}

type DbService

type DbService struct {
	Db *sqlx.DB
	// contains filtered or unexported fields
}

func NewDbService

func NewDbService(dbConfig DbConfig) (*DbService, error)

func (*DbService) CreateLoader

func (d *DbService) CreateLoader(db *sql.DB) error

CreateLoader creates loader that is to be used to load fixtures from given folder

func (*DbService) GetTxFromCtx

func (d *DbService) GetTxFromCtx(ctx context.Context) (*sqlx.Tx, error)

func (*DbService) LoadFixtures

func (d *DbService) LoadFixtures() error

func (*DbService) SetCtxTx

func (d *DbService) SetCtxTx(ctx context.Context, tx *sqlx.Tx) context.Context

type Filter

type Filter struct {
	Key   string `db:"filter_key"`
	Value []byte `db:"filter_value"`
}

Jump to

Keyboard shortcuts

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