-
Notifications
You must be signed in to change notification settings - Fork 13
/
models_gen.go
477 lines (398 loc) · 11.7 KB
/
models_gen.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package model
import (
"fmt"
"io"
"strconv"
"time"
)
type AggFilter struct {
Filter *Filter `json:"filter"`
Aggregate Aggregate `json:"aggregate"`
Field *string `json:"field"`
}
type AuthTarget struct {
User *Doc `json:"user"`
Target map[string]interface{} `json:"target"`
Headers map[string]interface{} `json:"headers"`
}
type Authorizer struct {
Name string `json:"name"`
Method string `json:"method"`
Expression string `json:"expression"`
TargetRequests bool `json:"target_requests"`
TargetResponses bool `json:"target_responses"`
}
type AuthorizerInput struct {
Name string `json:"name"`
Method string `json:"method"`
Expression string `json:"expression"`
TargetRequests bool `json:"target_requests"`
TargetResponses bool `json:"target_responses"`
}
type Authorizers struct {
Authorizers []*Authorizer `json:"authorizers"`
}
type AuthorizersInput struct {
Authorizers []*AuthorizerInput `json:"authorizers"`
}
type ConnectFilter struct {
DocRef *RefInput `json:"doc_ref"`
Gtype string `json:"gtype"`
Expression *string `json:"expression"`
Limit int `json:"limit"`
Sort *string `json:"sort"`
Seek *string `json:"seek"`
Reverse *bool `json:"reverse"`
}
type Connection struct {
Ref *Ref `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
Directed bool `json:"directed"`
From *Ref `json:"from"`
To *Ref `json:"to"`
}
type ConnectionConstructor struct {
Ref *RefConstructor `json:"ref"`
Directed bool `json:"directed"`
Attributes map[string]interface{} `json:"attributes"`
From *RefInput `json:"from"`
To *RefInput `json:"to"`
}
type ConnectionConstructors struct {
Connections []*ConnectionConstructor `json:"connections"`
}
type Connections struct {
Connections []*Connection `json:"connections"`
SeekNext *string `json:"seek_next"`
}
type Constraint struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type ConstraintInput struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type Constraints struct {
Constraints []*Constraint `json:"constraints"`
}
type ConstraintsInput struct {
Constraints []*ConstraintInput `json:"constraints"`
}
type Doc struct {
Ref *Ref `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
}
type DocConstructor struct {
Ref *RefConstructor `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
}
type DocConstructors struct {
Docs []*DocConstructor `json:"docs"`
}
type Docs struct {
Docs []*Doc `json:"docs"`
SeekNext *string `json:"seek_next"`
}
type Edit struct {
Ref *RefInput `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
}
type EditFilter struct {
Filter *Filter `json:"filter"`
Attributes map[string]interface{} `json:"attributes"`
}
type ExistsFilter struct {
Gtype string `json:"gtype"`
Expression string `json:"expression"`
Seek *string `json:"seek"`
Reverse *bool `json:"reverse"`
Index *string `json:"index"`
}
type ExprFilter struct {
Expression *string `json:"expression"`
}
type Filter struct {
Gtype string `json:"gtype"`
Expression *string `json:"expression"`
Limit int `json:"limit"`
Sort *string `json:"sort"`
Seek *string `json:"seek"`
Reverse *bool `json:"reverse"`
Index *string `json:"index"`
}
type Index struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type IndexInput struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type Indexes struct {
Indexes []*Index `json:"indexes"`
}
type IndexesInput struct {
Indexes []*IndexInput `json:"indexes"`
}
type Message struct {
Channel string `json:"channel"`
Data map[string]interface{} `json:"data"`
User *Ref `json:"user"`
Timestamp time.Time `json:"timestamp"`
Method string `json:"method"`
}
type OutboundMessage struct {
Channel string `json:"channel"`
Data map[string]interface{} `json:"data"`
}
type Peer struct {
NodeID string `json:"node_id"`
Addr string `json:"addr"`
}
type PeerInput struct {
NodeID string `json:"node_id"`
Addr string `json:"addr"`
}
type PutConnection struct {
Ref *RefInput `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
Directed bool `json:"directed"`
From *RefInput `json:"from"`
To *RefInput `json:"to"`
}
type PutConnections struct {
Connections []*PutConnection `json:"connections"`
}
type PutDoc struct {
Ref *RefInput `json:"ref"`
Attributes map[string]interface{} `json:"attributes"`
}
type PutDocs struct {
Docs []*PutDoc `json:"docs"`
}
type RaftState struct {
Leader string `json:"leader"`
Membership Membership `json:"membership"`
Peers []*Peer `json:"peers"`
Stats map[string]interface{} `json:"stats"`
}
type Ref struct {
Gtype string `json:"gtype"`
Gid string `json:"gid"`
}
type RefConstructor struct {
Gtype string `json:"gtype"`
Gid *string `json:"gid"`
}
type RefInput struct {
Gtype string `json:"gtype"`
Gid string `json:"gid"`
}
type Refs struct {
Refs []*Ref `json:"refs"`
}
type Schema struct {
ConnectionTypes []string `json:"connection_types"`
DocTypes []string `json:"doc_types"`
Authorizers *Authorizers `json:"authorizers"`
Constraints *Constraints `json:"constraints"`
Indexes *Indexes `json:"indexes"`
Triggers *Triggers `json:"triggers"`
}
type SearchConnectFilter struct {
Filter *Filter `json:"filter"`
Gtype string `json:"gtype"`
Attributes map[string]interface{} `json:"attributes"`
Directed bool `json:"directed"`
From *RefInput `json:"from"`
}
type SearchConnectMeFilter struct {
Filter *Filter `json:"filter"`
Gtype string `json:"gtype"`
Attributes map[string]interface{} `json:"attributes"`
Directed bool `json:"directed"`
}
type StreamFilter struct {
Channel string `json:"channel"`
Expression *string `json:"expression"`
Rewind *string `json:"rewind"`
}
type Traversal struct {
Doc *Doc `json:"doc"`
TraversalPath []*Ref `json:"traversal_path"`
Depth int `json:"depth"`
Hops int `json:"hops"`
}
type Traversals struct {
Traversals []*Traversal `json:"traversals"`
}
type TraverseFilter struct {
Root *RefInput `json:"root"`
DocExpression *string `json:"doc_expression"`
ConnectionExpression *string `json:"connection_expression"`
Limit int `json:"limit"`
Sort *string `json:"sort"`
Reverse *bool `json:"reverse"`
Algorithm *Algorithm `json:"algorithm"`
MaxDepth int `json:"max_depth"`
MaxHops int `json:"max_hops"`
}
type TraverseMeFilter struct {
DocExpression *string `json:"doc_expression"`
ConnectionExpression *string `json:"connection_expression"`
Limit int `json:"limit"`
Sort *string `json:"sort"`
Reverse *bool `json:"reverse"`
Algorithm *Algorithm `json:"algorithm"`
MaxDepth int `json:"max_depth"`
MaxHops int `json:"max_hops"`
}
type Trigger struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
Trigger string `json:"trigger"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type TriggerInput struct {
Name string `json:"name"`
Gtype string `json:"gtype"`
Expression string `json:"expression"`
Trigger string `json:"trigger"`
TargetDocs bool `json:"target_docs"`
TargetConnections bool `json:"target_connections"`
}
type Triggers struct {
Triggers []*Trigger `json:"triggers"`
}
type TriggersInput struct {
Triggers []*TriggerInput `json:"triggers"`
}
type Aggregate string
const (
AggregateCount Aggregate = "COUNT"
AggregateSum Aggregate = "SUM"
AggregateAvg Aggregate = "AVG"
AggregateMax Aggregate = "MAX"
AggregateMin Aggregate = "MIN"
AggregateProd Aggregate = "PROD"
)
var AllAggregate = []Aggregate{
AggregateCount,
AggregateSum,
AggregateAvg,
AggregateMax,
AggregateMin,
AggregateProd,
}
func (e Aggregate) IsValid() bool {
switch e {
case AggregateCount, AggregateSum, AggregateAvg, AggregateMax, AggregateMin, AggregateProd:
return true
}
return false
}
func (e Aggregate) String() string {
return string(e)
}
func (e *Aggregate) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Aggregate(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Aggregate", str)
}
return nil
}
func (e Aggregate) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type Algorithm string
const (
AlgorithmBfs Algorithm = "BFS"
AlgorithmDfs Algorithm = "DFS"
)
var AllAlgorithm = []Algorithm{
AlgorithmBfs,
AlgorithmDfs,
}
func (e Algorithm) IsValid() bool {
switch e {
case AlgorithmBfs, AlgorithmDfs:
return true
}
return false
}
func (e Algorithm) String() string {
return string(e)
}
func (e *Algorithm) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Algorithm(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Algorithm", str)
}
return nil
}
func (e Algorithm) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}
type Membership string
const (
MembershipUnknown Membership = "UNKNOWN"
MembershipFollower Membership = "FOLLOWER"
MembershipCandidate Membership = "CANDIDATE"
MembershipLeader Membership = "LEADER"
MembershipShutdown Membership = "SHUTDOWN"
)
var AllMembership = []Membership{
MembershipUnknown,
MembershipFollower,
MembershipCandidate,
MembershipLeader,
MembershipShutdown,
}
func (e Membership) IsValid() bool {
switch e {
case MembershipUnknown, MembershipFollower, MembershipCandidate, MembershipLeader, MembershipShutdown:
return true
}
return false
}
func (e Membership) String() string {
return string(e)
}
func (e *Membership) UnmarshalGQL(v interface{}) error {
str, ok := v.(string)
if !ok {
return fmt.Errorf("enums must be strings")
}
*e = Membership(str)
if !e.IsValid() {
return fmt.Errorf("%s is not a valid Membership", str)
}
return nil
}
func (e Membership) MarshalGQL(w io.Writer) {
fmt.Fprint(w, strconv.Quote(e.String()))
}