storage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 ExchangeRate

type ExchangeRate struct {
	ID        int64
	Base      string
	Target    string
	Rate      pgtype.Numeric
	RateType  string
	Source    string
	AsOf      pgtype.Timestamptz
	FetchedAt pgtype.Timestamptz
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ListCurrencies

func (q *Queries) ListCurrencies(ctx context.Context) ([]string, error)

func (*Queries) ListSources

func (q *Queries) ListSources(ctx context.Context) ([]string, error)

func (*Queries) RateAsOf

func (q *Queries) RateAsOf(ctx context.Context, arg RateAsOfParams) ([]RateAsOfRow, error)

func (*Queries) SaveExchangeRate

func (q *Queries) SaveExchangeRate(ctx context.Context, arg SaveExchangeRateParams) error

func (*Queries) WithTx

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

type RateAsOfParams

type RateAsOfParams struct {
	Offset   int64
	Limit    int32
	Base     string
	Target   pgtype.Text
	Source   pgtype.Text
	RateType pgtype.Text
	AsOf     pgtype.Timestamptz
}

type RateAsOfRow

type RateAsOfRow struct {
	ID        int64
	Base      string
	Target    string
	Rate      pgtype.Numeric
	RateType  string
	Source    string
	AsOf      pgtype.Timestamptz
	FetchedAt pgtype.Timestamptz
	Total     int64
}

type SaveExchangeRateParams

type SaveExchangeRateParams struct {
	Base      string
	Target    string
	Rate      pgtype.Numeric
	RateType  string
	Source    string
	AsOf      pgtype.Timestamptz
	FetchedAt pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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