/
runtime.go
194 lines (190 loc) · 11.1 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
// Code generated by entc, DO NOT EDIT.
package ent
import (
"time"
"github.com/google/uuid"
"github.com/vorteil/direktiv/pkg/flow/ent/cloudevents"
"github.com/vorteil/direktiv/pkg/flow/ent/events"
"github.com/vorteil/direktiv/pkg/flow/ent/eventswait"
"github.com/vorteil/direktiv/pkg/flow/ent/inode"
"github.com/vorteil/direktiv/pkg/flow/ent/instance"
"github.com/vorteil/direktiv/pkg/flow/ent/instanceruntime"
"github.com/vorteil/direktiv/pkg/flow/ent/logmsg"
"github.com/vorteil/direktiv/pkg/flow/ent/namespace"
"github.com/vorteil/direktiv/pkg/flow/ent/ref"
"github.com/vorteil/direktiv/pkg/flow/ent/revision"
"github.com/vorteil/direktiv/pkg/flow/ent/route"
"github.com/vorteil/direktiv/pkg/flow/ent/schema"
"github.com/vorteil/direktiv/pkg/flow/ent/vardata"
"github.com/vorteil/direktiv/pkg/flow/ent/varref"
"github.com/vorteil/direktiv/pkg/flow/ent/workflow"
)
// 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() {
cloudeventsFields := schema.CloudEvents{}.Fields()
_ = cloudeventsFields
// cloudeventsDescEventId is the schema descriptor for eventId field.
cloudeventsDescEventId := cloudeventsFields[1].Descriptor()
// cloudevents.EventIdValidator is a validator for the "eventId" field. It is called by the builders before save.
cloudevents.EventIdValidator = cloudeventsDescEventId.Validators[0].(func(string) error)
// cloudeventsDescFire is the schema descriptor for fire field.
cloudeventsDescFire := cloudeventsFields[3].Descriptor()
// cloudevents.DefaultFire holds the default value on creation for the fire field.
cloudevents.DefaultFire = cloudeventsDescFire.Default.(func() time.Time)
// cloudeventsDescCreated is the schema descriptor for created field.
cloudeventsDescCreated := cloudeventsFields[4].Descriptor()
// cloudevents.DefaultCreated holds the default value on creation for the created field.
cloudevents.DefaultCreated = cloudeventsDescCreated.Default.(func() time.Time)
// cloudeventsDescID is the schema descriptor for id field.
cloudeventsDescID := cloudeventsFields[0].Descriptor()
// cloudevents.DefaultID holds the default value on creation for the id field.
cloudevents.DefaultID = cloudeventsDescID.Default.(func() uuid.UUID)
eventsFields := schema.Events{}.Fields()
_ = eventsFields
// eventsDescID is the schema descriptor for id field.
eventsDescID := eventsFields[0].Descriptor()
// events.DefaultID holds the default value on creation for the id field.
events.DefaultID = eventsDescID.Default.(func() uuid.UUID)
eventswaitFields := schema.EventsWait{}.Fields()
_ = eventswaitFields
// eventswaitDescID is the schema descriptor for id field.
eventswaitDescID := eventswaitFields[0].Descriptor()
// eventswait.DefaultID holds the default value on creation for the id field.
eventswait.DefaultID = eventswaitDescID.Default.(func() uuid.UUID)
inodeFields := schema.Inode{}.Fields()
_ = inodeFields
// inodeDescCreatedAt is the schema descriptor for created_at field.
inodeDescCreatedAt := inodeFields[1].Descriptor()
// inode.DefaultCreatedAt holds the default value on creation for the created_at field.
inode.DefaultCreatedAt = inodeDescCreatedAt.Default.(func() time.Time)
// inodeDescUpdatedAt is the schema descriptor for updated_at field.
inodeDescUpdatedAt := inodeFields[2].Descriptor()
// inode.DefaultUpdatedAt holds the default value on creation for the updated_at field.
inode.DefaultUpdatedAt = inodeDescUpdatedAt.Default.(func() time.Time)
// inode.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
inode.UpdateDefaultUpdatedAt = inodeDescUpdatedAt.UpdateDefault.(func() time.Time)
// inodeDescName is the schema descriptor for name field.
inodeDescName := inodeFields[3].Descriptor()
// inode.NameValidator is a validator for the "name" field. It is called by the builders before save.
inode.NameValidator = inodeDescName.Validators[0].(func(string) error)
// inodeDescID is the schema descriptor for id field.
inodeDescID := inodeFields[0].Descriptor()
// inode.DefaultID holds the default value on creation for the id field.
inode.DefaultID = inodeDescID.Default.(func() uuid.UUID)
instanceFields := schema.Instance{}.Fields()
_ = instanceFields
// instanceDescCreatedAt is the schema descriptor for created_at field.
instanceDescCreatedAt := instanceFields[1].Descriptor()
// instance.DefaultCreatedAt holds the default value on creation for the created_at field.
instance.DefaultCreatedAt = instanceDescCreatedAt.Default.(func() time.Time)
// instanceDescUpdatedAt is the schema descriptor for updated_at field.
instanceDescUpdatedAt := instanceFields[2].Descriptor()
// instance.DefaultUpdatedAt holds the default value on creation for the updated_at field.
instance.DefaultUpdatedAt = instanceDescUpdatedAt.Default.(func() time.Time)
// instance.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
instance.UpdateDefaultUpdatedAt = instanceDescUpdatedAt.UpdateDefault.(func() time.Time)
// instanceDescID is the schema descriptor for id field.
instanceDescID := instanceFields[0].Descriptor()
// instance.DefaultID holds the default value on creation for the id field.
instance.DefaultID = instanceDescID.Default.(func() uuid.UUID)
instanceruntimeFields := schema.InstanceRuntime{}.Fields()
_ = instanceruntimeFields
// instanceruntimeDescID is the schema descriptor for id field.
instanceruntimeDescID := instanceruntimeFields[0].Descriptor()
// instanceruntime.DefaultID holds the default value on creation for the id field.
instanceruntime.DefaultID = instanceruntimeDescID.Default.(func() uuid.UUID)
logmsgFields := schema.LogMsg{}.Fields()
_ = logmsgFields
// logmsgDescID is the schema descriptor for id field.
logmsgDescID := logmsgFields[0].Descriptor()
// logmsg.DefaultID holds the default value on creation for the id field.
logmsg.DefaultID = logmsgDescID.Default.(func() uuid.UUID)
namespaceFields := schema.Namespace{}.Fields()
_ = namespaceFields
// namespaceDescCreatedAt is the schema descriptor for created_at field.
namespaceDescCreatedAt := namespaceFields[1].Descriptor()
// namespace.DefaultCreatedAt holds the default value on creation for the created_at field.
namespace.DefaultCreatedAt = namespaceDescCreatedAt.Default.(func() time.Time)
// namespaceDescUpdatedAt is the schema descriptor for updated_at field.
namespaceDescUpdatedAt := namespaceFields[2].Descriptor()
// namespace.DefaultUpdatedAt holds the default value on creation for the updated_at field.
namespace.DefaultUpdatedAt = namespaceDescUpdatedAt.Default.(func() time.Time)
// namespace.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
namespace.UpdateDefaultUpdatedAt = namespaceDescUpdatedAt.UpdateDefault.(func() time.Time)
// namespaceDescName is the schema descriptor for name field.
namespaceDescName := namespaceFields[3].Descriptor()
// namespace.NameValidator is a validator for the "name" field. It is called by the builders before save.
namespace.NameValidator = namespaceDescName.Validators[0].(func(string) error)
// namespaceDescID is the schema descriptor for id field.
namespaceDescID := namespaceFields[0].Descriptor()
// namespace.DefaultID holds the default value on creation for the id field.
namespace.DefaultID = namespaceDescID.Default.(func() uuid.UUID)
refFields := schema.Ref{}.Fields()
_ = refFields
// refDescImmutable is the schema descriptor for immutable field.
refDescImmutable := refFields[1].Descriptor()
// ref.DefaultImmutable holds the default value on creation for the immutable field.
ref.DefaultImmutable = refDescImmutable.Default.(bool)
// refDescName is the schema descriptor for name field.
refDescName := refFields[2].Descriptor()
// ref.NameValidator is a validator for the "name" field. It is called by the builders before save.
ref.NameValidator = refDescName.Validators[0].(func(string) error)
// refDescID is the schema descriptor for id field.
refDescID := refFields[0].Descriptor()
// ref.DefaultID holds the default value on creation for the id field.
ref.DefaultID = refDescID.Default.(func() uuid.UUID)
revisionFields := schema.Revision{}.Fields()
_ = revisionFields
// revisionDescCreatedAt is the schema descriptor for created_at field.
revisionDescCreatedAt := revisionFields[1].Descriptor()
// revision.DefaultCreatedAt holds the default value on creation for the created_at field.
revision.DefaultCreatedAt = revisionDescCreatedAt.Default.(func() time.Time)
// revisionDescID is the schema descriptor for id field.
revisionDescID := revisionFields[0].Descriptor()
// revision.DefaultID holds the default value on creation for the id field.
revision.DefaultID = revisionDescID.Default.(func() uuid.UUID)
routeFields := schema.Route{}.Fields()
_ = routeFields
// routeDescID is the schema descriptor for id field.
routeDescID := routeFields[0].Descriptor()
// route.DefaultID holds the default value on creation for the id field.
route.DefaultID = routeDescID.Default.(func() uuid.UUID)
vardataFields := schema.VarData{}.Fields()
_ = vardataFields
// vardataDescCreatedAt is the schema descriptor for created_at field.
vardataDescCreatedAt := vardataFields[1].Descriptor()
// vardata.DefaultCreatedAt holds the default value on creation for the created_at field.
vardata.DefaultCreatedAt = vardataDescCreatedAt.Default.(func() time.Time)
// vardataDescUpdatedAt is the schema descriptor for updated_at field.
vardataDescUpdatedAt := vardataFields[2].Descriptor()
// vardata.DefaultUpdatedAt holds the default value on creation for the updated_at field.
vardata.DefaultUpdatedAt = vardataDescUpdatedAt.Default.(func() time.Time)
// vardata.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
vardata.UpdateDefaultUpdatedAt = vardataDescUpdatedAt.UpdateDefault.(func() time.Time)
// vardataDescID is the schema descriptor for id field.
vardataDescID := vardataFields[0].Descriptor()
// vardata.DefaultID holds the default value on creation for the id field.
vardata.DefaultID = vardataDescID.Default.(func() uuid.UUID)
varrefFields := schema.VarRef{}.Fields()
_ = varrefFields
// varrefDescName is the schema descriptor for name field.
varrefDescName := varrefFields[1].Descriptor()
// varref.NameValidator is a validator for the "name" field. It is called by the builders before save.
varref.NameValidator = varrefDescName.Validators[0].(func(string) error)
// varrefDescID is the schema descriptor for id field.
varrefDescID := varrefFields[0].Descriptor()
// varref.DefaultID holds the default value on creation for the id field.
varref.DefaultID = varrefDescID.Default.(func() uuid.UUID)
workflowFields := schema.Workflow{}.Fields()
_ = workflowFields
// workflowDescLive is the schema descriptor for live field.
workflowDescLive := workflowFields[1].Descriptor()
// workflow.DefaultLive holds the default value on creation for the live field.
workflow.DefaultLive = workflowDescLive.Default.(bool)
// workflowDescID is the schema descriptor for id field.
workflowDescID := workflowFields[0].Descriptor()
// workflow.DefaultID holds the default value on creation for the id field.
workflow.DefaultID = workflowDescID.Default.(func() uuid.UUID)
}