account

package
v0.0.0-...-ee0a0c7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 8 Imported by: 0

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
}

func (*Account) ScanRow

func (s *Account) ScanRow(row pgx.Row) error

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
}

Jump to

Keyboard shortcuts

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