Documentation
¶
Index ¶
- func CreateNew(newUser *User) error
- func IsEmailAlreadyInUse(email string) (bool, error)
- type User
- func (u *User) CollectionName() string
- func (u *User) GetBannedStatus() bool
- func (u *User) GetEmail() string
- func (u *User) GetFirstName() string
- func (u *User) GetLastName() string
- func (u *User) GetPassword() string
- func (u *User) SetBannedStatus(status bool)
- func (u *User) SetEmail(email string) error
- func (u *User) SetFirstName(firstName string) error
- func (u *User) SetLastName(lastName string) error
- func (u *User) SetPassword(password string) error
- func (u *User) String() string
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNew ¶
CreateNew inserts a new user into the collection Before inserting, checks if there is an already existing user with the same email
func IsEmailAlreadyInUse ¶
Types ¶
type User ¶
type User struct { mgm.DefaultModel `bson:",inline"` FirstName string `json:"first_name" bson:"first_name"` LastName string `json:"last_name" bson:"last_name"` Email string `json:"email" bson:"email"` Password string `json:"password" bson:"password"` IsBanned bool `json:"is_banned" bson:"is_banned"` }
func GetUserByID ¶
func (*User) CollectionName ¶
CollectionName returns the name of the collection in the database
func (*User) GetBannedStatus ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetPassword ¶
func (*User) SetBannedStatus ¶
func (*User) SetFirstName ¶
func (*User) SetLastName ¶
func (*User) SetPassword ¶
Click to show internal directories.
Click to hide internal directories.