Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB gorm.DB
Global DB connection
Functions ¶
func ValidateUser ¶
func ValidateUser(id, email, password string) (e []validate.ValidationMsg)
ValidateUser validates user models
Types ¶
type User ¶
type User struct { ID string `sql:"not null;unique" json:"id"` Email string `sql:"not null;unique" json:"email"` Password string `sql:"not null" json:"-"` }
User is the structure of the user model.
func NewUser ¶
func NewUser(email, password string) (*User, []validate.ValidationMsg, error)
NewUser creates a new user object if it is valid.
Click to show internal directories.
Click to hide internal directories.