postgres

package
v0.0.0-...-e55fb6d Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(ctx context.Context, dsn string) (*pgxpool.Pool, error)

Types

type AccountStorage

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

func NewAccountStorage

func NewAccountStorage(db *pgxpool.Pool) *AccountStorage

func NewAccountTxStorage

func NewAccountTxStorage(db *pgxpool.Pool) *AccountStorage

func (*AccountStorage) CreateAccount

func (s *AccountStorage) CreateAccount(ctx context.Context, acc account.Account) error

func (*AccountStorage) GetAccount

func (s *AccountStorage) GetAccount(ctx context.Context, id ulid.ULID) (*account.Account, error)

type AccountTxStorage

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

func (*AccountTxStorage) GetAllByDateRange

func (a *AccountTxStorage) GetAllByDateRange(ctx context.Context, id ulid.ULID, from, to time.Time) ([]transfer.Transaction, error)

func (*AccountTxStorage) GetAllFromAccount

func (a *AccountTxStorage) GetAllFromAccount(ctx context.Context, id ulid.ULID) ([]transfer.Transaction, error)

type TxStorage

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

func NewTxStorage

func NewTxStorage(db *pgxpool.Pool) *TxStorage

func (*TxStorage) CreateTx

func (s *TxStorage) CreateTx(ctx context.Context, t transfer.Transaction) error

func (*TxStorage) GetTx

func (s *TxStorage) GetTx(ctx context.Context, id ulid.ULID) (*transfer.Transaction, error)

Jump to

Keyboard shortcuts

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