Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { GetTransactions(ctx context.Context, acc string) ([]Transaction, error) InsertTransaction(ctx context.Context, tx Transaction) error NewAccount(ctx context.Context, acc string, level Restriction) error SetRestriction(ctx context.Context, acc string, level Restriction) error }
type Restriction ¶
type Restriction int
const ( AllowRead Restriction = iota AllowCredit AllowDebit )
type Service ¶
type Service interface { Deposit(ctx context.Context, acc string, amount uint) (int, error) Withdraw(ctx context.Context, acc string, amount uint) (int, error) Balance(ctx context.Context, acc string) (int, error) }
func NewService ¶
type Transaction ¶
type Transaction interface { Account() string Number() uint Amount() uint Type() TransactionType }
Click to show internal directories.
Click to hide internal directories.