58 lines
2.3 KiB
Go
58 lines
2.3 KiB
Go
|
// Code generated by ent, DO NOT EDIT.
|
||
|
|
||
|
package ent
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"code.icod.de/auth/accountserver/ent/account"
|
||
|
"code.icod.de/auth/accountserver/ent/email"
|
||
|
"code.icod.de/auth/accountserver/ent/schema"
|
||
|
)
|
||
|
|
||
|
// 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() {
|
||
|
accountFields := schema.Account{}.Fields()
|
||
|
_ = accountFields
|
||
|
// accountDescCreatedAt is the schema descriptor for created_at field.
|
||
|
accountDescCreatedAt := accountFields[1].Descriptor()
|
||
|
// account.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||
|
account.DefaultCreatedAt = accountDescCreatedAt.Default.(func() time.Time)
|
||
|
// accountDescUpdatedAt is the schema descriptor for updated_at field.
|
||
|
accountDescUpdatedAt := accountFields[2].Descriptor()
|
||
|
// account.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||
|
account.DefaultUpdatedAt = accountDescUpdatedAt.Default.(func() time.Time)
|
||
|
// account.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||
|
account.UpdateDefaultUpdatedAt = accountDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||
|
// accountDescAes is the schema descriptor for aes field.
|
||
|
accountDescAes := accountFields[6].Descriptor()
|
||
|
// account.AesValidator is a validator for the "aes" field. It is called by the builders before save.
|
||
|
account.AesValidator = func() func([]byte) error {
|
||
|
validators := accountDescAes.Validators
|
||
|
fns := [...]func([]byte) error{
|
||
|
validators[0].(func([]byte) error),
|
||
|
validators[1].(func([]byte) error),
|
||
|
}
|
||
|
return func(aes []byte) error {
|
||
|
for _, fn := range fns {
|
||
|
if err := fn(aes); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
}()
|
||
|
emailFields := schema.Email{}.Fields()
|
||
|
_ = emailFields
|
||
|
// emailDescPrimary is the schema descriptor for primary field.
|
||
|
emailDescPrimary := emailFields[2].Descriptor()
|
||
|
// email.DefaultPrimary holds the default value on creation for the primary field.
|
||
|
email.DefaultPrimary = emailDescPrimary.Default.(bool)
|
||
|
// emailDescVerified is the schema descriptor for verified field.
|
||
|
emailDescVerified := emailFields[3].Descriptor()
|
||
|
// email.DefaultVerified holds the default value on creation for the verified field.
|
||
|
email.DefaultVerified = emailDescVerified.Default.(bool)
|
||
|
}
|