mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-16 21:58:40 +00:00
65 lines
2.3 KiB
Go
65 lines
2.3 KiB
Go
// Code generated by entc, DO NOT EDIT.
|
|
|
|
package user
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the user type in the database.
|
|
Label = "user"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// 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"
|
|
// FieldIsSuperuser holds the string denoting the is_superuser field in the database.
|
|
FieldIsSuperuser = "is_superuser"
|
|
// EdgeAuthTokens holds the string denoting the auth_tokens edge name in mutations.
|
|
EdgeAuthTokens = "auth_tokens"
|
|
// Table holds the table name of the user in the database.
|
|
Table = "users"
|
|
// AuthTokensTable is the table that holds the auth_tokens relation/edge.
|
|
AuthTokensTable = "auth_tokens"
|
|
// AuthTokensInverseTable is the table name for the AuthTokens entity.
|
|
// It exists in this package in order to avoid circular dependency with the "authtokens" package.
|
|
AuthTokensInverseTable = "auth_tokens"
|
|
// AuthTokensColumn is the table column denoting the auth_tokens relation/edge.
|
|
AuthTokensColumn = "user_auth_tokens"
|
|
)
|
|
|
|
// Columns holds all SQL columns for user fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldName,
|
|
FieldEmail,
|
|
FieldPassword,
|
|
FieldIsSuperuser,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// 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
|
|
// DefaultIsSuperuser holds the default value on creation for the "is_superuser" field.
|
|
DefaultIsSuperuser bool
|
|
// DefaultID holds the default value on creation for the "id" field.
|
|
DefaultID func() uuid.UUID
|
|
)
|