Documentation
¶
Index ¶
Constants ¶
View Source
const CollUserMG = _initName + "user"
CollUserMG is the exact MongoDB collection name for the user's collection.
Variables ¶
This section is empty.
Functions ¶
func CreateUserMG ¶
CreateUserMG creates a new user registration using MongoDB.
func NewTimaanToken ¶
NewTimaanToken creates a new timaan token and returns with a new token the 'expireOn' int64 must use the unix time e.g time.Now().Add(time.Minute * 30).Unix()
Types ¶
type Config ¶
type Config struct {
TimeZone string
// contains filtered or unexported fields
}
Config list of common config variables
var CF *Config
CF short hand for 'Config' struct
type MGCon ¶
type MGCon struct {
ConStr, DBName, CollName, TimeZone string
ClientMG *itrmg.MGC
// contains filtered or unexported fields
}
MGCon collects the MongoDB connection information
type UserMG ¶
type UserMG struct {
ID itrmg.ObjID `json:"_id,omitempty" bson:"_id,omitempty"`
UserName string `json:"username,omitempty" bson:"username,omitempty"`
Password string `json:"password" bson:"password,omitempty"`
Email string `json:"email,omitempty" bson:"email,omitempty"`
FirstName string `json:"first_name,omitempty" bson:"first_name,omitempty"`
MiddleName string `json:"middle_name,omitempty" bson:"middle_name,omitempty"`
LastName string `json:"last_name,omitempty" bson:"last_name,omitempty"`
Suffix string `json:"suffix,omitempty" bson:"suffix,omitempty"`
Gender string `json:"gender,omitempty" bson:"gender,omitempty"`
DOB int64 `json:"dob,omitempty" bson:"dob,omitempty"`
About string `json:"about,omitempty" bson:"about,omitempty"`
URL string `json:"url,omitempty" bson:"url,omitempty"`
IsSuperUser bool `json:"is_superuser,omitempty" bson:"is_superuser,omitempty"`
IsAdmin bool `json:"is_admin,omitempty" bson:"is_admin,omitempty"`
LastLogin int64 `json:"last_login,omitempty" bson:"last_login,omitempty"`
DateJoined int64 `json:"date_joined,omitempty" bson:"date_joined,omitempty"`
IsActive bool `json:"is_active,omitempty" bson:"is_active,omitempty"`
}
UserMG is a MongoDB user model
Click to show internal directories.
Click to hide internal directories.
The yabi package is a complete user's authentication system for your next Go's project, from user's registration, password reset, login, logout, timaan token, and automatic email notifications and many more. Currently supported database is MongoDB, in the future, there will be more supported databases.