Documentation
¶
Index ¶
Constants ¶
View Source
const DBTblNameAccounts = "accounts"
View Source
const TableNameEmails = "emails"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { entity.BaseAggregateRoot AccountName string }
type AccountCreatedEvent ¶
type AccountCreatedEvent struct {
*event.BaseDomainEvent
}
func NewAccountCreatedEvent ¶
func NewAccountCreatedEvent(aggregateID uint, data interface{}) *AccountCreatedEvent
func (*AccountCreatedEvent) Name ¶
func (event *AccountCreatedEvent) Name() string
type AccountCreatedEventHandler ¶
type AccountCreatedEventHandler struct {
// contains filtered or unexported fields
}
AccountCreatedEventHandler triggered once new account created
func NewAccountCreatedEventHandler ¶
func NewAccountCreatedEventHandler(accountRepo *AccountRepository) *AccountCreatedEventHandler
func (*AccountCreatedEventHandler) Notify ¶
func (handler *AccountCreatedEventHandler) Notify(event event.IBaseDomainEvent) error
type AccountRepository ¶
type AccountRepository struct {
// contains filtered or unexported fields
}
func NewAccountRepository ¶
func NewAccountRepository(pg *pgxpool.Pool) *AccountRepository
func (*AccountRepository) Create ¶
func (repo *AccountRepository) Create(account Account) (*persistence.ResultRowId, error)
Create creates new account
func (*AccountRepository) FindById ¶
func (repo *AccountRepository) FindById(id uint) (*Account, error)
FindById query account by it's identity
func (*AccountRepository) GetAll ¶
func (repo *AccountRepository) GetAll() ([]*Account, error)
GetAll returns all accounts in the table
type EmailRepository ¶
type EmailRepository struct {
// contains filtered or unexported fields
}
func NewEmailRepository ¶
func NewEmailRepository(pg *pgxpool.Pool) *EmailRepository
func (*EmailRepository) Create ¶
func (repo *EmailRepository) Create(email SampleEmail) (*persistence.ResultRowId, error)
Create creates new email
type SampleEmail ¶
type SampleEmail struct { entity.BaseEntity Mail string }
Click to show internal directories.
Click to hide internal directories.