Documentation ¶
Index ¶
- type User
- func (u *User) Email() string
- func (u *User) GetDomainEventPayload() UserDomainEvent
- func (u *User) HasVerifiedEmail() bool
- func (u *User) IsActive() bool
- func (u *User) IsValid() bool
- func (u *User) LoadDomainEventObject(p []byte) (UserDomainEvent, error)
- func (u *User) Location() model.Location
- func (u *User) SetEmail(email string) error
- func (u *User) SetHasVerifiedEmail(b bool)
- func (u *User) SetIsActive(b bool)
- func (u *User) SetLocation(nl model.Location)
- func (u *User) SetToken(tk model.Token)
- func (u *User) SetUser(nu model.User)
- func (u *User) Token() model.Token
- func (u *User) User() model.User
- func (u *User) UserId() uuid.UUID
- type UserDomainEvent
- type UserEmailView
- type UserTokenView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
User aggregate with User as it's root entity
func NewUser ¶
func NewUser() User
NewUser creates a new user with an auto generated uuid and limited role
func (*User) GetDomainEventPayload ¶
func (u *User) GetDomainEventPayload() UserDomainEvent
GetAggregateEventPayload returns a representation of the aggregate for event processing
func (*User) HasVerifiedEmail ¶
HasVerifiedEmail gets the user has verified email flag
func (*User) LoadDomainEventObject ¶
func (u *User) LoadDomainEventObject(p []byte) (UserDomainEvent, error)
LoadDomainEventObject unmarshal a byte array and returns UserDomainEvent if successful
func (*User) SetHasVerifiedEmail ¶
SetHasVerifiedEmail sets the user has verified email flag
func (*User) SetIsActive ¶
SetIsActive sets the user is active flag
func (*User) SetLocation ¶
SetLocation sets the user role
type UserDomainEvent ¶
type UserDomainEvent struct { ID uuid.UUID `json:"ID"` FirstName string `json:"FirstName"` LastName string `json:"LastName"` Email string `json:"Email"` IsActive bool `json:"IsActive"` HasVerifiedEmail bool `json:"HasVerifiedEmail"` }
UserDomainEvent represents the domain event for the User aggregate
type UserEmailView ¶
type UserEmailView struct {
// contains filtered or unexported fields
}
UserEmailView is a snapshot of email information for user aggregate for read-only purposes
func NewUserEmailView ¶
func NewUserEmailView(id uuid.UUID, email string, hasVerifiedEmail bool) UserEmailView
func (UserEmailView) Email ¶
func (uev UserEmailView) Email() string
func (UserEmailView) Id ¶
func (uev UserEmailView) Id() uuid.UUID
func (UserEmailView) IsEmailVerified ¶
func (uev UserEmailView) IsEmailVerified() bool
type UserTokenView ¶
type UserTokenView struct {
// contains filtered or unexported fields
}
UserTokenView is a snapshot of tokens for user aggregate for read-only purposes
func NewUserTokenView ¶
func NewUserTokenView(id uuid.UUID, vt, vs string) UserTokenView
func (UserTokenView) VerificationSalt ¶
func (utv UserTokenView) VerificationSalt() string
func (UserTokenView) VerificationToken ¶
func (utv UserTokenView) VerificationToken() string