Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitAccounts ¶
func InitAccounts(s cqrs.EventStore)
Types ¶
type Account ¶
func GetAccount ¶
func GetAccount(id string, store cqrs.EventStore) Account
func MakeAccount ¶
func MakeAccount(balance int, store cqrs.EventStore) Account
func (*Account) HandleCredit ¶
func (account *Account) HandleCredit(event AccountCredited)
func (*Account) HandleDebit ¶
func (account *Account) HandleDebit(event AccountDebited)
func (*Account) HandleNewAccount ¶
func (account *Account) HandleNewAccount(event AccountCreated)
type AccountCreated ¶
type AccountCredited ¶
type AccountDebited ¶
type AccountRepository ¶
type AccountRepository struct {
// contains filtered or unexported fields
}
func NewAccountSummaryRepository ¶
func NewAccountSummaryRepository(url string) *AccountRepository
func (*AccountRepository) Get ¶
func (r *AccountRepository) Get(id string) Summary
type CreateAccountCommand ¶
type CreateAccountCommand struct {
OpeningBalance int `json:"opening_balance"`
}
func (*CreateAccountCommand) Execute ¶
func (command *CreateAccountCommand) Execute() (interface{}, error)
type CreditAccountCommand ¶
type CreditAccountCommand struct { AccountId string `json:"account_id"` Amount int `json:"amount"` }
func (*CreditAccountCommand) Execute ¶
func (command *CreditAccountCommand) Execute() (interface{}, error)
type DebitAccountCommand ¶
func (*DebitAccountCommand) Execute ¶
func (command *DebitAccountCommand) Execute() (interface{}, error)
Click to show internal directories.
Click to hide internal directories.