Documentation
¶
Index ¶
- type Blacklist
- type BlacklistModel
- type User
- type UserModel
- func (u *UserModel) Find() (list []User, err error)
- func (u *UserModel) GetUserByEmail(email string) (user User, err error)
- func (u *UserModel) GetUserByEmailCount(email string) (user User, err error)
- func (u *UserModel) GetUserByUserID(userID string) (user User, err error)
- func (u *UserModel) Login(email string) (user User, err error)
- func (u *UserModel) PasswordUpdate(email string, hashedPassword string) (user User, err error)
- func (u *UserModel) Signup(data forms.SignupUserCommand) error
- func (u *UserModel) VerifyAccount(email string) (user User, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blacklist ¶
type Blacklist struct {
ID bson.ObjectId `json:"_id,omitempty" bson:"_id,omitempty"`
Token string `json:"token" bson:"token"`
}
Blacklist defines token blacklist structure
type BlacklistModel ¶
type BlacklistModel struct{}
BlacklistModel defines balclist model
func (*BlacklistModel) Add ¶
func (b *BlacklistModel) Add(token string) (err error)
Add handle adding token to blacklist
type User ¶
type User struct {
ID bson.ObjectId `json:"_id,omitempty" bson:"_id,omitempty"`
Name string `json:"name" bson:"name"`
Email string `json:"email" bson:"email"`
Password string `json:"password" bson:"password"`
Role string `json:"role" bson:"role"`
IsVerified bool `json:"is_verified" bson:"is_verified"`
CreatedAt bson.MongoTimestamp `json:"created_at" bson:"created_at"`
UpdatedAt bson.MongoTimestamp `json:"updated_at" bson:"updated_at"`
}
User defines user structure
type UserModel ¶
type UserModel struct{}
UserModel defines the model structure
func (*UserModel) GetUserByEmail ¶
GetUserByEmail handle getting a single user
func (*UserModel) GetUserByEmailCount ¶
GetUserByEmailCount handle getting a single user
func (*UserModel) GetUserByUserID ¶
GetUserByUserID handle getting a user by userid
func (*UserModel) PasswordUpdate ¶
PasswordUpdate handle updating user password
Click to show internal directories.
Click to hide internal directories.