/
runtime.go
58 lines (55 loc) · 3.02 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
// Code generated by entc, DO NOT EDIT.
package ent
import (
"github.com/orestonce/ChessGame/ent/droom"
"github.com/orestonce/ChessGame/ent/dsession"
"github.com/orestonce/ChessGame/ent/duser"
"github.com/orestonce/ChessGame/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() {
droomFields := schema.DRoom{}.Fields()
_ = droomFields
// droomDescIsGameRunning is the schema descriptor for is_game_running field.
droomDescIsGameRunning := droomFields[1].Descriptor()
// droom.DefaultIsGameRunning holds the default value on creation for the is_game_running field.
droom.DefaultIsGameRunning = droomDescIsGameRunning.Default.(bool)
// droomDescPanel is the schema descriptor for panel field.
droomDescPanel := droomFields[2].Descriptor()
// droom.DefaultPanel holds the default value on creation for the panel field.
droom.DefaultPanel = droomDescPanel.Default.(string)
// droomDescWUserID is the schema descriptor for w_user_id field.
droomDescWUserID := droomFields[3].Descriptor()
// droom.DefaultWUserID holds the default value on creation for the w_user_id field.
droom.DefaultWUserID = droomDescWUserID.Default.(string)
// droomDescBUserID is the schema descriptor for b_user_id field.
droomDescBUserID := droomFields[4].Descriptor()
// droom.DefaultBUserID holds the default value on creation for the b_user_id field.
droom.DefaultBUserID = droomDescBUserID.Default.(string)
dsessionFields := schema.DSession{}.Fields()
_ = dsessionFields
// dsessionDescUserID is the schema descriptor for user_id field.
dsessionDescUserID := dsessionFields[1].Descriptor()
// dsession.DefaultUserID holds the default value on creation for the user_id field.
dsession.DefaultUserID = dsessionDescUserID.Default.(string)
// dsessionDescRoomID is the schema descriptor for room_id field.
dsessionDescRoomID := dsessionFields[2].Descriptor()
// dsession.DefaultRoomID holds the default value on creation for the room_id field.
dsession.DefaultRoomID = dsessionDescRoomID.Default.(string)
duserFields := schema.DUser{}.Fields()
_ = duserFields
// duserDescName is the schema descriptor for name field.
duserDescName := duserFields[1].Descriptor()
// duser.NameValidator is a validator for the "name" field. It is called by the builders before save.
duser.NameValidator = duserDescName.Validators[0].(func(string) error)
// duserDescPasswordHash is the schema descriptor for password_hash field.
duserDescPasswordHash := duserFields[2].Descriptor()
// duser.PasswordHashValidator is a validator for the "password_hash" field. It is called by the builders before save.
duser.PasswordHashValidator = duserDescPasswordHash.Validators[0].(func(string) error)
// duserDescID is the schema descriptor for id field.
duserDescID := duserFields[0].Descriptor()
// duser.IDValidator is a validator for the "id" field. It is called by the builders before save.
duser.IDValidator = duserDescID.Validators[0].(func(string) error)
}