-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdagger.gen.go
More file actions
16566 lines (13636 loc) · 406 KB
/
dagger.gen.go
File metadata and controls
16566 lines (13636 loc) · 406 KB
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 dagger. DO NOT EDIT.
package dagger
import (
"context"
"encoding/json"
"errors"
"fmt"
"reflect"
"dagger.io/dagger/querybuilder"
"github.com/vektah/gqlparser/v2/gqlerror"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
)
func Tracer() trace.Tracer {
return otel.Tracer("dagger.io/sdk.go")
}
// reassigned at runtime after the span is initialized
var marshalCtx = context.Background()
// assertNotNil panic if the given value is nil.
// This function is used to validate that input with pointer type are not nil.
// See https://github.com/dagger/dagger/issues/5696 for more context.
func assertNotNil(argName string, value any) {
// We use reflect because just comparing value to nil is not working since
// the value is wrapped into a type when passed as parameter.
// E.g., nil become (*dagger.File)(nil).
if reflect.ValueOf(value).IsNil() {
panic(fmt.Sprintf("unexpected nil pointer for argument %q", argName))
}
}
type DaggerObject = querybuilder.GraphQLMarshaller
type gqlExtendedError struct {
inner *gqlerror.Error
}
// Same as telemetry.ExtendedError, but without the dependency, to simplify
// client generation.
type extendedError interface {
error
Extensions() map[string]any
}
func (e gqlExtendedError) Unwrap() error {
return e.inner
}
var _ extendedError = gqlExtendedError{}
func (e gqlExtendedError) Error() string {
return e.inner.Message
}
func (e gqlExtendedError) Extensions() map[string]any {
return e.inner.Extensions
}
// getCustomError parses a GraphQL error into a more specific error type.
func getCustomError(err error) error {
var gqlErr *gqlerror.Error
if !errors.As(err, &gqlErr) {
return nil
}
ext := gqlErr.Extensions
lessNoisyErr := gqlExtendedError{gqlErr}
typ, ok := ext["_type"].(string)
if !ok {
return lessNoisyErr
}
if typ == "EXEC_ERROR" {
e := &ExecError{
original: lessNoisyErr,
}
if code, ok := ext["exitCode"].(float64); ok {
e.ExitCode = int(code)
}
if args, ok := ext["cmd"].([]interface{}); ok {
cmd := make([]string, len(args))
for i, v := range args {
cmd[i] = v.(string)
}
e.Cmd = cmd
}
if stdout, ok := ext["stdout"].(string); ok {
e.Stdout = stdout
}
if stderr, ok := ext["stderr"].(string); ok {
e.Stderr = stderr
}
return e
}
return lessNoisyErr
}
// ExecError is an API error from an exec operation.
type ExecError struct {
original extendedError
Cmd []string
ExitCode int
Stdout string
Stderr string
}
var _ extendedError = (*ExecError)(nil)
func (e *ExecError) Error() string {
return e.Message()
}
func (e *ExecError) Extensions() map[string]any {
return e.original.Extensions()
}
func (e *ExecError) Message() string {
return e.original.Error()
}
func (e *ExecError) Unwrap() error {
return e.original
}
// The `AddressID` scalar type represents an identifier for an object of type Address.
type AddressID string
// The `BindingID` scalar type represents an identifier for an object of type Binding.
type BindingID string
// The `CacheVolumeID` scalar type represents an identifier for an object of type CacheVolume.
type CacheVolumeID string
// The `ChangesetID` scalar type represents an identifier for an object of type Changeset.
type ChangesetID string
// The `CheckGroupID` scalar type represents an identifier for an object of type CheckGroup.
type CheckGroupID string
// The `CheckID` scalar type represents an identifier for an object of type Check.
type CheckID string
// The `ClientFilesyncMirrorID` scalar type represents an identifier for an object of type ClientFilesyncMirror.
type ClientFilesyncMirrorID string
// The `CloudID` scalar type represents an identifier for an object of type Cloud.
type CloudID string
// The `ContainerID` scalar type represents an identifier for an object of type Container.
type ContainerID string
// The `CurrentModuleID` scalar type represents an identifier for an object of type CurrentModule.
type CurrentModuleID string
// The `DiffStatID` scalar type represents an identifier for an object of type DiffStat.
type DiffStatID string
// The `DirectoryID` scalar type represents an identifier for an object of type Directory.
type DirectoryID string
// The `EngineCacheEntryID` scalar type represents an identifier for an object of type EngineCacheEntry.
type EngineCacheEntryID string
// The `EngineCacheEntrySetID` scalar type represents an identifier for an object of type EngineCacheEntrySet.
type EngineCacheEntrySetID string
// The `EngineCacheID` scalar type represents an identifier for an object of type EngineCache.
type EngineCacheID string
// The `EngineID` scalar type represents an identifier for an object of type Engine.
type EngineID string
// The `EnumTypeDefID` scalar type represents an identifier for an object of type EnumTypeDef.
type EnumTypeDefID string
// The `EnumValueTypeDefID` scalar type represents an identifier for an object of type EnumValueTypeDef.
type EnumValueTypeDefID string
// The `EnvFileID` scalar type represents an identifier for an object of type EnvFile.
type EnvFileID string
// The `EnvID` scalar type represents an identifier for an object of type Env.
type EnvID string
// The `EnvVariableID` scalar type represents an identifier for an object of type EnvVariable.
type EnvVariableID string
// The `ErrorID` scalar type represents an identifier for an object of type Error.
type ErrorID string
// The `ErrorValueID` scalar type represents an identifier for an object of type ErrorValue.
type ErrorValueID string
// The `FieldTypeDefID` scalar type represents an identifier for an object of type FieldTypeDef.
type FieldTypeDefID string
// The `FileID` scalar type represents an identifier for an object of type File.
type FileID string
// The `FunctionArgID` scalar type represents an identifier for an object of type FunctionArg.
type FunctionArgID string
// The `FunctionCallArgValueID` scalar type represents an identifier for an object of type FunctionCallArgValue.
type FunctionCallArgValueID string
// The `FunctionCallID` scalar type represents an identifier for an object of type FunctionCall.
type FunctionCallID string
// The `FunctionID` scalar type represents an identifier for an object of type Function.
type FunctionID string
// The `GeneratedCodeID` scalar type represents an identifier for an object of type GeneratedCode.
type GeneratedCodeID string
// The `GeneratorGroupID` scalar type represents an identifier for an object of type GeneratorGroup.
type GeneratorGroupID string
// The `GeneratorID` scalar type represents an identifier for an object of type Generator.
type GeneratorID string
// The `GitRefID` scalar type represents an identifier for an object of type GitRef.
type GitRefID string
// The `GitRepositoryID` scalar type represents an identifier for an object of type GitRepository.
type GitRepositoryID string
// The `HTTPStateID` scalar type represents an identifier for an object of type HTTPState.
type HTTPStateID string
// The `HealthcheckConfigID` scalar type represents an identifier for an object of type HealthcheckConfig.
type HealthcheckConfigID string
// The `HostID` scalar type represents an identifier for an object of type Host.
type HostID string
// The `InputTypeDefID` scalar type represents an identifier for an object of type InputTypeDef.
type InputTypeDefID string
// The `InterfaceTypeDefID` scalar type represents an identifier for an object of type InterfaceTypeDef.
type InterfaceTypeDefID string
// An arbitrary JSON-encoded value.
type JSON string
// The `JSONValueID` scalar type represents an identifier for an object of type JSONValue.
type JSONValueID string
// The `LLMID` scalar type represents an identifier for an object of type LLM.
type LLMID string
// The `LLMTokenUsageID` scalar type represents an identifier for an object of type LLMTokenUsage.
type LLMTokenUsageID string
// The `LabelID` scalar type represents an identifier for an object of type Label.
type LabelID string
// The `ListTypeDefID` scalar type represents an identifier for an object of type ListTypeDef.
type ListTypeDefID string
// The `ModuleConfigClientID` scalar type represents an identifier for an object of type ModuleConfigClient.
type ModuleConfigClientID string
// The `ModuleID` scalar type represents an identifier for an object of type Module.
type ModuleID string
// The `ModuleSourceID` scalar type represents an identifier for an object of type ModuleSource.
type ModuleSourceID string
// The `ObjectTypeDefID` scalar type represents an identifier for an object of type ObjectTypeDef.
type ObjectTypeDefID string
// The platform config OS and architecture in a Container.
//
// The format is [os]/[platform]/[version] (e.g., "darwin/arm64/v7", "windows/amd64", "linux/arm64").
type Platform string
// The `PortID` scalar type represents an identifier for an object of type Port.
type PortID string
// The `QueryID` scalar type represents an identifier for an object of type Query.
type QueryID string
// The `RemoteGitMirrorID` scalar type represents an identifier for an object of type RemoteGitMirror.
type RemoteGitMirrorID string
// The `SDKConfigID` scalar type represents an identifier for an object of type SDKConfig.
type SDKConfigID string
// The `ScalarTypeDefID` scalar type represents an identifier for an object of type ScalarTypeDef.
type ScalarTypeDefID string
// The `SearchResultID` scalar type represents an identifier for an object of type SearchResult.
type SearchResultID string
// The `SearchSubmatchID` scalar type represents an identifier for an object of type SearchSubmatch.
type SearchSubmatchID string
// The `SecretID` scalar type represents an identifier for an object of type Secret.
type SecretID string
// The `ServiceID` scalar type represents an identifier for an object of type Service.
type ServiceID string
// The `SocketID` scalar type represents an identifier for an object of type Socket.
type SocketID string
// The `SourceMapID` scalar type represents an identifier for an object of type SourceMap.
type SourceMapID string
// The `StatID` scalar type represents an identifier for an object of type Stat.
type StatID string
// The `TerminalID` scalar type represents an identifier for an object of type Terminal.
type TerminalID string
// The `TypeDefID` scalar type represents an identifier for an object of type TypeDef.
type TypeDefID string
// The `UpGroupID` scalar type represents an identifier for an object of type UpGroup.
type UpGroupID string
// The `UpID` scalar type represents an identifier for an object of type Up.
type UpID string
// The absence of a value.
//
// A Null Void is used as a placeholder for resolvers that do not return anything.
type Void string
// The `WorkspaceID` scalar type represents an identifier for an object of type Workspace.
type WorkspaceID string
// Key value object that represents a build argument.
type BuildArg struct {
// The build argument name.
Name string `json:"name"`
// The build argument value.
Value string `json:"value"`
}
// Key value object that represents a pipeline label.
type PipelineLabel struct {
// Label name.
Name string `json:"name"`
// Label value.
Value string `json:"value"`
}
// Port forwarding rules for tunneling network traffic.
type PortForward struct {
// Destination port for traffic.
Backend int `json:"backend"`
// Port to expose to clients. If unspecified, a default will be chosen.
Frontend int `json:"frontend"`
// Transport layer protocol to use for traffic.
Protocol NetworkProtocol `json:"protocol,omitempty"`
}
// A standardized address to load containers, directories, secrets, and other object types. Address format depends on the type, and is validated at type selection.
type Address struct {
query *querybuilder.Selection
id *AddressID
value *string
}
func (r *Address) WithGraphQLQuery(q *querybuilder.Selection) *Address {
return &Address{
query: q,
}
}
// Load a container from the address.
func (r *Address) Container() *Container {
q := r.query.Select("container")
return &Container{
query: q,
}
}
// AddressDirectoryOpts contains options for Address.Directory
type AddressDirectoryOpts struct {
Exclude []string
Include []string
Gitignore bool
NoCache bool
}
// Load a directory from the address.
func (r *Address) Directory(opts ...AddressDirectoryOpts) *Directory {
q := r.query.Select("directory")
for i := len(opts) - 1; i >= 0; i-- {
// `exclude` optional argument
if !querybuilder.IsZeroValue(opts[i].Exclude) {
q = q.Arg("exclude", opts[i].Exclude)
}
// `include` optional argument
if !querybuilder.IsZeroValue(opts[i].Include) {
q = q.Arg("include", opts[i].Include)
}
// `gitignore` optional argument
if !querybuilder.IsZeroValue(opts[i].Gitignore) {
q = q.Arg("gitignore", opts[i].Gitignore)
}
// `noCache` optional argument
if !querybuilder.IsZeroValue(opts[i].NoCache) {
q = q.Arg("noCache", opts[i].NoCache)
}
}
return &Directory{
query: q,
}
}
// AddressFileOpts contains options for Address.File
type AddressFileOpts struct {
Exclude []string
Include []string
Gitignore bool
NoCache bool
}
// Load a file from the address.
func (r *Address) File(opts ...AddressFileOpts) *File {
q := r.query.Select("file")
for i := len(opts) - 1; i >= 0; i-- {
// `exclude` optional argument
if !querybuilder.IsZeroValue(opts[i].Exclude) {
q = q.Arg("exclude", opts[i].Exclude)
}
// `include` optional argument
if !querybuilder.IsZeroValue(opts[i].Include) {
q = q.Arg("include", opts[i].Include)
}
// `gitignore` optional argument
if !querybuilder.IsZeroValue(opts[i].Gitignore) {
q = q.Arg("gitignore", opts[i].Gitignore)
}
// `noCache` optional argument
if !querybuilder.IsZeroValue(opts[i].NoCache) {
q = q.Arg("noCache", opts[i].NoCache)
}
}
return &File{
query: q,
}
}
// Load a git ref (branch, tag or commit) from the address.
func (r *Address) GitRef() *GitRef {
q := r.query.Select("gitRef")
return &GitRef{
query: q,
}
}
// Load a git repository from the address.
func (r *Address) GitRepository() *GitRepository {
q := r.query.Select("gitRepository")
return &GitRepository{
query: q,
}
}
// A unique identifier for this Address.
func (r *Address) ID(ctx context.Context) (AddressID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.query.Select("id")
var response AddressID
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Address) XXX_GraphQLType() string {
return "Address"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Address) XXX_GraphQLIDType() string {
return "AddressID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Address) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Address) MarshalJSON() ([]byte, error) {
id, err := r.ID(marshalCtx)
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Load a secret from the address.
func (r *Address) Secret() *Secret {
q := r.query.Select("secret")
return &Secret{
query: q,
}
}
// Load a service from the address.
func (r *Address) Service() *Service {
q := r.query.Select("service")
return &Service{
query: q,
}
}
// Load a local socket from the address.
func (r *Address) Socket() *Socket {
q := r.query.Select("socket")
return &Socket{
query: q,
}
}
// The address value
func (r *Address) Value(ctx context.Context) (string, error) {
if r.value != nil {
return *r.value, nil
}
q := r.query.Select("value")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx)
}
type Binding struct {
query *querybuilder.Selection
asString *string
digest *string
id *BindingID
isNull *bool
name *string
typeName *string
}
func (r *Binding) WithGraphQLQuery(q *querybuilder.Selection) *Binding {
return &Binding{
query: q,
}
}
// Retrieve the binding value, as type Address
func (r *Binding) AsAddress() *Address {
q := r.query.Select("asAddress")
return &Address{
query: q,
}
}
// Retrieve the binding value, as type CacheVolume
func (r *Binding) AsCacheVolume() *CacheVolume {
q := r.query.Select("asCacheVolume")
return &CacheVolume{
query: q,
}
}
// Retrieve the binding value, as type Changeset
func (r *Binding) AsChangeset() *Changeset {
q := r.query.Select("asChangeset")
return &Changeset{
query: q,
}
}
// Retrieve the binding value, as type Check
func (r *Binding) AsCheck() *Check {
q := r.query.Select("asCheck")
return &Check{
query: q,
}
}
// Retrieve the binding value, as type CheckGroup
func (r *Binding) AsCheckGroup() *CheckGroup {
q := r.query.Select("asCheckGroup")
return &CheckGroup{
query: q,
}
}
// Retrieve the binding value, as type Cloud
func (r *Binding) AsCloud() *Cloud {
q := r.query.Select("asCloud")
return &Cloud{
query: q,
}
}
// Retrieve the binding value, as type Container
func (r *Binding) AsContainer() *Container {
q := r.query.Select("asContainer")
return &Container{
query: q,
}
}
// Retrieve the binding value, as type DiffStat
func (r *Binding) AsDiffStat() *DiffStat {
q := r.query.Select("asDiffStat")
return &DiffStat{
query: q,
}
}
// Retrieve the binding value, as type Directory
func (r *Binding) AsDirectory() *Directory {
q := r.query.Select("asDirectory")
return &Directory{
query: q,
}
}
// Retrieve the binding value, as type Env
func (r *Binding) AsEnv() *Env {
q := r.query.Select("asEnv")
return &Env{
query: q,
}
}
// Retrieve the binding value, as type EnvFile
func (r *Binding) AsEnvFile() *EnvFile {
q := r.query.Select("asEnvFile")
return &EnvFile{
query: q,
}
}
// Retrieve the binding value, as type File
func (r *Binding) AsFile() *File {
q := r.query.Select("asFile")
return &File{
query: q,
}
}
// Retrieve the binding value, as type Generator
func (r *Binding) AsGenerator() *Generator {
q := r.query.Select("asGenerator")
return &Generator{
query: q,
}
}
// Retrieve the binding value, as type GeneratorGroup
func (r *Binding) AsGeneratorGroup() *GeneratorGroup {
q := r.query.Select("asGeneratorGroup")
return &GeneratorGroup{
query: q,
}
}
// Retrieve the binding value, as type GitRef
func (r *Binding) AsGitRef() *GitRef {
q := r.query.Select("asGitRef")
return &GitRef{
query: q,
}
}
// Retrieve the binding value, as type GitRepository
func (r *Binding) AsGitRepository() *GitRepository {
q := r.query.Select("asGitRepository")
return &GitRepository{
query: q,
}
}
// Retrieve the binding value, as type HTTPState
func (r *Binding) AsHTTPState() *HTTPState {
q := r.query.Select("asHTTPState")
return &HTTPState{
query: q,
}
}
// Retrieve the binding value, as type JSONValue
func (r *Binding) AsJSONValue() *JSONValue {
q := r.query.Select("asJSONValue")
return &JSONValue{
query: q,
}
}
// Retrieve the binding value, as type Module
func (r *Binding) AsModule() *Module {
q := r.query.Select("asModule")
return &Module{
query: q,
}
}
// Retrieve the binding value, as type ModuleConfigClient
func (r *Binding) AsModuleConfigClient() *ModuleConfigClient {
q := r.query.Select("asModuleConfigClient")
return &ModuleConfigClient{
query: q,
}
}
// Retrieve the binding value, as type ModuleSource
func (r *Binding) AsModuleSource() *ModuleSource {
q := r.query.Select("asModuleSource")
return &ModuleSource{
query: q,
}
}
// Retrieve the binding value, as type SearchResult
func (r *Binding) AsSearchResult() *SearchResult {
q := r.query.Select("asSearchResult")
return &SearchResult{
query: q,
}
}
// Retrieve the binding value, as type SearchSubmatch
func (r *Binding) AsSearchSubmatch() *SearchSubmatch {
q := r.query.Select("asSearchSubmatch")
return &SearchSubmatch{
query: q,
}
}
// Retrieve the binding value, as type Secret
func (r *Binding) AsSecret() *Secret {
q := r.query.Select("asSecret")
return &Secret{
query: q,
}
}
// Retrieve the binding value, as type Service
func (r *Binding) AsService() *Service {
q := r.query.Select("asService")
return &Service{
query: q,
}
}
// Retrieve the binding value, as type Socket
func (r *Binding) AsSocket() *Socket {
q := r.query.Select("asSocket")
return &Socket{
query: q,
}
}
// Retrieve the binding value, as type Stat
func (r *Binding) AsStat() *Stat {
q := r.query.Select("asStat")
return &Stat{
query: q,
}
}
// Returns the binding's string value
func (r *Binding) AsString(ctx context.Context) (string, error) {
if r.asString != nil {
return *r.asString, nil
}
q := r.query.Select("asString")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// Retrieve the binding value, as type Up
func (r *Binding) AsUp() *Up {
q := r.query.Select("asUp")
return &Up{
query: q,
}
}
// Retrieve the binding value, as type UpGroup
func (r *Binding) AsUpGroup() *UpGroup {
q := r.query.Select("asUpGroup")
return &UpGroup{
query: q,
}
}
// Retrieve the binding value, as type Workspace
func (r *Binding) AsWorkspace() *Workspace {
q := r.query.Select("asWorkspace")
return &Workspace{
query: q,
}
}
// Returns the digest of the binding value
func (r *Binding) Digest(ctx context.Context) (string, error) {
if r.digest != nil {
return *r.digest, nil
}
q := r.query.Select("digest")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// A unique identifier for this Binding.
func (r *Binding) ID(ctx context.Context) (BindingID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.query.Select("id")
var response BindingID
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *Binding) XXX_GraphQLType() string {
return "Binding"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *Binding) XXX_GraphQLIDType() string {
return "BindingID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *Binding) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err
}
return string(id), nil
}
func (r *Binding) MarshalJSON() ([]byte, error) {
id, err := r.ID(marshalCtx)
if err != nil {
return nil, err
}
return json.Marshal(id)
}
// Returns true if the binding is null
func (r *Binding) IsNull(ctx context.Context) (bool, error) {
if r.isNull != nil {
return *r.isNull, nil
}
q := r.query.Select("isNull")
var response bool
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// Returns the binding name
func (r *Binding) Name(ctx context.Context) (string, error) {
if r.name != nil {
return *r.name, nil
}
q := r.query.Select("name")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// Returns the binding type
func (r *Binding) TypeName(ctx context.Context) (string, error) {
if r.typeName != nil {
return *r.typeName, nil
}
q := r.query.Select("typeName")
var response string
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// A directory whose contents persist across runs.
type CacheVolume struct {
query *querybuilder.Selection
id *CacheVolumeID
}
func (r *CacheVolume) WithGraphQLQuery(q *querybuilder.Selection) *CacheVolume {
return &CacheVolume{
query: q,
}
}
// A unique identifier for this CacheVolume.
func (r *CacheVolume) ID(ctx context.Context) (CacheVolumeID, error) {
if r.id != nil {
return *r.id, nil
}
q := r.query.Select("id")
var response CacheVolumeID
q = q.Bind(&response)
return response, q.Execute(ctx)
}
// XXX_GraphQLType is an internal function. It returns the native GraphQL type name
func (r *CacheVolume) XXX_GraphQLType() string {
return "CacheVolume"
}
// XXX_GraphQLIDType is an internal function. It returns the native GraphQL type name for the ID of this object
func (r *CacheVolume) XXX_GraphQLIDType() string {
return "CacheVolumeID"
}
// XXX_GraphQLID is an internal function. It returns the underlying type ID
func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error) {
id, err := r.ID(ctx)
if err != nil {
return "", err