/
runtime.go
34 lines (31 loc) · 1.57 KB
/
runtime.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Code generated by ent, DO NOT EDIT.
package ent
import (
"github.com/ogen-go/ent2ogen/example/ent/keyboard"
"github.com/ogen-go/ent2ogen/example/ent/keycapmodel"
"github.com/ogen-go/ent2ogen/example/ent/schema"
"github.com/ogen-go/ent2ogen/example/ent/switchmodel"
)
// 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() {
keyboardFields := schema.Keyboard{}.Fields()
_ = keyboardFields
// keyboardDescName is the schema descriptor for name field.
keyboardDescName := keyboardFields[1].Descriptor()
// keyboard.NameValidator is a validator for the "name" field. It is called by the builders before save.
keyboard.NameValidator = keyboardDescName.Validators[0].(func(string) error)
keycapmodelFields := schema.KeycapModel{}.Fields()
_ = keycapmodelFields
// keycapmodelDescName is the schema descriptor for name field.
keycapmodelDescName := keycapmodelFields[1].Descriptor()
// keycapmodel.NameValidator is a validator for the "name" field. It is called by the builders before save.
keycapmodel.NameValidator = keycapmodelDescName.Validators[0].(func(string) error)
switchmodelFields := schema.SwitchModel{}.Fields()
_ = switchmodelFields
// switchmodelDescName is the schema descriptor for name field.
switchmodelDescName := switchmodelFields[1].Descriptor()
// switchmodel.NameValidator is a validator for the "name" field. It is called by the builders before save.
switchmodel.NameValidator = switchmodelDescName.Validators[0].(func(string) error)
}