Documentation ¶
Index ¶
Constants ¶
View Source
const ( UserErrorUsernameEmptyCode = iota UserErrorInvalidUsernameLengthCode UserErrorPasswordEmptyCode UserErrorWrongPasswordCode UserErrorUsernameExistsCode UserErrorPasswordConfirmationNotMatchCode UserChangePasswordErrorWrongOldPasswordCode )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordChanged ¶
type User ¶
type User struct { UID uuid.UUID Username string Password []byte ClientID string CreatedDate time.Time LastUpdated time.Time // Events Version int UncommittedChanges []interface{} }
func CreateUser ¶
func CreateUser(userService UserService, username, password, confirmPassword string) (*User, error)
func (*User) ChangePassword ¶
func (*User) TrackChange ¶
func (u *User) TrackChange(event interface{})
func (*User) Transition ¶
func (u *User) Transition(event interface{})
type UserCreated ¶
type UserError ¶
type UserError struct {
Code int
}
UserError is a custom error from Go built-in error
type UserService ¶
type UserService interface {
FindUserByUsername(username string) (UserServiceResult, error)
}
type UserServiceResult ¶
Click to show internal directories.
Click to hide internal directories.