-
Notifications
You must be signed in to change notification settings - Fork 0
/
generated.go
6166 lines (5607 loc) · 168 KB
/
generated.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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
package generated
import (
"bytes"
"context"
"errors"
"io"
"strconv"
"sync"
"sync/atomic"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/introspection"
"github.com/autom8ter/kdeploy/gen/gql/go/model"
gqlparser "github.com/vektah/gqlparser/v2"
"github.com/vektah/gqlparser/v2/ast"
)
// region ************************** generated!.gotpl **************************
// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema {
return &executableSchema{
resolvers: cfg.Resolvers,
directives: cfg.Directives,
complexity: cfg.Complexity,
}
}
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
Subscription() SubscriptionResolver
}
type DirectiveRoot struct {
}
type ComplexityRoot struct {
App struct {
Args func(childComplexity int) int
Env func(childComplexity int) int
Image func(childComplexity int) int
Labels func(childComplexity int) int
Name func(childComplexity int) int
Namespace func(childComplexity int) int
Networking func(childComplexity int) int
Ports func(childComplexity int) int
Replicas func(childComplexity int) int
Selector func(childComplexity int) int
Status func(childComplexity int) int
}
AppStatus struct {
Replicas func(childComplexity int) int
}
HTTPRoute struct {
AllowCredentials func(childComplexity int) int
AllowHeaders func(childComplexity int) int
AllowMethods func(childComplexity int) int
AllowOrigins func(childComplexity int) int
ExposeHeaders func(childComplexity int) int
Name func(childComplexity int) int
PathPrefix func(childComplexity int) int
Port func(childComplexity int) int
RewriteURI func(childComplexity int) int
}
Log struct {
Message func(childComplexity int) int
}
Mutation struct {
CreateApp func(childComplexity int, input model.AppInput) int
CreateTask func(childComplexity int, input model.TaskInput) int
DelAll func(childComplexity int, input model.Namespace) int
DelApp func(childComplexity int, input model.Ref) int
DelTask func(childComplexity int, input model.Ref) int
UpdateApp func(childComplexity int, input model.AppInput) int
UpdateTask func(childComplexity int, input model.TaskInput) int
}
Namespaces struct {
Namespaces func(childComplexity int) int
}
Networking struct {
Export func(childComplexity int) int
Gateways func(childComplexity int) int
HTTPRoutes func(childComplexity int) int
Hosts func(childComplexity int) int
}
Query struct {
GetApp func(childComplexity int, input model.Ref) int
GetTask func(childComplexity int, input model.Ref) int
ListApps func(childComplexity int, input model.Namespace) int
ListNamespaces func(childComplexity int, input *string) int
ListTasks func(childComplexity int, input model.Namespace) int
}
Replica struct {
Condition func(childComplexity int) int
Phase func(childComplexity int) int
Reason func(childComplexity int) int
}
Subscription struct {
StreamLogs func(childComplexity int, input model.Ref) int
}
Task struct {
Args func(childComplexity int) int
Completions func(childComplexity int) int
Env func(childComplexity int) int
Image func(childComplexity int) int
Labels func(childComplexity int) int
Name func(childComplexity int) int
Namespace func(childComplexity int) int
Schedule func(childComplexity int) int
Selector func(childComplexity int) int
}
}
type MutationResolver interface {
CreateApp(ctx context.Context, input model.AppInput) (*model.App, error)
UpdateApp(ctx context.Context, input model.AppInput) (*model.App, error)
DelApp(ctx context.Context, input model.Ref) (*string, error)
CreateTask(ctx context.Context, input model.TaskInput) (*model.Task, error)
UpdateTask(ctx context.Context, input model.TaskInput) (*model.Task, error)
DelTask(ctx context.Context, input model.Ref) (*string, error)
DelAll(ctx context.Context, input model.Namespace) (*string, error)
}
type QueryResolver interface {
GetApp(ctx context.Context, input model.Ref) (*model.App, error)
ListApps(ctx context.Context, input model.Namespace) ([]*model.App, error)
GetTask(ctx context.Context, input model.Ref) (*model.Task, error)
ListTasks(ctx context.Context, input model.Namespace) ([]*model.Task, error)
ListNamespaces(ctx context.Context, input *string) (*model.Namespaces, error)
}
type SubscriptionResolver interface {
StreamLogs(ctx context.Context, input model.Ref) (<-chan string, error)
}
type executableSchema struct {
resolvers ResolverRoot
directives DirectiveRoot
complexity ComplexityRoot
}
func (e *executableSchema) Schema() *ast.Schema {
return parsedSchema
}
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
ec := executionContext{nil, e}
_ = ec
switch typeName + "." + field {
case "App.args":
if e.complexity.App.Args == nil {
break
}
return e.complexity.App.Args(childComplexity), true
case "App.env":
if e.complexity.App.Env == nil {
break
}
return e.complexity.App.Env(childComplexity), true
case "App.image":
if e.complexity.App.Image == nil {
break
}
return e.complexity.App.Image(childComplexity), true
case "App.labels":
if e.complexity.App.Labels == nil {
break
}
return e.complexity.App.Labels(childComplexity), true
case "App.name":
if e.complexity.App.Name == nil {
break
}
return e.complexity.App.Name(childComplexity), true
case "App.namespace":
if e.complexity.App.Namespace == nil {
break
}
return e.complexity.App.Namespace(childComplexity), true
case "App.networking":
if e.complexity.App.Networking == nil {
break
}
return e.complexity.App.Networking(childComplexity), true
case "App.ports":
if e.complexity.App.Ports == nil {
break
}
return e.complexity.App.Ports(childComplexity), true
case "App.replicas":
if e.complexity.App.Replicas == nil {
break
}
return e.complexity.App.Replicas(childComplexity), true
case "App.selector":
if e.complexity.App.Selector == nil {
break
}
return e.complexity.App.Selector(childComplexity), true
case "App.status":
if e.complexity.App.Status == nil {
break
}
return e.complexity.App.Status(childComplexity), true
case "AppStatus.replicas":
if e.complexity.AppStatus.Replicas == nil {
break
}
return e.complexity.AppStatus.Replicas(childComplexity), true
case "HTTPRoute.allow_credentials":
if e.complexity.HTTPRoute.AllowCredentials == nil {
break
}
return e.complexity.HTTPRoute.AllowCredentials(childComplexity), true
case "HTTPRoute.allow_headers":
if e.complexity.HTTPRoute.AllowHeaders == nil {
break
}
return e.complexity.HTTPRoute.AllowHeaders(childComplexity), true
case "HTTPRoute.allow_methods":
if e.complexity.HTTPRoute.AllowMethods == nil {
break
}
return e.complexity.HTTPRoute.AllowMethods(childComplexity), true
case "HTTPRoute.allow_origins":
if e.complexity.HTTPRoute.AllowOrigins == nil {
break
}
return e.complexity.HTTPRoute.AllowOrigins(childComplexity), true
case "HTTPRoute.expose_headers":
if e.complexity.HTTPRoute.ExposeHeaders == nil {
break
}
return e.complexity.HTTPRoute.ExposeHeaders(childComplexity), true
case "HTTPRoute.name":
if e.complexity.HTTPRoute.Name == nil {
break
}
return e.complexity.HTTPRoute.Name(childComplexity), true
case "HTTPRoute.path_prefix":
if e.complexity.HTTPRoute.PathPrefix == nil {
break
}
return e.complexity.HTTPRoute.PathPrefix(childComplexity), true
case "HTTPRoute.port":
if e.complexity.HTTPRoute.Port == nil {
break
}
return e.complexity.HTTPRoute.Port(childComplexity), true
case "HTTPRoute.rewrite_uri":
if e.complexity.HTTPRoute.RewriteURI == nil {
break
}
return e.complexity.HTTPRoute.RewriteURI(childComplexity), true
case "Log.message":
if e.complexity.Log.Message == nil {
break
}
return e.complexity.Log.Message(childComplexity), true
case "Mutation.createApp":
if e.complexity.Mutation.CreateApp == nil {
break
}
args, err := ec.field_Mutation_createApp_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateApp(childComplexity, args["input"].(model.AppInput)), true
case "Mutation.createTask":
if e.complexity.Mutation.CreateTask == nil {
break
}
args, err := ec.field_Mutation_createTask_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.CreateTask(childComplexity, args["input"].(model.TaskInput)), true
case "Mutation.delAll":
if e.complexity.Mutation.DelAll == nil {
break
}
args, err := ec.field_Mutation_delAll_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DelAll(childComplexity, args["input"].(model.Namespace)), true
case "Mutation.delApp":
if e.complexity.Mutation.DelApp == nil {
break
}
args, err := ec.field_Mutation_delApp_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DelApp(childComplexity, args["input"].(model.Ref)), true
case "Mutation.delTask":
if e.complexity.Mutation.DelTask == nil {
break
}
args, err := ec.field_Mutation_delTask_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.DelTask(childComplexity, args["input"].(model.Ref)), true
case "Mutation.updateApp":
if e.complexity.Mutation.UpdateApp == nil {
break
}
args, err := ec.field_Mutation_updateApp_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateApp(childComplexity, args["input"].(model.AppInput)), true
case "Mutation.updateTask":
if e.complexity.Mutation.UpdateTask == nil {
break
}
args, err := ec.field_Mutation_updateTask_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Mutation.UpdateTask(childComplexity, args["input"].(model.TaskInput)), true
case "Namespaces.namespaces":
if e.complexity.Namespaces.Namespaces == nil {
break
}
return e.complexity.Namespaces.Namespaces(childComplexity), true
case "Networking.export":
if e.complexity.Networking.Export == nil {
break
}
return e.complexity.Networking.Export(childComplexity), true
case "Networking.gateways":
if e.complexity.Networking.Gateways == nil {
break
}
return e.complexity.Networking.Gateways(childComplexity), true
case "Networking.http_routes":
if e.complexity.Networking.HTTPRoutes == nil {
break
}
return e.complexity.Networking.HTTPRoutes(childComplexity), true
case "Networking.hosts":
if e.complexity.Networking.Hosts == nil {
break
}
return e.complexity.Networking.Hosts(childComplexity), true
case "Query.getApp":
if e.complexity.Query.GetApp == nil {
break
}
args, err := ec.field_Query_getApp_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.GetApp(childComplexity, args["input"].(model.Ref)), true
case "Query.getTask":
if e.complexity.Query.GetTask == nil {
break
}
args, err := ec.field_Query_getTask_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.GetTask(childComplexity, args["input"].(model.Ref)), true
case "Query.listApps":
if e.complexity.Query.ListApps == nil {
break
}
args, err := ec.field_Query_listApps_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.ListApps(childComplexity, args["input"].(model.Namespace)), true
case "Query.listNamespaces":
if e.complexity.Query.ListNamespaces == nil {
break
}
args, err := ec.field_Query_listNamespaces_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.ListNamespaces(childComplexity, args["input"].(*string)), true
case "Query.listTasks":
if e.complexity.Query.ListTasks == nil {
break
}
args, err := ec.field_Query_listTasks_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Query.ListTasks(childComplexity, args["input"].(model.Namespace)), true
case "Replica.condition":
if e.complexity.Replica.Condition == nil {
break
}
return e.complexity.Replica.Condition(childComplexity), true
case "Replica.phase":
if e.complexity.Replica.Phase == nil {
break
}
return e.complexity.Replica.Phase(childComplexity), true
case "Replica.reason":
if e.complexity.Replica.Reason == nil {
break
}
return e.complexity.Replica.Reason(childComplexity), true
case "Subscription.streamLogs":
if e.complexity.Subscription.StreamLogs == nil {
break
}
args, err := ec.field_Subscription_streamLogs_args(context.TODO(), rawArgs)
if err != nil {
return 0, false
}
return e.complexity.Subscription.StreamLogs(childComplexity, args["input"].(model.Ref)), true
case "Task.args":
if e.complexity.Task.Args == nil {
break
}
return e.complexity.Task.Args(childComplexity), true
case "Task.completions":
if e.complexity.Task.Completions == nil {
break
}
return e.complexity.Task.Completions(childComplexity), true
case "Task.env":
if e.complexity.Task.Env == nil {
break
}
return e.complexity.Task.Env(childComplexity), true
case "Task.image":
if e.complexity.Task.Image == nil {
break
}
return e.complexity.Task.Image(childComplexity), true
case "Task.labels":
if e.complexity.Task.Labels == nil {
break
}
return e.complexity.Task.Labels(childComplexity), true
case "Task.name":
if e.complexity.Task.Name == nil {
break
}
return e.complexity.Task.Name(childComplexity), true
case "Task.namespace":
if e.complexity.Task.Namespace == nil {
break
}
return e.complexity.Task.Namespace(childComplexity), true
case "Task.schedule":
if e.complexity.Task.Schedule == nil {
break
}
return e.complexity.Task.Schedule(childComplexity), true
case "Task.selector":
if e.complexity.Task.Selector == nil {
break
}
return e.complexity.Task.Selector(childComplexity), true
}
return 0, false
}
func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler {
rc := graphql.GetOperationContext(ctx)
ec := executionContext{rc, e}
first := true
switch rc.Operation.Operation {
case ast.Query:
return func(ctx context.Context) *graphql.Response {
if !first {
return nil
}
first = false
data := ec._Query(ctx, rc.Operation.SelectionSet)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
case ast.Mutation:
return func(ctx context.Context) *graphql.Response {
if !first {
return nil
}
first = false
data := ec._Mutation(ctx, rc.Operation.SelectionSet)
var buf bytes.Buffer
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
case ast.Subscription:
next := ec._Subscription(ctx, rc.Operation.SelectionSet)
var buf bytes.Buffer
return func(ctx context.Context) *graphql.Response {
buf.Reset()
data := next()
if data == nil {
return nil
}
data.MarshalGQL(&buf)
return &graphql.Response{
Data: buf.Bytes(),
}
}
default:
return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation"))
}
}
type executionContext struct {
*graphql.OperationContext
*executableSchema
}
func (ec *executionContext) introspectSchema() (*introspection.Schema, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapSchema(parsedSchema), nil
}
func (ec *executionContext) introspectType(name string) (*introspection.Type, error) {
if ec.DisableIntrospection {
return nil, errors.New("introspection disabled")
}
return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil
}
var sources = []*ast.Source{
{Name: "./schema.graphql", Input: `# time is an rfc 3339 timestamp
scalar Time
# Map is a k/v map where the key is a string and the value is any value
scalar Map
type HTTPRoute {
# The name assigned to the route for debugging purposes
name: String!
# forward to specific port on application
port: Int!
# prefix-based path match
path_prefix: String
# rewrite HTTP URIs before they reach the application
rewrite_uri: String
# The list of origins that are allowed to perform CORS requests
allow_origins: [String!]
# The list of methods that are allowed to perform CORS requests
allow_methods: [String!]
# The list of headers that are allowed to perform CORS requests
allow_headers: [String!]
#
expose_headers: [String!]
# adds ` + "`" + `Access-Control-Allow-Credentials` + "`" + ` header
allow_credentials: Boolean
}
type Networking {
# The names of gateways and sidecars that should apply these routes.
# Gateways in other namespaces may be referred to by
# ` + "`" + `<gateway namespace>/<gateway name>` + "`" + `; specifying a gateway with no
# namespace qualifier is the same as specifying the VirtualService's
# namespace. A single VirtualService is used for sidecars inside the mesh as
# well as for one or more gateways. The selection condition imposed by this
# field can be overridden using the source field in the match conditions
# of protocol-specific routes. The reserved word ` + "`" + `mesh` + "`" + ` is used to imply
# all the sidecars in the mesh. When this field is omitted, the default
# gateway (` + "`" + `mesh` + "`" + `) will be used, which would apply the rule to all
# sidecars in the mesh. If a list of gateway names is provided, the
# rules will apply only to the gateways. To apply the rules to both
# gateways and sidecars, specify ` + "`" + `mesh` + "`" + ` as one of the gateway names.
gateways: [String!]
# The destination hosts to which traffic is being sent. Could
# be a DNS name with wildcard prefix or an IP address.
hosts: [String!]
# export to all other namespaces in service mesh
export: Boolean
# An ordered list of route rules for HTTP traffic
http_routes: [HTTPRoute!]
}
input HTTPRouteInput {
# The name assigned to the route for debugging purposes
name: String
# forward to specific port on application
port: Int
# prefix-based path match
path_prefix: String
# rewrite HTTP URIs before they reach the application
rewrite_uri: String
# The list of origins that are allowed to perform CORS requests
allow_origins: [String!]
# The list of methods that are allowed to perform CORS requests
allow_methods: [String!]
# The list of headers that are allowed to perform CORS requests
allow_headers: [String!]
#
expose_headers: [String!]
# adds ` + "`" + `Access-Control-Allow-Credentials` + "`" + ` header
allow_credentials: Boolean
}
input NetworkingInput {
# The names of gateways and sidecars that should apply these routes.
# Gateways in other namespaces may be referred to by
# ` + "`" + `<gateway namespace>/<gateway name>` + "`" + `; specifying a gateway with no
# namespace qualifier is the same as specifying the VirtualService's
# namespace. A single VirtualService is used for sidecars inside the mesh as
# well as for one or more gateways. The selection condition imposed by this
# field can be overridden using the source field in the match conditions
# of protocol-specific routes. The reserved word ` + "`" + `mesh` + "`" + ` is used to imply
# all the sidecars in the mesh. When this field is omitted, the default
# gateway (` + "`" + `mesh` + "`" + `) will be used, which would apply the rule to all
# sidecars in the mesh. If a list of gateway names is provided, the
# rules will apply only to the gateways. To apply the rules to both
# gateways and sidecars, specify ` + "`" + `mesh` + "`" + ` as one of the gateway names.
gateways: [String!]
# The destination hosts to which traffic is being sent. Could
# be a DNS name with wildcard prefix or an IP address.
hosts: [String!]
#
export: Boolean
#
http_routes: [HTTPRouteInput!]
}
# App is a stateless application
type App {
# name of the application
name: String!
# application namespace
namespace: String!
# docker image of application
image: String!
# args are arguments given to the container/image at startup
args: [String!]
# k/v map of environmental variables
env: Map
# k/v map of ports to expose ex: http: 80 https: 443
ports: Map!
# number of deployment replicas min:1
replicas: Int!
# gateway/service mesh networking
networking: Networking!
# status tracks the state of the application during it's lifecycle
status: AppStatus!
labels: Map!
selector: Map!
}
# Task is scheduled cron job
type Task {
# name of the application
name: String!
# application namespace
namespace: String!
# docker image of application
image: String!
# args are arguments given to the container/image at startup
args: [String!]
# k/v map of environmental variables
env: Map
# schedule is the cron schedule: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
schedule: String!
# completions is the number of times to execute the task. If completions = 0, the task will run forever
completions: Int
labels: Map!
selector: Map!
}
# Replica tracks the state of a single instance
type Replica {
phase: String!
condition: String!
reason: String!
}
# AppStatus tracks the state of an app's lifecycle
type AppStatus {
replicas: [Replica]!
}
# Log is a message streamed from stdout/stderr of an instance
type Log {
message: String!
}
# Namespaces is a list of namespaces
type Namespaces {
namespaces: [String!]
}
# Namespace is a primitive used for logical segmentation of apps & tasks
input Namespace {
namespace: String!
}
# AppInput creates a new stateless Application
input AppInput {
# name of the application
name: String!
# application namespace
namespace: String!
# docker image of application
image: String!
# args are arguments given to the container/image at startup
args: [String!]
# k/v map of environmental variables
env: Map
# k/v map of ports to expose ex: http-1: 80 https-1: 443
ports: Map!
# number of deployment replicas min:1
replicas: Int!
# gateway/servicemesh configuration
networking: NetworkingInput!
labels: Map!
selector: Map!
}
# TaskInput creates a new task(cron job)
input TaskInput {
# name of the application
name: String!
# application namespace
namespace: String!
# docker image of application
image: String!
# args are arguments given to the container/image at startup
args: [String!]
# k/v map of environmental variables
env: Map
# schedule is the cron schedule: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
schedule: String!
# completions is the number of times to execute the task. If completions = 0, the task will run forever
completions: Int
labels: Map!
selector: Map!
}
input Ref {
# name of the application
name: String!
# application namespace
namespace: String!
}
type Mutation {
# createApp creates a new stateless application(k8s deployment), exposed with a single load balancer(k8s service) within a single namespace(k8s namespace)
# the namespace will automatically be created if one does not already exist
createApp(input: AppInput!): App!
# updateApp edits/patches an existing stateless application(k8s deployment & service) within an existing namespace(k8s namespace)
updateApp(input: AppInput!): App!
# delApp deletes a single stateless application(k8s deployment & service) within an existing namespace
delApp(input: Ref!): String
# createTask creates a new task(k8s cron job) within a single namespace(k8s namespace)
# the namespace will automatically be created if one does not already exist
createTask(input: TaskInput!): Task!
# UpdateTask edits/patches an existing task(k8s cron job) within an existing namespace(k8s namespace)
updateTask(input: TaskInput!): Task!
# DeleteTask deletes a single task(k8s cron job) within an existing namespace
delTask(input: Ref!): String
# delAll deletes all apps/tasks within an existing namespace
delAll(input: Namespace!): String
}
type Query {
# getApp gets an existing stateless application(k8s deployment) by name within an existing namespace
getApp(input: Ref!): App
# listApps lists all an existing stateless applications(k8s deployments) within an existing namespace
listApps(input: Namespace!): [App!]
# getTask gets a task(k8s cron job) by name within an existing namespace
getTask(input: Ref!): Task
# listTasks lists all tasks(k8s cron jobs) within an existing namespace
listTasks(input: Namespace!): [Task!]
# listNamespaces lists all namespaces created by kdeploy
listNamespaces(input: String): Namespaces!
}
type Subscription {
# logs streams logs from an an existing stateless application(k8s deployment) within an existing namespace. Streams are opened to all replicas & converted into a single stream
streamLogs(input: Ref!): String!
}
`, BuiltIn: false},
}
var parsedSchema = gqlparser.MustLoadSchema(sources...)
// endregion ************************** generated!.gotpl **************************
// region ***************************** args.gotpl *****************************
func (ec *executionContext) field_Mutation_createApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.AppInput
if tmp, ok := rawArgs["input"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
arg0, err = ec.unmarshalNAppInput2githubᚗcomᚋautom8terᚋkdeployᚋgenᚋgqlᚋgoᚋmodelᚐAppInput(ctx, tmp)
if err != nil {
return nil, err
}
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_createTask_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.TaskInput
if tmp, ok := rawArgs["input"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
arg0, err = ec.unmarshalNTaskInput2githubᚗcomᚋautom8terᚋkdeployᚋgenᚋgqlᚋgoᚋmodelᚐTaskInput(ctx, tmp)
if err != nil {
return nil, err
}
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_delAll_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.Namespace
if tmp, ok := rawArgs["input"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
arg0, err = ec.unmarshalNNamespace2githubᚗcomᚋautom8terᚋkdeployᚋgenᚋgqlᚋgoᚋmodelᚐNamespace(ctx, tmp)
if err != nil {
return nil, err
}
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_delApp_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error
args := map[string]interface{}{}
var arg0 model.Ref
if tmp, ok := rawArgs["input"]; ok {
ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input"))
arg0, err = ec.unmarshalNRef2githubᚗcomᚋautom8terᚋkdeployᚋgenᚋgqlᚋgoᚋmodelᚐRef(ctx, tmp)
if err != nil {
return nil, err
}
}
args["input"] = arg0
return args, nil
}
func (ec *executionContext) field_Mutation_delTask_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) {
var err error