postgres

package
v0.0.0-...-83f4222 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStorage

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

func NewPostgresStorage

func NewPostgresStorage(db *sql.DB) *PostgresStorage

func (*PostgresStorage) CreateAccount

func (s *PostgresStorage) CreateAccount(ctx context.Context, reqAcc *types.RequestCreate) (*types.Account, error)

func (*PostgresStorage) DeleteAccount

func (s *PostgresStorage) DeleteAccount(ctx context.Context, id uuid.UUID) error

func (*PostgresStorage) DepositAccount

func (s *PostgresStorage) DepositAccount(ctx context.Context, reqDep *types.RequestDeposit) (*types.Account, error)

func (*PostgresStorage) GetAccount

func (s *PostgresStorage) GetAccount(ctx context.Context) ([]*types.Account, error)

func (*PostgresStorage) GetAccountByCard

func (s *PostgresStorage) GetAccountByCard(ctx context.Context, card string) (*types.Account, error)

func (*PostgresStorage) GetAccountByID

func (s *PostgresStorage) GetAccountByID(ctx context.Context, id uuid.UUID) (*types.Account, error)

func (*PostgresStorage) GetAccountStatement

func (s *PostgresStorage) GetAccountStatement(ctx context.Context, id uuid.UUID) ([]string, error)

func (*PostgresStorage) GetPaymentByID

func (s *PostgresStorage) GetPaymentByID(ctx context.Context, id uuid.UUID) (*types.Payment, error)

func (*PostgresStorage) SaveBalance

func (s *PostgresStorage) SaveBalance(ctx context.Context, tx *sql.Tx, account *types.Account, balance, bmoney uint64) (*types.Account, error)

func (*PostgresStorage) SavePayment

func (s *PostgresStorage) SavePayment(ctx context.Context, tx *sql.Tx, payment *types.Payment) (*types.Payment, error)

func (*PostgresStorage) UpdateAccount

func (s *PostgresStorage) UpdateAccount(ctx context.Context, reqUp *types.RequestUpdate, id uuid.UUID) (*types.Account, error)

func (*PostgresStorage) UpdateStatement

func (s *PostgresStorage) UpdateStatement(ctx context.Context, tx *sql.Tx, id, paymentId uuid.UUID) (*types.Account, error)

Jump to

Keyboard shortcuts

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