forked from hesusruiz/VCBackend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtime.go
88 lines (84 loc) · 5.25 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
// Code generated by ent, DO NOT EDIT.
package ent
import (
"time"
"github.com/evidenceledger/vcdemo/vault/ent/credential"
"github.com/evidenceledger/vcdemo/vault/ent/did"
"github.com/evidenceledger/vcdemo/vault/ent/schema"
"github.com/evidenceledger/vcdemo/vault/ent/user"
"github.com/evidenceledger/vcdemo/vault/ent/webauthncredential"
)
// 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() {
credentialFields := schema.Credential{}.Fields()
_ = credentialFields
// credentialDescType is the schema descriptor for type field.
credentialDescType := credentialFields[1].Descriptor()
// credential.DefaultType holds the default value on creation for the type field.
credential.DefaultType = credentialDescType.Default.(string)
// credentialDescCreatedAt is the schema descriptor for created_at field.
credentialDescCreatedAt := credentialFields[3].Descriptor()
// credential.DefaultCreatedAt holds the default value on creation for the created_at field.
credential.DefaultCreatedAt = credentialDescCreatedAt.Default.(func() time.Time)
// credentialDescUpdatedAt is the schema descriptor for updated_at field.
credentialDescUpdatedAt := credentialFields[4].Descriptor()
// credential.DefaultUpdatedAt holds the default value on creation for the updated_at field.
credential.DefaultUpdatedAt = credentialDescUpdatedAt.Default.(func() time.Time)
didFields := schema.DID{}.Fields()
_ = didFields
// didDescCreatedAt is the schema descriptor for created_at field.
didDescCreatedAt := didFields[6].Descriptor()
// did.DefaultCreatedAt holds the default value on creation for the created_at field.
did.DefaultCreatedAt = didDescCreatedAt.Default.(func() time.Time)
// didDescUpdatedAt is the schema descriptor for updated_at field.
didDescUpdatedAt := didFields[7].Descriptor()
// did.DefaultUpdatedAt holds the default value on creation for the updated_at field.
did.DefaultUpdatedAt = didDescUpdatedAt.Default.(func() time.Time)
userFields := schema.User{}.Fields()
_ = userFields
// userDescName is the schema descriptor for name field.
userDescName := userFields[1].Descriptor()
// user.NameValidator is a validator for the "name" field. It is called by the builders before save.
user.NameValidator = userDescName.Validators[0].(func(string) error)
// userDescType is the schema descriptor for type field.
userDescType := userFields[3].Descriptor()
// user.TypeValidator is a validator for the "type" field. It is called by the builders before save.
user.TypeValidator = userDescType.Validators[0].(func(string) error)
// userDescPassword is the schema descriptor for password field.
userDescPassword := userFields[4].Descriptor()
// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
user.PasswordValidator = userDescPassword.Validators[0].(func([]byte) error)
// userDescCreatedAt is the schema descriptor for created_at field.
userDescCreatedAt := userFields[5].Descriptor()
// 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.
userDescUpdatedAt := userFields[6].Descriptor()
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
// userDescID is the schema descriptor for id field.
userDescID := userFields[0].Descriptor()
// user.IDValidator is a validator for the "id" field. It is called by the builders before save.
user.IDValidator = userDescID.Validators[0].(func(string) error)
webauthncredentialMixin := schema.WebauthnCredential{}.Mixin()
webauthncredentialMixinFields0 := webauthncredentialMixin[0].Fields()
_ = webauthncredentialMixinFields0
webauthncredentialFields := schema.WebauthnCredential{}.Fields()
_ = webauthncredentialFields
// webauthncredentialDescCreateTime is the schema descriptor for create_time field.
webauthncredentialDescCreateTime := webauthncredentialMixinFields0[0].Descriptor()
// webauthncredential.DefaultCreateTime holds the default value on creation for the create_time field.
webauthncredential.DefaultCreateTime = webauthncredentialDescCreateTime.Default.(func() time.Time)
// webauthncredentialDescUpdateTime is the schema descriptor for update_time field.
webauthncredentialDescUpdateTime := webauthncredentialMixinFields0[1].Descriptor()
// webauthncredential.DefaultUpdateTime holds the default value on creation for the update_time field.
webauthncredential.DefaultUpdateTime = webauthncredentialDescUpdateTime.Default.(func() time.Time)
// webauthncredential.UpdateDefaultUpdateTime holds the default value on update for the update_time field.
webauthncredential.UpdateDefaultUpdateTime = webauthncredentialDescUpdateTime.UpdateDefault.(func() time.Time)
// webauthncredentialDescID is the schema descriptor for id field.
webauthncredentialDescID := webauthncredentialFields[0].Descriptor()
// webauthncredential.IDValidator is a validator for the "id" field. It is called by the builders before save.
webauthncredential.IDValidator = webauthncredentialDescID.Validators[0].(func(string) error)
}