repository

package
v0.0.0-...-d880922 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountNoSQL

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

func NewAccountNoSQL

func NewAccountNoSQL(db NoSQL) AccountNoSQL

func (AccountNoSQL) Create

func (a AccountNoSQL) Create(ctx context.Context, account domain.Account) (domain.Account, error)

func (AccountNoSQL) FindAll

func (a AccountNoSQL) FindAll(ctx context.Context) ([]domain.Account, error)

func (AccountNoSQL) FindBalance

func (a AccountNoSQL) FindBalance(ctx context.Context, ID domain.AccountID) (domain.Account, error)

func (AccountNoSQL) FindByID

func (AccountNoSQL) UpdateBalance

func (a AccountNoSQL) UpdateBalance(ctx context.Context, ID domain.AccountID, balance domain.Money) error

type AccountSQL

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

func NewAccountSQL

func NewAccountSQL(db SQL) AccountSQL

func (AccountSQL) Create

func (a AccountSQL) Create(ctx context.Context, account domain.Account) (domain.Account, error)

func (AccountSQL) FindAll

func (a AccountSQL) FindAll(ctx context.Context) ([]domain.Account, error)

func (AccountSQL) FindBalance

func (a AccountSQL) FindBalance(ctx context.Context, ID domain.AccountID) (domain.Account, error)

func (AccountSQL) FindByID

func (a AccountSQL) FindByID(ctx context.Context, ID domain.AccountID) (domain.Account, error)

func (AccountSQL) UpdateBalance

func (a AccountSQL) UpdateBalance(ctx context.Context, ID domain.AccountID, balance domain.Money) error

type NoSQL

type NoSQL interface {
	Store(context.Context, string, interface{}) error
	Update(context.Context, string, interface{}, interface{}) error
	FindAll(context.Context, string, interface{}, interface{}) error
	FindOne(context.Context, string, interface{}, interface{}, interface{}) error
	StartSession() (Session, error)
}

type Row

type Row interface {
	Scan(dest ...interface{}) error
}

type Rows

type Rows interface {
	Scan(dest ...interface{}) error
	Next() bool
	Err() error
	Close() error
}

type SQL

type SQL interface {
	ExecuteContext(context.Context, string, ...interface{}) error
	QueryContext(context.Context, string, ...interface{}) (Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) Row
	BeginTx(ctx context.Context) (Tx, error)
}

type Session

type Session interface {
	WithTransaction(context.Context, func(context.Context) error) error
	EndSession(context.Context)
}

type TransferNoSQL

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

func NewTransferNoSQL

func NewTransferNoSQL(db NoSQL) TransferNoSQL

func (TransferNoSQL) Create

func (t TransferNoSQL) Create(ctx context.Context, transfer domain.Transfer) (domain.Transfer, error)

func (TransferNoSQL) FindAll

func (t TransferNoSQL) FindAll(ctx context.Context) ([]domain.Transfer, error)

func (TransferNoSQL) WithTransaction

func (t TransferNoSQL) WithTransaction(ctx context.Context, fn func(ctxTx context.Context) error) error

type TransferSQL

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

func NewTransferSQL

func NewTransferSQL(db SQL) TransferSQL

func (TransferSQL) Create

func (t TransferSQL) Create(ctx context.Context, transfer domain.Transfer) (domain.Transfer, error)

func (TransferSQL) FindAll

func (t TransferSQL) FindAll(ctx context.Context) ([]domain.Transfer, error)

func (TransferSQL) WithTransaction

func (t TransferSQL) WithTransaction(ctx context.Context, fn func(ctxTx context.Context) error) error

type Tx

type Tx interface {
	ExecuteContext(context.Context, string, ...interface{}) error
	QueryContext(context.Context, string, ...interface{}) (Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) Row
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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