Documentation
¶
Index ¶
- type Account
- type Gateway
- func (g *Gateway) DecreaseBalance(ctx context.Context, id int64, ammount int) (Account, error)
- func (g *Gateway) IncreaseBalance(ctx context.Context, id int64, ammount int) (Account, error)
- func (g *Gateway) IsBalanceSufficient(ctx context.Context, accountID int64, ammount int) (bool, error)
- func (g *Gateway) OpenAccount(ctx context.Context, initialAmmount int) (Account, error)
- func (g *Gateway) RunInTransaction(ctx context.Context, txFn func(context.Context) (interface{}, error)) (interface{}, error)
- type MockDB
- type MockGateway
- func (g *MockGateway) DecreaseBalance(ctx context.Context, id int64, ammount int) (Account, error)
- func (g *MockGateway) IncreaseBalance(ctx context.Context, id int64, ammount int) (Account, error)
- func (g *MockGateway) IsBalanceSufficient(ctx context.Context, accountID int64, ammount int) (bool, error)
- func (g *MockGateway) OpenAccount(ctx context.Context, initialAmmount int) (Account, error)
- func (g *MockGateway) RunInTransaction(ctx context.Context, txFn func(context.Context) (interface{}, error)) (interface{}, error)
- type Provider
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway ...
func (*Gateway) DecreaseBalance ¶
DecreaseBalance ...
func (*Gateway) IncreaseBalance ¶
IncreaseBalance ...
func (*Gateway) IsBalanceSufficient ¶
func (g *Gateway) IsBalanceSufficient(ctx context.Context, accountID int64, ammount int) (bool, error)
IsBalanceSufficient ...
func (*Gateway) OpenAccount ¶
OpenAccount ...
type MockGateway ¶
type MockGateway struct {
// contains filtered or unexported fields
}
MockGateway ...
func (*MockGateway) DecreaseBalance ¶
DecreaseBalance ...
func (*MockGateway) IncreaseBalance ¶
IncreaseBalance ...
func (*MockGateway) IsBalanceSufficient ¶
func (g *MockGateway) IsBalanceSufficient(ctx context.Context, accountID int64, ammount int) (bool, error)
IsBalanceSufficient ...
func (*MockGateway) OpenAccount ¶
OpenAccount ...
func (*MockGateway) RunInTransaction ¶
func (g *MockGateway) RunInTransaction(ctx context.Context, txFn func(context.Context) (interface{}, error)) (interface{}, error)
RunInTransaction ...
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider ...
func (*Provider) OpenAccount ¶
OpenAccount ...
type Repository ¶
type Repository interface { RunInTransaction(context.Context, func(context.Context) (interface{}, error)) (interface{}, error) OpenAccount(ctx context.Context, initialAmmount int) (Account, error) IsBalanceSufficient(ctx context.Context, accountID int64, ammount int) (bool, error) IncreaseBalance(ctx context.Context, accountID int64, ammount int) (Account, error) DecreaseBalance(ctx context.Context, accountID int64, ammount int) (Account, error) }
Repository ...
Click to show internal directories.
Click to hide internal directories.