261 lines
13 KiB
Go
261 lines
13 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package runtime
|
|
|
|
import (
|
|
"voidraft/internal/models/ent/document"
|
|
"voidraft/internal/models/ent/extension"
|
|
"voidraft/internal/models/ent/keybinding"
|
|
"voidraft/internal/models/ent/theme"
|
|
"voidraft/internal/models/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() {
|
|
documentMixin := schema.Document{}.Mixin()
|
|
documentMixinHooks1 := documentMixin[1].Hooks()
|
|
documentMixinHooks2 := documentMixin[2].Hooks()
|
|
document.Hooks[0] = documentMixinHooks1[0]
|
|
document.Hooks[1] = documentMixinHooks2[0]
|
|
documentMixinInters2 := documentMixin[2].Interceptors()
|
|
document.Interceptors[0] = documentMixinInters2[0]
|
|
documentMixinFields0 := documentMixin[0].Fields()
|
|
_ = documentMixinFields0
|
|
documentMixinFields1 := documentMixin[1].Fields()
|
|
_ = documentMixinFields1
|
|
documentFields := schema.Document{}.Fields()
|
|
_ = documentFields
|
|
// documentDescUUID is the schema descriptor for uuid field.
|
|
documentDescUUID := documentMixinFields0[0].Descriptor()
|
|
// document.DefaultUUID holds the default value on creation for the uuid field.
|
|
document.DefaultUUID = documentDescUUID.Default.(func() string)
|
|
// documentDescCreatedAt is the schema descriptor for created_at field.
|
|
documentDescCreatedAt := documentMixinFields1[0].Descriptor()
|
|
// document.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
document.DefaultCreatedAt = documentDescCreatedAt.Default.(func() string)
|
|
// documentDescUpdatedAt is the schema descriptor for updated_at field.
|
|
documentDescUpdatedAt := documentMixinFields1[1].Descriptor()
|
|
// document.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
document.DefaultUpdatedAt = documentDescUpdatedAt.Default.(func() string)
|
|
// documentDescTitle is the schema descriptor for title field.
|
|
documentDescTitle := documentFields[0].Descriptor()
|
|
// document.TitleValidator is a validator for the "title" field. It is called by the builders before save.
|
|
document.TitleValidator = func() func(string) error {
|
|
validators := documentDescTitle.Validators
|
|
fns := [...]func(string) error{
|
|
validators[0].(func(string) error),
|
|
validators[1].(func(string) error),
|
|
}
|
|
return func(title string) error {
|
|
for _, fn := range fns {
|
|
if err := fn(title); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}()
|
|
// documentDescContent is the schema descriptor for content field.
|
|
documentDescContent := documentFields[1].Descriptor()
|
|
// document.DefaultContent holds the default value on creation for the content field.
|
|
document.DefaultContent = documentDescContent.Default.(string)
|
|
// documentDescLocked is the schema descriptor for locked field.
|
|
documentDescLocked := documentFields[2].Descriptor()
|
|
// document.DefaultLocked holds the default value on creation for the locked field.
|
|
document.DefaultLocked = documentDescLocked.Default.(bool)
|
|
extensionMixin := schema.Extension{}.Mixin()
|
|
extensionMixinHooks1 := extensionMixin[1].Hooks()
|
|
extensionMixinHooks2 := extensionMixin[2].Hooks()
|
|
extension.Hooks[0] = extensionMixinHooks1[0]
|
|
extension.Hooks[1] = extensionMixinHooks2[0]
|
|
extensionMixinInters2 := extensionMixin[2].Interceptors()
|
|
extension.Interceptors[0] = extensionMixinInters2[0]
|
|
extensionMixinFields0 := extensionMixin[0].Fields()
|
|
_ = extensionMixinFields0
|
|
extensionMixinFields1 := extensionMixin[1].Fields()
|
|
_ = extensionMixinFields1
|
|
extensionFields := schema.Extension{}.Fields()
|
|
_ = extensionFields
|
|
// extensionDescUUID is the schema descriptor for uuid field.
|
|
extensionDescUUID := extensionMixinFields0[0].Descriptor()
|
|
// extension.DefaultUUID holds the default value on creation for the uuid field.
|
|
extension.DefaultUUID = extensionDescUUID.Default.(func() string)
|
|
// extensionDescCreatedAt is the schema descriptor for created_at field.
|
|
extensionDescCreatedAt := extensionMixinFields1[0].Descriptor()
|
|
// extension.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
extension.DefaultCreatedAt = extensionDescCreatedAt.Default.(func() string)
|
|
// extensionDescUpdatedAt is the schema descriptor for updated_at field.
|
|
extensionDescUpdatedAt := extensionMixinFields1[1].Descriptor()
|
|
// extension.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
extension.DefaultUpdatedAt = extensionDescUpdatedAt.Default.(func() string)
|
|
// extensionDescName is the schema descriptor for name field.
|
|
extensionDescName := extensionFields[0].Descriptor()
|
|
// extension.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
extension.NameValidator = func() func(string) error {
|
|
validators := extensionDescName.Validators
|
|
fns := [...]func(string) error{
|
|
validators[0].(func(string) error),
|
|
validators[1].(func(string) error),
|
|
}
|
|
return func(name string) error {
|
|
for _, fn := range fns {
|
|
if err := fn(name); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}()
|
|
// extensionDescEnabled is the schema descriptor for enabled field.
|
|
extensionDescEnabled := extensionFields[1].Descriptor()
|
|
// extension.DefaultEnabled holds the default value on creation for the enabled field.
|
|
extension.DefaultEnabled = extensionDescEnabled.Default.(bool)
|
|
keybindingMixin := schema.KeyBinding{}.Mixin()
|
|
keybindingMixinHooks1 := keybindingMixin[1].Hooks()
|
|
keybindingMixinHooks2 := keybindingMixin[2].Hooks()
|
|
keybinding.Hooks[0] = keybindingMixinHooks1[0]
|
|
keybinding.Hooks[1] = keybindingMixinHooks2[0]
|
|
keybindingMixinInters2 := keybindingMixin[2].Interceptors()
|
|
keybinding.Interceptors[0] = keybindingMixinInters2[0]
|
|
keybindingMixinFields0 := keybindingMixin[0].Fields()
|
|
_ = keybindingMixinFields0
|
|
keybindingMixinFields1 := keybindingMixin[1].Fields()
|
|
_ = keybindingMixinFields1
|
|
keybindingFields := schema.KeyBinding{}.Fields()
|
|
_ = keybindingFields
|
|
// keybindingDescUUID is the schema descriptor for uuid field.
|
|
keybindingDescUUID := keybindingMixinFields0[0].Descriptor()
|
|
// keybinding.DefaultUUID holds the default value on creation for the uuid field.
|
|
keybinding.DefaultUUID = keybindingDescUUID.Default.(func() string)
|
|
// keybindingDescCreatedAt is the schema descriptor for created_at field.
|
|
keybindingDescCreatedAt := keybindingMixinFields1[0].Descriptor()
|
|
// keybinding.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
keybinding.DefaultCreatedAt = keybindingDescCreatedAt.Default.(func() string)
|
|
// keybindingDescUpdatedAt is the schema descriptor for updated_at field.
|
|
keybindingDescUpdatedAt := keybindingMixinFields1[1].Descriptor()
|
|
// keybinding.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
keybinding.DefaultUpdatedAt = keybindingDescUpdatedAt.Default.(func() string)
|
|
// keybindingDescName is the schema descriptor for name field.
|
|
keybindingDescName := keybindingFields[0].Descriptor()
|
|
// keybinding.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
keybinding.NameValidator = func() func(string) error {
|
|
validators := keybindingDescName.Validators
|
|
fns := [...]func(string) error{
|
|
validators[0].(func(string) error),
|
|
validators[1].(func(string) error),
|
|
}
|
|
return func(name string) error {
|
|
for _, fn := range fns {
|
|
if err := fn(name); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}()
|
|
// keybindingDescType is the schema descriptor for type field.
|
|
keybindingDescType := keybindingFields[1].Descriptor()
|
|
// keybinding.DefaultType holds the default value on creation for the type field.
|
|
keybinding.DefaultType = keybindingDescType.Default.(string)
|
|
// keybinding.TypeValidator is a validator for the "type" field. It is called by the builders before save.
|
|
keybinding.TypeValidator = keybindingDescType.Validators[0].(func(string) error)
|
|
// keybindingDescKey is the schema descriptor for key field.
|
|
keybindingDescKey := keybindingFields[2].Descriptor()
|
|
// keybinding.KeyValidator is a validator for the "key" field. It is called by the builders before save.
|
|
keybinding.KeyValidator = keybindingDescKey.Validators[0].(func(string) error)
|
|
// keybindingDescMacos is the schema descriptor for macos field.
|
|
keybindingDescMacos := keybindingFields[3].Descriptor()
|
|
// keybinding.MacosValidator is a validator for the "macos" field. It is called by the builders before save.
|
|
keybinding.MacosValidator = keybindingDescMacos.Validators[0].(func(string) error)
|
|
// keybindingDescWindows is the schema descriptor for windows field.
|
|
keybindingDescWindows := keybindingFields[4].Descriptor()
|
|
// keybinding.WindowsValidator is a validator for the "windows" field. It is called by the builders before save.
|
|
keybinding.WindowsValidator = keybindingDescWindows.Validators[0].(func(string) error)
|
|
// keybindingDescLinux is the schema descriptor for linux field.
|
|
keybindingDescLinux := keybindingFields[5].Descriptor()
|
|
// keybinding.LinuxValidator is a validator for the "linux" field. It is called by the builders before save.
|
|
keybinding.LinuxValidator = keybindingDescLinux.Validators[0].(func(string) error)
|
|
// keybindingDescExtension is the schema descriptor for extension field.
|
|
keybindingDescExtension := keybindingFields[6].Descriptor()
|
|
// keybinding.ExtensionValidator is a validator for the "extension" field. It is called by the builders before save.
|
|
keybinding.ExtensionValidator = func() func(string) error {
|
|
validators := keybindingDescExtension.Validators
|
|
fns := [...]func(string) error{
|
|
validators[0].(func(string) error),
|
|
validators[1].(func(string) error),
|
|
}
|
|
return func(extension string) error {
|
|
for _, fn := range fns {
|
|
if err := fn(extension); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}()
|
|
// keybindingDescEnabled is the schema descriptor for enabled field.
|
|
keybindingDescEnabled := keybindingFields[7].Descriptor()
|
|
// keybinding.DefaultEnabled holds the default value on creation for the enabled field.
|
|
keybinding.DefaultEnabled = keybindingDescEnabled.Default.(bool)
|
|
// keybindingDescPreventDefault is the schema descriptor for prevent_default field.
|
|
keybindingDescPreventDefault := keybindingFields[8].Descriptor()
|
|
// keybinding.DefaultPreventDefault holds the default value on creation for the prevent_default field.
|
|
keybinding.DefaultPreventDefault = keybindingDescPreventDefault.Default.(bool)
|
|
// keybindingDescScope is the schema descriptor for scope field.
|
|
keybindingDescScope := keybindingFields[9].Descriptor()
|
|
// keybinding.DefaultScope holds the default value on creation for the scope field.
|
|
keybinding.DefaultScope = keybindingDescScope.Default.(string)
|
|
// keybinding.ScopeValidator is a validator for the "scope" field. It is called by the builders before save.
|
|
keybinding.ScopeValidator = keybindingDescScope.Validators[0].(func(string) error)
|
|
themeMixin := schema.Theme{}.Mixin()
|
|
themeMixinHooks1 := themeMixin[1].Hooks()
|
|
themeMixinHooks2 := themeMixin[2].Hooks()
|
|
theme.Hooks[0] = themeMixinHooks1[0]
|
|
theme.Hooks[1] = themeMixinHooks2[0]
|
|
themeMixinInters2 := themeMixin[2].Interceptors()
|
|
theme.Interceptors[0] = themeMixinInters2[0]
|
|
themeMixinFields0 := themeMixin[0].Fields()
|
|
_ = themeMixinFields0
|
|
themeMixinFields1 := themeMixin[1].Fields()
|
|
_ = themeMixinFields1
|
|
themeFields := schema.Theme{}.Fields()
|
|
_ = themeFields
|
|
// themeDescUUID is the schema descriptor for uuid field.
|
|
themeDescUUID := themeMixinFields0[0].Descriptor()
|
|
// theme.DefaultUUID holds the default value on creation for the uuid field.
|
|
theme.DefaultUUID = themeDescUUID.Default.(func() string)
|
|
// themeDescCreatedAt is the schema descriptor for created_at field.
|
|
themeDescCreatedAt := themeMixinFields1[0].Descriptor()
|
|
// theme.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
theme.DefaultCreatedAt = themeDescCreatedAt.Default.(func() string)
|
|
// themeDescUpdatedAt is the schema descriptor for updated_at field.
|
|
themeDescUpdatedAt := themeMixinFields1[1].Descriptor()
|
|
// theme.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
theme.DefaultUpdatedAt = themeDescUpdatedAt.Default.(func() string)
|
|
// themeDescName is the schema descriptor for name field.
|
|
themeDescName := themeFields[0].Descriptor()
|
|
// theme.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
theme.NameValidator = func() func(string) error {
|
|
validators := themeDescName.Validators
|
|
fns := [...]func(string) error{
|
|
validators[0].(func(string) error),
|
|
validators[1].(func(string) error),
|
|
}
|
|
return func(name string) error {
|
|
for _, fn := range fns {
|
|
if err := fn(name); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
}()
|
|
}
|
|
|
|
const (
|
|
Version = "v0.14.5" // Version of ent codegen.
|
|
Sum = "h1:Rj2WOYJtCkWyFo6a+5wB3EfBRP0rnx1fMk6gGA0UUe4=" // Sum of ent codegen.
|
|
)
|