Documentation ¶
Index ¶
- Variables
- func NewUserActivatedEvent(u *User, status Status) events.DomainEvent
- func NewUserRegisteredEvent(u *User) events.DomainEvent
- func NewUserSocialAccountAddedEvent(u *User, account *SocialAccount) events.DomainEvent
- type Event
- type EventName
- type Repository
- type SocialAccount
- type SocialID
- type SocialProvider
- type Status
- type Token
- type User
- type UserActivatedEvent
- type UserID
- type UserRegisteredEvent
- type UserSocialAccountAddedEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUserNotFound = errors.New("user not found")
)
Functions ¶
func NewUserActivatedEvent ¶
func NewUserActivatedEvent(u *User, status Status) events.DomainEvent
func NewUserRegisteredEvent ¶
func NewUserRegisteredEvent(u *User) events.DomainEvent
func NewUserSocialAccountAddedEvent ¶
func NewUserSocialAccountAddedEvent(u *User, account *SocialAccount) events.DomainEvent
Types ¶
type Event ¶
type EventName ¶
type EventName int
func ParseEventName ¶
func (*EventName) MarshalJSON ¶ added in v1.0.3
type Repository ¶
type SocialAccount ¶
type SocialAccount struct { SocialID SocialID `json:"social_id"` Provider SocialProvider `json:"social_provider"` model.Model }
func NewSocialAccount ¶
func NewSocialAccount(provider SocialProvider, id SocialID) *SocialAccount
type SocialProvider ¶
type SocialProvider string
const ( GOOGLE SocialProvider = "google" FACEBOOK SocialProvider = "facebook" LINE SocialProvider = "line" )
type User ¶
type User struct { ID UserID `json:"id"` Username string `json:"username"` Name string `json:"name"` Email string `json:"email"` Status Status `json:"status"` Accounts []*SocialAccount `json:"accounts"` Avatar string `json:"avatar"` Token Token `json:"token"` model.Model events.EventStore `json:"-"` }
func (*User) AddSocialAccount ¶
func (u *User) AddSocialAccount(provider SocialProvider, socialID SocialID)
type UserActivatedEvent ¶
type UserID ¶
type UserID ulid.ULID // AggregateRoot
func (*UserID) MarshalJSON ¶
func (*UserID) UnmarshalJSON ¶
type UserRegisteredEvent ¶
type UserSocialAccountAddedEvent ¶
type UserSocialAccountAddedEvent struct { *Event Account *SocialAccount `json:"account"` }
Click to show internal directories.
Click to hide internal directories.