/
runtime.go
133 lines (129 loc) · 7.59 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
// Code generated by entc, DO NOT EDIT.
package ent
import (
"time"
"github.com/open-privacy/opv/pkg/ent/apiaudit"
"github.com/open-privacy/opv/pkg/ent/fact"
"github.com/open-privacy/opv/pkg/ent/facttype"
"github.com/open-privacy/opv/pkg/ent/grant"
"github.com/open-privacy/opv/pkg/ent/schema"
"github.com/open-privacy/opv/pkg/ent/scope"
)
// 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() {
apiauditMixin := schema.APIAudit{}.Mixin()
apiauditMixinFields0 := apiauditMixin[0].Fields()
_ = apiauditMixinFields0
apiauditFields := schema.APIAudit{}.Fields()
_ = apiauditFields
// apiauditDescCreatedAt is the schema descriptor for created_at field.
apiauditDescCreatedAt := apiauditMixinFields0[0].Descriptor()
// apiaudit.DefaultCreatedAt holds the default value on creation for the created_at field.
apiaudit.DefaultCreatedAt = apiauditDescCreatedAt.Default.(func() time.Time)
// apiauditDescUpdatedAt is the schema descriptor for updated_at field.
apiauditDescUpdatedAt := apiauditMixinFields0[1].Descriptor()
// apiaudit.DefaultUpdatedAt holds the default value on creation for the updated_at field.
apiaudit.DefaultUpdatedAt = apiauditDescUpdatedAt.Default.(func() time.Time)
// apiaudit.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
apiaudit.UpdateDefaultUpdatedAt = apiauditDescUpdatedAt.UpdateDefault.(func() time.Time)
// apiauditDescID is the schema descriptor for id field.
apiauditDescID := apiauditFields[0].Descriptor()
// apiaudit.DefaultID holds the default value on creation for the id field.
apiaudit.DefaultID = apiauditDescID.Default.(func() string)
// apiaudit.IDValidator is a validator for the "id" field. It is called by the builders before save.
apiaudit.IDValidator = apiauditDescID.Validators[0].(func(string) error)
factMixin := schema.Fact{}.Mixin()
factMixinFields0 := factMixin[0].Fields()
_ = factMixinFields0
factFields := schema.Fact{}.Fields()
_ = factFields
// factDescCreatedAt is the schema descriptor for created_at field.
factDescCreatedAt := factMixinFields0[0].Descriptor()
// fact.DefaultCreatedAt holds the default value on creation for the created_at field.
fact.DefaultCreatedAt = factDescCreatedAt.Default.(func() time.Time)
// factDescUpdatedAt is the schema descriptor for updated_at field.
factDescUpdatedAt := factMixinFields0[1].Descriptor()
// fact.DefaultUpdatedAt holds the default value on creation for the updated_at field.
fact.DefaultUpdatedAt = factDescUpdatedAt.Default.(func() time.Time)
// fact.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
fact.UpdateDefaultUpdatedAt = factDescUpdatedAt.UpdateDefault.(func() time.Time)
// factDescID is the schema descriptor for id field.
factDescID := factFields[0].Descriptor()
// fact.DefaultID holds the default value on creation for the id field.
fact.DefaultID = factDescID.Default.(func() string)
// fact.IDValidator is a validator for the "id" field. It is called by the builders before save.
fact.IDValidator = factDescID.Validators[0].(func(string) error)
facttypeMixin := schema.FactType{}.Mixin()
facttypeMixinFields0 := facttypeMixin[0].Fields()
_ = facttypeMixinFields0
facttypeFields := schema.FactType{}.Fields()
_ = facttypeFields
// facttypeDescCreatedAt is the schema descriptor for created_at field.
facttypeDescCreatedAt := facttypeMixinFields0[0].Descriptor()
// facttype.DefaultCreatedAt holds the default value on creation for the created_at field.
facttype.DefaultCreatedAt = facttypeDescCreatedAt.Default.(func() time.Time)
// facttypeDescUpdatedAt is the schema descriptor for updated_at field.
facttypeDescUpdatedAt := facttypeMixinFields0[1].Descriptor()
// facttype.DefaultUpdatedAt holds the default value on creation for the updated_at field.
facttype.DefaultUpdatedAt = facttypeDescUpdatedAt.Default.(func() time.Time)
// facttype.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
facttype.UpdateDefaultUpdatedAt = facttypeDescUpdatedAt.UpdateDefault.(func() time.Time)
// facttypeDescBuiltIn is the schema descriptor for built_in field.
facttypeDescBuiltIn := facttypeFields[2].Descriptor()
// facttype.DefaultBuiltIn holds the default value on creation for the built_in field.
facttype.DefaultBuiltIn = facttypeDescBuiltIn.Default.(bool)
// facttypeDescID is the schema descriptor for id field.
facttypeDescID := facttypeFields[0].Descriptor()
// facttype.DefaultID holds the default value on creation for the id field.
facttype.DefaultID = facttypeDescID.Default.(func() string)
// facttype.IDValidator is a validator for the "id" field. It is called by the builders before save.
facttype.IDValidator = facttypeDescID.Validators[0].(func(string) error)
grantMixin := schema.Grant{}.Mixin()
grantMixinFields0 := grantMixin[0].Fields()
_ = grantMixinFields0
grantFields := schema.Grant{}.Fields()
_ = grantFields
// grantDescCreatedAt is the schema descriptor for created_at field.
grantDescCreatedAt := grantMixinFields0[0].Descriptor()
// grant.DefaultCreatedAt holds the default value on creation for the created_at field.
grant.DefaultCreatedAt = grantDescCreatedAt.Default.(func() time.Time)
// grantDescUpdatedAt is the schema descriptor for updated_at field.
grantDescUpdatedAt := grantMixinFields0[1].Descriptor()
// grant.DefaultUpdatedAt holds the default value on creation for the updated_at field.
grant.DefaultUpdatedAt = grantDescUpdatedAt.Default.(func() time.Time)
// grant.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
grant.UpdateDefaultUpdatedAt = grantDescUpdatedAt.UpdateDefault.(func() time.Time)
// grantDescID is the schema descriptor for id field.
grantDescID := grantFields[0].Descriptor()
// grant.DefaultID holds the default value on creation for the id field.
grant.DefaultID = grantDescID.Default.(func() string)
// grant.IDValidator is a validator for the "id" field. It is called by the builders before save.
grant.IDValidator = grantDescID.Validators[0].(func(string) error)
scopeMixin := schema.Scope{}.Mixin()
scopeMixinFields0 := scopeMixin[0].Fields()
_ = scopeMixinFields0
scopeFields := schema.Scope{}.Fields()
_ = scopeFields
// scopeDescCreatedAt is the schema descriptor for created_at field.
scopeDescCreatedAt := scopeMixinFields0[0].Descriptor()
// scope.DefaultCreatedAt holds the default value on creation for the created_at field.
scope.DefaultCreatedAt = scopeDescCreatedAt.Default.(func() time.Time)
// scopeDescUpdatedAt is the schema descriptor for updated_at field.
scopeDescUpdatedAt := scopeMixinFields0[1].Descriptor()
// scope.DefaultUpdatedAt holds the default value on creation for the updated_at field.
scope.DefaultUpdatedAt = scopeDescUpdatedAt.Default.(func() time.Time)
// scope.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
scope.UpdateDefaultUpdatedAt = scopeDescUpdatedAt.UpdateDefault.(func() time.Time)
// scopeDescNonce is the schema descriptor for nonce field.
scopeDescNonce := scopeFields[2].Descriptor()
// scope.DefaultNonce holds the default value on creation for the nonce field.
scope.DefaultNonce = scopeDescNonce.Default.(func() string)
// scopeDescID is the schema descriptor for id field.
scopeDescID := scopeFields[0].Descriptor()
// scope.DefaultID holds the default value on creation for the id field.
scope.DefaultID = scopeDescID.Default.(func() string)
// scope.IDValidator is a validator for the "id" field. It is called by the builders before save.
scope.IDValidator = scopeDescID.Validators[0].(func(string) error)
}