/
runtime.go
279 lines (276 loc) · 15.6 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
// Code generated by ent, DO NOT EDIT.
package ent
import (
"github.com/ecshreve/dndgen/ent/abilityscore"
"github.com/ecshreve/dndgen/ent/armor"
"github.com/ecshreve/dndgen/ent/class"
"github.com/ecshreve/dndgen/ent/damagetype"
"github.com/ecshreve/dndgen/ent/equipment"
"github.com/ecshreve/dndgen/ent/gear"
"github.com/ecshreve/dndgen/ent/language"
"github.com/ecshreve/dndgen/ent/magicschool"
"github.com/ecshreve/dndgen/ent/proficiency"
"github.com/ecshreve/dndgen/ent/race"
"github.com/ecshreve/dndgen/ent/rule"
"github.com/ecshreve/dndgen/ent/rulesection"
"github.com/ecshreve/dndgen/ent/schema"
"github.com/ecshreve/dndgen/ent/skill"
"github.com/ecshreve/dndgen/ent/subrace"
"github.com/ecshreve/dndgen/ent/tool"
"github.com/ecshreve/dndgen/ent/trait"
"github.com/ecshreve/dndgen/ent/vehicle"
"github.com/ecshreve/dndgen/ent/weapon"
"github.com/ecshreve/dndgen/ent/weaponproperty"
)
// 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() {
abilityscoreMixin := schema.AbilityScore{}.Mixin()
abilityscoreMixinFields0 := abilityscoreMixin[0].Fields()
_ = abilityscoreMixinFields0
abilityscoreFields := schema.AbilityScore{}.Fields()
_ = abilityscoreFields
// abilityscoreDescIndx is the schema descriptor for indx field.
abilityscoreDescIndx := abilityscoreMixinFields0[0].Descriptor()
// abilityscore.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
abilityscore.IndxValidator = abilityscoreDescIndx.Validators[0].(func(string) error)
// abilityscoreDescName is the schema descriptor for name field.
abilityscoreDescName := abilityscoreMixinFields0[1].Descriptor()
// abilityscore.NameValidator is a validator for the "name" field. It is called by the builders before save.
abilityscore.NameValidator = abilityscoreDescName.Validators[0].(func(string) error)
armorMixin := schema.Armor{}.Mixin()
armorMixinFields0 := armorMixin[0].Fields()
_ = armorMixinFields0
armorFields := schema.Armor{}.Fields()
_ = armorFields
// armorDescIndx is the schema descriptor for indx field.
armorDescIndx := armorMixinFields0[0].Descriptor()
// armor.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
armor.IndxValidator = armorDescIndx.Validators[0].(func(string) error)
// armorDescName is the schema descriptor for name field.
armorDescName := armorMixinFields0[1].Descriptor()
// armor.NameValidator is a validator for the "name" field. It is called by the builders before save.
armor.NameValidator = armorDescName.Validators[0].(func(string) error)
classMixin := schema.Class{}.Mixin()
classMixinFields0 := classMixin[0].Fields()
_ = classMixinFields0
classFields := schema.Class{}.Fields()
_ = classFields
// classDescIndx is the schema descriptor for indx field.
classDescIndx := classMixinFields0[0].Descriptor()
// class.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
class.IndxValidator = classDescIndx.Validators[0].(func(string) error)
// classDescName is the schema descriptor for name field.
classDescName := classMixinFields0[1].Descriptor()
// class.NameValidator is a validator for the "name" field. It is called by the builders before save.
class.NameValidator = classDescName.Validators[0].(func(string) error)
damagetypeMixin := schema.DamageType{}.Mixin()
damagetypeMixinFields0 := damagetypeMixin[0].Fields()
_ = damagetypeMixinFields0
damagetypeFields := schema.DamageType{}.Fields()
_ = damagetypeFields
// damagetypeDescIndx is the schema descriptor for indx field.
damagetypeDescIndx := damagetypeMixinFields0[0].Descriptor()
// damagetype.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
damagetype.IndxValidator = damagetypeDescIndx.Validators[0].(func(string) error)
// damagetypeDescName is the schema descriptor for name field.
damagetypeDescName := damagetypeMixinFields0[1].Descriptor()
// damagetype.NameValidator is a validator for the "name" field. It is called by the builders before save.
damagetype.NameValidator = damagetypeDescName.Validators[0].(func(string) error)
equipmentMixin := schema.Equipment{}.Mixin()
equipmentMixinFields0 := equipmentMixin[0].Fields()
_ = equipmentMixinFields0
equipmentFields := schema.Equipment{}.Fields()
_ = equipmentFields
// equipmentDescIndx is the schema descriptor for indx field.
equipmentDescIndx := equipmentMixinFields0[0].Descriptor()
// equipment.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
equipment.IndxValidator = equipmentDescIndx.Validators[0].(func(string) error)
// equipmentDescName is the schema descriptor for name field.
equipmentDescName := equipmentMixinFields0[1].Descriptor()
// equipment.NameValidator is a validator for the "name" field. It is called by the builders before save.
equipment.NameValidator = equipmentDescName.Validators[0].(func(string) error)
gearMixin := schema.Gear{}.Mixin()
gearMixinFields0 := gearMixin[0].Fields()
_ = gearMixinFields0
gearFields := schema.Gear{}.Fields()
_ = gearFields
// gearDescIndx is the schema descriptor for indx field.
gearDescIndx := gearMixinFields0[0].Descriptor()
// gear.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
gear.IndxValidator = gearDescIndx.Validators[0].(func(string) error)
// gearDescName is the schema descriptor for name field.
gearDescName := gearMixinFields0[1].Descriptor()
// gear.NameValidator is a validator for the "name" field. It is called by the builders before save.
gear.NameValidator = gearDescName.Validators[0].(func(string) error)
languageMixin := schema.Language{}.Mixin()
languageMixinFields0 := languageMixin[0].Fields()
_ = languageMixinFields0
languageFields := schema.Language{}.Fields()
_ = languageFields
// languageDescIndx is the schema descriptor for indx field.
languageDescIndx := languageMixinFields0[0].Descriptor()
// language.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
language.IndxValidator = languageDescIndx.Validators[0].(func(string) error)
// languageDescName is the schema descriptor for name field.
languageDescName := languageMixinFields0[1].Descriptor()
// language.NameValidator is a validator for the "name" field. It is called by the builders before save.
language.NameValidator = languageDescName.Validators[0].(func(string) error)
magicschoolMixin := schema.MagicSchool{}.Mixin()
magicschoolMixinFields0 := magicschoolMixin[0].Fields()
_ = magicschoolMixinFields0
magicschoolFields := schema.MagicSchool{}.Fields()
_ = magicschoolFields
// magicschoolDescIndx is the schema descriptor for indx field.
magicschoolDescIndx := magicschoolMixinFields0[0].Descriptor()
// magicschool.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
magicschool.IndxValidator = magicschoolDescIndx.Validators[0].(func(string) error)
// magicschoolDescName is the schema descriptor for name field.
magicschoolDescName := magicschoolMixinFields0[1].Descriptor()
// magicschool.NameValidator is a validator for the "name" field. It is called by the builders before save.
magicschool.NameValidator = magicschoolDescName.Validators[0].(func(string) error)
proficiencyMixin := schema.Proficiency{}.Mixin()
proficiencyMixinFields0 := proficiencyMixin[0].Fields()
_ = proficiencyMixinFields0
proficiencyFields := schema.Proficiency{}.Fields()
_ = proficiencyFields
// proficiencyDescIndx is the schema descriptor for indx field.
proficiencyDescIndx := proficiencyMixinFields0[0].Descriptor()
// proficiency.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
proficiency.IndxValidator = proficiencyDescIndx.Validators[0].(func(string) error)
// proficiencyDescName is the schema descriptor for name field.
proficiencyDescName := proficiencyMixinFields0[1].Descriptor()
// proficiency.NameValidator is a validator for the "name" field. It is called by the builders before save.
proficiency.NameValidator = proficiencyDescName.Validators[0].(func(string) error)
raceMixin := schema.Race{}.Mixin()
raceMixinFields0 := raceMixin[0].Fields()
_ = raceMixinFields0
raceFields := schema.Race{}.Fields()
_ = raceFields
// raceDescIndx is the schema descriptor for indx field.
raceDescIndx := raceMixinFields0[0].Descriptor()
// race.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
race.IndxValidator = raceDescIndx.Validators[0].(func(string) error)
// raceDescName is the schema descriptor for name field.
raceDescName := raceMixinFields0[1].Descriptor()
// race.NameValidator is a validator for the "name" field. It is called by the builders before save.
race.NameValidator = raceDescName.Validators[0].(func(string) error)
ruleMixin := schema.Rule{}.Mixin()
ruleMixinFields0 := ruleMixin[0].Fields()
_ = ruleMixinFields0
ruleFields := schema.Rule{}.Fields()
_ = ruleFields
// ruleDescIndx is the schema descriptor for indx field.
ruleDescIndx := ruleMixinFields0[0].Descriptor()
// rule.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
rule.IndxValidator = ruleDescIndx.Validators[0].(func(string) error)
// ruleDescName is the schema descriptor for name field.
ruleDescName := ruleMixinFields0[1].Descriptor()
// rule.NameValidator is a validator for the "name" field. It is called by the builders before save.
rule.NameValidator = ruleDescName.Validators[0].(func(string) error)
rulesectionMixin := schema.RuleSection{}.Mixin()
rulesectionMixinFields0 := rulesectionMixin[0].Fields()
_ = rulesectionMixinFields0
rulesectionFields := schema.RuleSection{}.Fields()
_ = rulesectionFields
// rulesectionDescIndx is the schema descriptor for indx field.
rulesectionDescIndx := rulesectionMixinFields0[0].Descriptor()
// rulesection.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
rulesection.IndxValidator = rulesectionDescIndx.Validators[0].(func(string) error)
// rulesectionDescName is the schema descriptor for name field.
rulesectionDescName := rulesectionMixinFields0[1].Descriptor()
// rulesection.NameValidator is a validator for the "name" field. It is called by the builders before save.
rulesection.NameValidator = rulesectionDescName.Validators[0].(func(string) error)
skillMixin := schema.Skill{}.Mixin()
skillMixinFields0 := skillMixin[0].Fields()
_ = skillMixinFields0
skillFields := schema.Skill{}.Fields()
_ = skillFields
// skillDescIndx is the schema descriptor for indx field.
skillDescIndx := skillMixinFields0[0].Descriptor()
// skill.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
skill.IndxValidator = skillDescIndx.Validators[0].(func(string) error)
// skillDescName is the schema descriptor for name field.
skillDescName := skillMixinFields0[1].Descriptor()
// skill.NameValidator is a validator for the "name" field. It is called by the builders before save.
skill.NameValidator = skillDescName.Validators[0].(func(string) error)
subraceMixin := schema.Subrace{}.Mixin()
subraceMixinFields0 := subraceMixin[0].Fields()
_ = subraceMixinFields0
subraceFields := schema.Subrace{}.Fields()
_ = subraceFields
// subraceDescIndx is the schema descriptor for indx field.
subraceDescIndx := subraceMixinFields0[0].Descriptor()
// subrace.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
subrace.IndxValidator = subraceDescIndx.Validators[0].(func(string) error)
// subraceDescName is the schema descriptor for name field.
subraceDescName := subraceMixinFields0[1].Descriptor()
// subrace.NameValidator is a validator for the "name" field. It is called by the builders before save.
subrace.NameValidator = subraceDescName.Validators[0].(func(string) error)
toolMixin := schema.Tool{}.Mixin()
toolMixinFields0 := toolMixin[0].Fields()
_ = toolMixinFields0
toolFields := schema.Tool{}.Fields()
_ = toolFields
// toolDescIndx is the schema descriptor for indx field.
toolDescIndx := toolMixinFields0[0].Descriptor()
// tool.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
tool.IndxValidator = toolDescIndx.Validators[0].(func(string) error)
// toolDescName is the schema descriptor for name field.
toolDescName := toolMixinFields0[1].Descriptor()
// tool.NameValidator is a validator for the "name" field. It is called by the builders before save.
tool.NameValidator = toolDescName.Validators[0].(func(string) error)
traitMixin := schema.Trait{}.Mixin()
traitMixinFields0 := traitMixin[0].Fields()
_ = traitMixinFields0
traitFields := schema.Trait{}.Fields()
_ = traitFields
// traitDescIndx is the schema descriptor for indx field.
traitDescIndx := traitMixinFields0[0].Descriptor()
// trait.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
trait.IndxValidator = traitDescIndx.Validators[0].(func(string) error)
// traitDescName is the schema descriptor for name field.
traitDescName := traitMixinFields0[1].Descriptor()
// trait.NameValidator is a validator for the "name" field. It is called by the builders before save.
trait.NameValidator = traitDescName.Validators[0].(func(string) error)
vehicleMixin := schema.Vehicle{}.Mixin()
vehicleMixinFields0 := vehicleMixin[0].Fields()
_ = vehicleMixinFields0
vehicleFields := schema.Vehicle{}.Fields()
_ = vehicleFields
// vehicleDescIndx is the schema descriptor for indx field.
vehicleDescIndx := vehicleMixinFields0[0].Descriptor()
// vehicle.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
vehicle.IndxValidator = vehicleDescIndx.Validators[0].(func(string) error)
// vehicleDescName is the schema descriptor for name field.
vehicleDescName := vehicleMixinFields0[1].Descriptor()
// vehicle.NameValidator is a validator for the "name" field. It is called by the builders before save.
vehicle.NameValidator = vehicleDescName.Validators[0].(func(string) error)
weaponMixin := schema.Weapon{}.Mixin()
weaponMixinFields0 := weaponMixin[0].Fields()
_ = weaponMixinFields0
weaponFields := schema.Weapon{}.Fields()
_ = weaponFields
// weaponDescIndx is the schema descriptor for indx field.
weaponDescIndx := weaponMixinFields0[0].Descriptor()
// weapon.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
weapon.IndxValidator = weaponDescIndx.Validators[0].(func(string) error)
// weaponDescName is the schema descriptor for name field.
weaponDescName := weaponMixinFields0[1].Descriptor()
// weapon.NameValidator is a validator for the "name" field. It is called by the builders before save.
weapon.NameValidator = weaponDescName.Validators[0].(func(string) error)
weaponpropertyMixin := schema.WeaponProperty{}.Mixin()
weaponpropertyMixinFields0 := weaponpropertyMixin[0].Fields()
_ = weaponpropertyMixinFields0
weaponpropertyFields := schema.WeaponProperty{}.Fields()
_ = weaponpropertyFields
// weaponpropertyDescIndx is the schema descriptor for indx field.
weaponpropertyDescIndx := weaponpropertyMixinFields0[0].Descriptor()
// weaponproperty.IndxValidator is a validator for the "indx" field. It is called by the builders before save.
weaponproperty.IndxValidator = weaponpropertyDescIndx.Validators[0].(func(string) error)
// weaponpropertyDescName is the schema descriptor for name field.
weaponpropertyDescName := weaponpropertyMixinFields0[1].Descriptor()
// weaponproperty.NameValidator is a validator for the "name" field. It is called by the builders before save.
weaponproperty.NameValidator = weaponpropertyDescName.Validators[0].(func(string) error)
}