Added email field to user.

This commit is contained in:
mikestefanello 2021-12-14 21:16:48 -05:00
parent dee7a13cba
commit 6ec1b77684
16 changed files with 410 additions and 139 deletions

View file

@ -11,8 +11,10 @@ const (
Label = "user"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldUsername holds the string denoting the username field in the database.
FieldUsername = "username"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldCreatedAt holds the string denoting the created_at field in the database.
@ -24,7 +26,8 @@ const (
// Columns holds all SQL columns for user fields.
var Columns = []string{
FieldID,
FieldUsername,
FieldName,
FieldEmail,
FieldPassword,
FieldCreatedAt,
}
@ -40,8 +43,10 @@ func ValidColumn(column string) bool {
}
var (
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
UsernameValidator func(string) error
// NameValidator is a validator for the "name" field. It is called by the builders before save.
NameValidator func(string) error
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
EmailValidator func(string) error
// PasswordValidator is a validator for the "password" field. It is called by the builders before save.
PasswordValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "created_at" field.