Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UserRole_Admin = &UserRole{Name: "Admin"} UserRole_Guest = &UserRole{Name: "Guest"} )
View Source
var ErrAlreadyExistRole = errors.New("ErrAlreadyExistRole")
Functions ¶
This section is empty.
Types ¶
type IUserRepository ¶
type IUserRepository interface { FindOneById(ctx context.Context, id primitive.ObjectID) (*User, error) FindOneByUsername(ctx context.Context, username string) (*User, error) Add(ctx context.Context, user *User) error Update(ctx context.Context, user *User) error }
func NewUserRepositoryResolve ¶
func NewUserRepositoryResolve(rabbitMQConfig rabbitmqv2.Config, mongoConfig mongo.Config) IUserRepository
type User ¶
type User struct { Id primitive.ObjectID `json:"id" bson:"_id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` UserName string `json:"user_name"` EncryptedPassword *aggregates.EncryptedPassword `json:"encrypted_password"` Roles []*UserRole `json:"roles"` // contains filtered or unexported fields }
func NewAdminUser ¶
func NewGuestUser ¶
func NewGuestUser() *User
func (*User) AddUserRole ¶
func (*User) ChangePassword ¶
func (*User) ClearDomainEvents ¶
func (u *User) ClearDomainEvents()
func (*User) GetDomainEvents ¶
func (u *User) GetDomainEvents() []ddd.IBaseEvent
func (*User) RaiseEvent ¶
func (u *User) RaiseEvent(event ddd.IBaseEvent)
type UserService ¶
type UserService interface { AddNewUser(ctx context.Context, firstName string, lastName string, userName string, password string) (*User, error) AddNewAdminUser(ctx context.Context, firstName string, lastName string, userName string, password string) (*User, error) AddNewGuestUser(ctx context.Context) (*User, error) GetUserById(ctx context.Context, id string) (*User, error) AuthUser(ctx context.Context, username, password string) (bool, error) }
func NewUserService ¶
func NewUserService(repository IUserRepository) UserService
func NewUserServiceResolve ¶
func NewUserServiceResolve(rabbitMQConfig rabbitmqv2.Config, mongoConfig mongo.Config) UserService
Click to show internal directories.
Click to hide internal directories.