2023-04-13 00:07:08 +02:00
|
|
|
// Code generated by ent, DO NOT EDIT.
|
|
|
|
|
|
|
|
package ent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2023-08-19 04:52:15 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/agekey"
|
2023-04-21 13:57:32 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/hibp"
|
2023-08-19 04:52:15 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/localbreach"
|
2023-04-13 00:07:08 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/schema"
|
2023-08-19 04:52:15 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/searchquery"
|
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/settings"
|
2023-05-05 22:52:59 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/setup"
|
2023-08-19 04:52:15 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/trackedbreaches"
|
2023-04-13 00:07:08 +02:00
|
|
|
"git.dotya.ml/mirre-mt/pcmt/ent/user"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 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() {
|
2023-08-19 04:52:15 +02:00
|
|
|
agekeyFields := schema.AgeKey{}.Fields()
|
|
|
|
_ = agekeyFields
|
|
|
|
// agekeyDescKey is the schema descriptor for key field.
|
|
|
|
agekeyDescKey := agekeyFields[1].Descriptor()
|
|
|
|
// agekey.KeyValidator is a validator for the "key" field. It is called by the builders before save.
|
|
|
|
agekey.KeyValidator = agekeyDescKey.Validators[0].(func([]byte) error)
|
|
|
|
// agekeyDescCreated is the schema descriptor for created field.
|
|
|
|
agekeyDescCreated := agekeyFields[2].Descriptor()
|
|
|
|
// agekey.DefaultCreated holds the default value on creation for the created field.
|
|
|
|
agekey.DefaultCreated = agekeyDescCreated.Default.(func() time.Time)
|
|
|
|
// agekeyDescUpdated is the schema descriptor for updated field.
|
|
|
|
agekeyDescUpdated := agekeyFields[3].Descriptor()
|
|
|
|
// agekey.DefaultUpdated holds the default value on creation for the updated field.
|
|
|
|
agekey.DefaultUpdated = agekeyDescUpdated.Default.(func() time.Time)
|
|
|
|
// agekeyDescID is the schema descriptor for id field.
|
|
|
|
agekeyDescID := agekeyFields[0].Descriptor()
|
|
|
|
// agekey.DefaultID holds the default value on creation for the id field.
|
|
|
|
agekey.DefaultID = agekeyDescID.Default.(func() uuid.UUID)
|
2023-04-21 13:57:32 +02:00
|
|
|
hibpFields := schema.HIBP{}.Fields()
|
|
|
|
_ = hibpFields
|
2023-08-20 23:16:12 +02:00
|
|
|
// hibpDescName is the schema descriptor for name field.
|
|
|
|
hibpDescName := hibpFields[1].Descriptor()
|
|
|
|
// hibp.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
|
|
hibp.NameValidator = hibpDescName.Validators[0].(func(string) error)
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibpDescIsVerified is the schema descriptor for is_verified field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsVerified := hibpFields[10].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsVerified holds the default value on creation for the is_verified field.
|
|
|
|
hibp.DefaultIsVerified = hibpDescIsVerified.Default.(bool)
|
|
|
|
// hibpDescIsFabricated is the schema descriptor for is_fabricated field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsFabricated := hibpFields[11].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsFabricated holds the default value on creation for the is_fabricated field.
|
|
|
|
hibp.DefaultIsFabricated = hibpDescIsFabricated.Default.(bool)
|
|
|
|
// hibpDescIsSensitive is the schema descriptor for is_sensitive field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsSensitive := hibpFields[12].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsSensitive holds the default value on creation for the is_sensitive field.
|
|
|
|
hibp.DefaultIsSensitive = hibpDescIsSensitive.Default.(bool)
|
|
|
|
// hibpDescIsRetired is the schema descriptor for is_retired field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsRetired := hibpFields[13].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsRetired holds the default value on creation for the is_retired field.
|
|
|
|
hibp.DefaultIsRetired = hibpDescIsRetired.Default.(bool)
|
|
|
|
// hibpDescIsSpamList is the schema descriptor for is_spamList field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsSpamList := hibpFields[14].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsSpamList holds the default value on creation for the is_spamList field.
|
|
|
|
hibp.DefaultIsSpamList = hibpDescIsSpamList.Default.(bool)
|
|
|
|
// hibpDescIsMalware is the schema descriptor for is_malware field.
|
2023-08-20 23:16:12 +02:00
|
|
|
hibpDescIsMalware := hibpFields[15].Descriptor()
|
2023-04-21 13:57:32 +02:00
|
|
|
// hibp.DefaultIsMalware holds the default value on creation for the is_malware field.
|
|
|
|
hibp.DefaultIsMalware = hibpDescIsMalware.Default.(bool)
|
2023-08-24 18:43:24 +02:00
|
|
|
// hibpDescID is the schema descriptor for id field.
|
|
|
|
hibpDescID := hibpFields[0].Descriptor()
|
|
|
|
// hibp.DefaultID holds the default value on creation for the id field.
|
|
|
|
hibp.DefaultID = hibpDescID.Default.(func() uuid.UUID)
|
2023-08-19 04:52:15 +02:00
|
|
|
localbreachFields := schema.LocalBreach{}.Fields()
|
|
|
|
_ = localbreachFields
|
|
|
|
// localbreachDescName is the schema descriptor for name field.
|
|
|
|
localbreachDescName := localbreachFields[1].Descriptor()
|
|
|
|
// localbreach.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
|
|
localbreach.NameValidator = localbreachDescName.Validators[0].(func(string) error)
|
|
|
|
// localbreachDescDate is the schema descriptor for date field.
|
|
|
|
localbreachDescDate := localbreachFields[2].Descriptor()
|
|
|
|
// localbreach.DefaultDate holds the default value on creation for the date field.
|
|
|
|
localbreach.DefaultDate = localbreachDescDate.Default.(time.Time)
|
|
|
|
// localbreachDescCreatedAt is the schema descriptor for created_at field.
|
2023-08-20 05:20:33 +02:00
|
|
|
localbreachDescCreatedAt := localbreachFields[13].Descriptor()
|
2023-08-19 04:52:15 +02:00
|
|
|
// localbreach.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
|
|
localbreach.DefaultCreatedAt = localbreachDescCreatedAt.Default.(time.Time)
|
|
|
|
// localbreachDescID is the schema descriptor for id field.
|
|
|
|
localbreachDescID := localbreachFields[0].Descriptor()
|
|
|
|
// localbreach.DefaultID holds the default value on creation for the id field.
|
|
|
|
localbreach.DefaultID = localbreachDescID.Default.(func() uuid.UUID)
|
|
|
|
searchqueryFields := schema.SearchQuery{}.Fields()
|
|
|
|
_ = searchqueryFields
|
|
|
|
// searchqueryDescQuery is the schema descriptor for query field.
|
|
|
|
searchqueryDescQuery := searchqueryFields[1].Descriptor()
|
|
|
|
// searchquery.QueryValidator is a validator for the "query" field. It is called by the builders before save.
|
|
|
|
searchquery.QueryValidator = searchqueryDescQuery.Validators[0].(func(string) error)
|
|
|
|
// searchqueryDescCreated is the schema descriptor for created field.
|
|
|
|
searchqueryDescCreated := searchqueryFields[2].Descriptor()
|
|
|
|
// searchquery.DefaultCreated holds the default value on creation for the created field.
|
|
|
|
searchquery.DefaultCreated = searchqueryDescCreated.Default.(func() time.Time)
|
|
|
|
// searchqueryDescID is the schema descriptor for id field.
|
|
|
|
searchqueryDescID := searchqueryFields[0].Descriptor()
|
|
|
|
// searchquery.DefaultID holds the default value on creation for the id field.
|
|
|
|
searchquery.DefaultID = searchqueryDescID.Default.(func() uuid.UUID)
|
|
|
|
settingsFields := schema.Settings{}.Fields()
|
|
|
|
_ = settingsFields
|
|
|
|
// settingsDescSearches is the schema descriptor for searches field.
|
|
|
|
settingsDescSearches := settingsFields[3].Descriptor()
|
|
|
|
// settings.DefaultSearches holds the default value on creation for the searches field.
|
|
|
|
settings.DefaultSearches = settingsDescSearches.Default.(uint64)
|
|
|
|
// settingsDescID is the schema descriptor for id field.
|
|
|
|
settingsDescID := settingsFields[0].Descriptor()
|
|
|
|
// settings.DefaultID holds the default value on creation for the id field.
|
|
|
|
settings.DefaultID = settingsDescID.Default.(func() uuid.UUID)
|
2023-05-05 22:52:59 +02:00
|
|
|
setupFields := schema.Setup{}.Fields()
|
|
|
|
_ = setupFields
|
|
|
|
// setupDescSetUpAt is the schema descriptor for set_up_at field.
|
|
|
|
setupDescSetUpAt := setupFields[1].Descriptor()
|
|
|
|
// setup.DefaultSetUpAt holds the default value on creation for the set_up_at field.
|
|
|
|
setup.DefaultSetUpAt = setupDescSetUpAt.Default.(func() time.Time)
|
|
|
|
// setupDescID is the schema descriptor for id field.
|
|
|
|
setupDescID := setupFields[0].Descriptor()
|
|
|
|
// setup.DefaultID holds the default value on creation for the id field.
|
|
|
|
setup.DefaultID = setupDescID.Default.(func() uuid.UUID)
|
2023-08-19 04:52:15 +02:00
|
|
|
trackedbreachesFields := schema.TrackedBreaches{}.Fields()
|
|
|
|
_ = trackedbreachesFields
|
|
|
|
// trackedbreachesDescOnline is the schema descriptor for online field.
|
|
|
|
trackedbreachesDescOnline := trackedbreachesFields[2].Descriptor()
|
|
|
|
// trackedbreaches.DefaultOnline holds the default value on creation for the online field.
|
|
|
|
trackedbreaches.DefaultOnline = trackedbreachesDescOnline.Default.(bool)
|
|
|
|
// trackedbreachesDescID is the schema descriptor for id field.
|
|
|
|
trackedbreachesDescID := trackedbreachesFields[0].Descriptor()
|
|
|
|
// trackedbreaches.DefaultID holds the default value on creation for the id field.
|
|
|
|
trackedbreaches.DefaultID = trackedbreachesDescID.Default.(func() uuid.UUID)
|
2023-04-13 00:07:08 +02:00
|
|
|
userFields := schema.User{}.Fields()
|
|
|
|
_ = userFields
|
|
|
|
// userDescUsername is the schema descriptor for username field.
|
|
|
|
userDescUsername := userFields[1].Descriptor()
|
|
|
|
// user.UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
2023-08-19 04:52:15 +02:00
|
|
|
user.UsernameValidator = func() func(string) error {
|
|
|
|
validators := userDescUsername.Validators
|
|
|
|
fns := [...]func(string) error{
|
|
|
|
validators[0].(func(string) error),
|
|
|
|
validators[1].(func(string) error),
|
|
|
|
validators[2].(func(string) error),
|
|
|
|
}
|
|
|
|
return func(username string) error {
|
|
|
|
for _, fn := range fns {
|
|
|
|
if err := fn(username); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}()
|
2023-05-01 22:48:11 +02:00
|
|
|
// 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.
|
2023-08-19 04:52:15 +02:00
|
|
|
user.EmailValidator = func() func(string) error {
|
|
|
|
validators := userDescEmail.Validators
|
|
|
|
fns := [...]func(string) error{
|
|
|
|
validators[0].(func(string) error),
|
|
|
|
validators[1].(func(string) error),
|
|
|
|
}
|
|
|
|
return func(email string) error {
|
|
|
|
for _, fn := range fns {
|
|
|
|
if err := fn(email); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}()
|
2023-04-13 00:07:08 +02:00
|
|
|
// userDescPassword is the schema descriptor for password field.
|
2023-05-01 22:48:11 +02:00
|
|
|
userDescPassword := userFields[3].Descriptor()
|
2023-04-13 00:07:08 +02:00
|
|
|
// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
|
2023-05-03 06:30:12 +02:00
|
|
|
user.PasswordValidator = userDescPassword.Validators[0].(func([]byte) error)
|
2023-04-13 00:07:08 +02:00
|
|
|
// userDescIsAdmin is the schema descriptor for is_admin field.
|
2023-05-01 22:48:11 +02:00
|
|
|
userDescIsAdmin := userFields[4].Descriptor()
|
2023-04-13 00:07:08 +02:00
|
|
|
// user.DefaultIsAdmin holds the default value on creation for the is_admin field.
|
|
|
|
user.DefaultIsAdmin = userDescIsAdmin.Default.(bool)
|
|
|
|
// userDescIsActive is the schema descriptor for is_active field.
|
2023-05-01 22:48:11 +02:00
|
|
|
userDescIsActive := userFields[5].Descriptor()
|
2023-04-13 00:07:08 +02:00
|
|
|
// user.DefaultIsActive holds the default value on creation for the is_active field.
|
|
|
|
user.DefaultIsActive = userDescIsActive.Default.(bool)
|
|
|
|
// userDescCreatedAt is the schema descriptor for created_at field.
|
2023-05-01 22:48:11 +02:00
|
|
|
userDescCreatedAt := userFields[6].Descriptor()
|
2023-04-13 00:07:08 +02:00
|
|
|
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
|
|
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
|
|
|
|
// userDescUpdatedAt is the schema descriptor for updated_at field.
|
2023-05-01 22:48:11 +02:00
|
|
|
userDescUpdatedAt := userFields[7].Descriptor()
|
2023-04-13 00:07:08 +02:00
|
|
|
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
|
|
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
|
|
|
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
|
|
|
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
|
2023-08-10 19:27:14 +02:00
|
|
|
// userDescLastLogin is the schema descriptor for last_login field.
|
|
|
|
userDescLastLogin := userFields[8].Descriptor()
|
|
|
|
// user.DefaultLastLogin holds the default value on creation for the last_login field.
|
|
|
|
user.DefaultLastLogin = userDescLastLogin.Default.(time.Time)
|
2023-04-13 00:07:08 +02:00
|
|
|
// 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)
|
|
|
|
}
|