Documentation ¶
Index ¶
Constants ¶
View Source
const ( //DB_NAME is the db name DB_NAME = "mydb" //USERS_COLLECTION_NAME is the name for the users collection USERS_COLLECTION_NAME = "users" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID string `bson:"_id,omitempty"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Email string `json:"email"` DateCreated string `json:"date_created"` Status string `json:"status"` Password string `json:"password"` }
User is the domain
func (*User) Save ¶
func (user *User) Save() api_errors.RestErr
Save save a new user to the users collections
func (*User) Validate ¶
func (user *User) Validate() api_errors.RestErr
Validate validates FirstName, LastName, Email and Password (only for trimspace)
Click to show internal directories.
Click to hide internal directories.