Documentation
¶
Index ¶
- func AuthenticateUser(ctx context.Context, store store.Driver, email, password string) (*models.User, error)
- func CreateUser(ctx context.Context, store store.Driver, email string, roleID int) (models.User, error)
- func DeleteUser(ctx context.Context, store store.Driver, id string) error
- func GetAllUsers(ctx context.Context, store store.Driver) ([]*models.User, error)
- func GetUserByID(ctx context.Context, store store.Driver, id string) (*models.User, error)
- func RegisterUser(ctx context.Context, store store.Driver, id, username, password string) error
- type AuthCredentialMismatch
- type PasswordDoesNotMatchPolicy
- type UserDoesNotExist
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateUser ¶
func AuthenticateUser(ctx context.Context, store store.Driver, email, password string) (*models.User, error)
AuthenticateUser verifies whether the the user is valid
func CreateUser ¶
func CreateUser(ctx context.Context, store store.Driver, email string, roleID int) (models.User, error)
CreateUser creates a new user in the system
func DeleteUser ¶
DeleteUser deletes a user based on id
func GetAllUsers ¶
GetAllUsers gets all users in the system
func GetUserByID ¶
GetUserByID gets a user based on id
Types ¶
type AuthCredentialMismatch ¶
type AuthCredentialMismatch struct{}
AuthCredentialMismatch is the error returned whe nthe credentaisl provided and stored do not match
func (*AuthCredentialMismatch) Error ¶
func (a *AuthCredentialMismatch) Error() string
type PasswordDoesNotMatchPolicy ¶
type PasswordDoesNotMatchPolicy struct{}
PasswordDoesNotMatchPolicy is the error returned when the user password does not match password policy
func (*PasswordDoesNotMatchPolicy) Error ¶
func (p *PasswordDoesNotMatchPolicy) Error() string
type UserDoesNotExist ¶
type UserDoesNotExist struct{}
UserDoesNotExist is the error returned when the requested user does not exist in the system
func (*UserDoesNotExist) Error ¶
func (u *UserDoesNotExist) Error() string
Click to show internal directories.
Click to hide internal directories.