forked from mirrors/homebox
50 lines
2.5 KiB
Go
50 lines
2.5 KiB
Go
// Code generated by entc, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/hay-kot/git-web-template/backend/ent/authtokens"
|
|
"github.com/hay-kot/git-web-template/backend/ent/schema"
|
|
"github.com/hay-kot/git-web-template/backend/ent/user"
|
|
)
|
|
|
|
// The init function reads all schema descriptors with runtime code
|
|
// (default values, validators, hooks and policies) and stitches it
|
|
// to their package variables.
|
|
func init() {
|
|
authtokensFields := schema.AuthTokens{}.Fields()
|
|
_ = authtokensFields
|
|
// authtokensDescExpiresAt is the schema descriptor for expires_at field.
|
|
authtokensDescExpiresAt := authtokensFields[1].Descriptor()
|
|
// authtokens.DefaultExpiresAt holds the default value on creation for the expires_at field.
|
|
authtokens.DefaultExpiresAt = authtokensDescExpiresAt.Default.(func() time.Time)
|
|
// authtokensDescCreatedAt is the schema descriptor for created_at field.
|
|
authtokensDescCreatedAt := authtokensFields[2].Descriptor()
|
|
// authtokens.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
authtokens.DefaultCreatedAt = authtokensDescCreatedAt.Default.(func() time.Time)
|
|
userFields := schema.User{}.Fields()
|
|
_ = userFields
|
|
// userDescName is the schema descriptor for name field.
|
|
userDescName := userFields[1].Descriptor()
|
|
// user.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
user.NameValidator = userDescName.Validators[0].(func(string) error)
|
|
// userDescEmail is the schema descriptor for email field.
|
|
userDescEmail := userFields[2].Descriptor()
|
|
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
|
|
// userDescPassword is the schema descriptor for password field.
|
|
userDescPassword := userFields[3].Descriptor()
|
|
// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
|
|
user.PasswordValidator = userDescPassword.Validators[0].(func(string) error)
|
|
// userDescIsSuperuser is the schema descriptor for is_superuser field.
|
|
userDescIsSuperuser := userFields[4].Descriptor()
|
|
// user.DefaultIsSuperuser holds the default value on creation for the is_superuser field.
|
|
user.DefaultIsSuperuser = userDescIsSuperuser.Default.(bool)
|
|
// userDescID is the schema descriptor for id field.
|
|
userDescID := userFields[0].Descriptor()
|
|
// user.DefaultID holds the default value on creation for the id field.
|
|
user.DefaultID = userDescID.Default.(func() uuid.UUID)
|
|
}
|