Documentation ¶
Index ¶
Constants ¶
View Source
const UserCreatedEventType event.Type = "events.user.created"
Variables ¶
View Source
var ErrInvalidUserId = errors.New("invalid User ID")
Sentinel error
Functions ¶
This section is empty.
Types ¶
type GetUsersDto ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
Domain entity (data structure that represents a user)
func (User) GetPassword ¶
func (User) GetSurname ¶
func (User) PullEvents ¶
Returns all the recorded domain events
type UserCreatedEvent ¶
type UserCreatedEvent struct { // Composition event.BaseEvent // contains filtered or unexported fields }
func NewUserCreatedEvent ¶
func NewUserCreatedEvent(id, name, surname, password, email string) UserCreatedEvent
func (UserCreatedEvent) Type ¶
func (e UserCreatedEvent) Type() event.Type
func (UserCreatedEvent) UserEmail ¶
func (e UserCreatedEvent) UserEmail() string
func (UserCreatedEvent) UserID ¶
func (e UserCreatedEvent) UserID() string
func (UserCreatedEvent) UserName ¶
func (e UserCreatedEvent) UserName() string
func (UserCreatedEvent) UserPassword ¶
func (e UserCreatedEvent) UserPassword() string
func (UserCreatedEvent) UserSurname ¶
func (e UserCreatedEvent) UserSurname() string
type UserId ¶
type UserId struct {
// contains filtered or unexported fields
}
Value objects strategy
type UserRepository ¶
type UserRepository interface { Save(ctx context.Context, user User) error FindAll(ctx context.Context) ([]GetUsersDto, error) }
Domain repository interface
Click to show internal directories.
Click to hide internal directories.