repository

package
v0.0.0-...-c53624e Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAccountNotFound happens when the account was not found based on search params.
	ErrAccountNotFound = errors.New("account not found")
)

Functions

This section is empty.

Types

type AccountRepository

type AccountRepository interface {
	Create(ctx context.Context, account *model.Account) error
	ExistsByCPF(ctx context.Context, cpf model.CPF) (bool, error)
	GetByCPF(ctx context.Context, cpf model.CPF) (*model.Account, error)
	Fetch(ctx context.Context) ([]model.Account, error)
	GetBalance(ctx context.Context, id model.AccountID) (*model.Account, error)
	UpdateBalance(ctx context.Context, id model.AccountID, balance model.Money) error
}

AccountRepository is the interface that wraps account datasource methods.

type IdempotencyRepository

type IdempotencyRepository interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Set(ctx context.Context, key string, value []byte, duration time.Duration) error
}

IdempotencyRepository is the interface that wraps idempotency datasource methods.

type Transaction

type Transaction interface {
	WithinTransaction(ctx context.Context, txFunc func(context.Context) (interface{}, error)) (data interface{}, err error)
}

Transaction is the interface that wraps transaction related methods.

type TransferRepository

type TransferRepository interface {
	Transaction
	Create(ctx context.Context, transfer *model.Transfer) error
	Fetch(ctx context.Context, accountID model.AccountID) ([]model.Transfer, error)
}

TransferRepository is the interface that wraps transfer datasource methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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