-
Notifications
You must be signed in to change notification settings - Fork 0
/
items.pb.go
1932 lines (1691 loc) · 68.1 KB
/
items.pb.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 protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.35.1
// protoc (unknown)
// source: items.proto
package sdp
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
structpb "google.golang.org/protobuf/types/known/structpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Represents the health of something, the meaning of each state may depend on
// the context in which it is used but should be reasonably obvious
type Health int32
const (
Health_HEALTH_UNKNOWN Health = 0 // The health could not be determined
Health_HEALTH_OK Health = 1 // Functioning normally
Health_HEALTH_WARNING Health = 2 // Functioning, but degraded
Health_HEALTH_ERROR Health = 3 // Not functioning
Health_HEALTH_PENDING Health = 4 // Health state is transitioning, such as when something is first provisioned
)
// Enum value maps for Health.
var (
Health_name = map[int32]string{
0: "HEALTH_UNKNOWN",
1: "HEALTH_OK",
2: "HEALTH_WARNING",
3: "HEALTH_ERROR",
4: "HEALTH_PENDING",
}
Health_value = map[string]int32{
"HEALTH_UNKNOWN": 0,
"HEALTH_OK": 1,
"HEALTH_WARNING": 2,
"HEALTH_ERROR": 3,
"HEALTH_PENDING": 4,
}
)
func (x Health) Enum() *Health {
p := new(Health)
*p = x
return p
}
func (x Health) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Health) Descriptor() protoreflect.EnumDescriptor {
return file_items_proto_enumTypes[0].Descriptor()
}
func (Health) Type() protoreflect.EnumType {
return &file_items_proto_enumTypes[0]
}
func (x Health) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Health.Descriptor instead.
func (Health) EnumDescriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{0}
}
// QueryMethod represents the available query methods. The details of these
// methods are:
//
// GET: This takes a single unique query and should only return a single item.
//
// If an item matching the parameter passed doesn't exist the server should
// fail
//
// LIST: This takes no query (or ignores it) and should return all items that it
//
// can find
//
// SEARCH: This takes a non-unique query which is designed to be used as a
//
// search term. It should return some number of items (or zero) which
// match the query
type QueryMethod int32
const (
QueryMethod_GET QueryMethod = 0
QueryMethod_LIST QueryMethod = 1
QueryMethod_SEARCH QueryMethod = 2
)
// Enum value maps for QueryMethod.
var (
QueryMethod_name = map[int32]string{
0: "GET",
1: "LIST",
2: "SEARCH",
}
QueryMethod_value = map[string]int32{
"GET": 0,
"LIST": 1,
"SEARCH": 2,
}
)
func (x QueryMethod) Enum() *QueryMethod {
p := new(QueryMethod)
*p = x
return p
}
func (x QueryMethod) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (QueryMethod) Descriptor() protoreflect.EnumDescriptor {
return file_items_proto_enumTypes[1].Descriptor()
}
func (QueryMethod) Type() protoreflect.EnumType {
return &file_items_proto_enumTypes[1]
}
func (x QueryMethod) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use QueryMethod.Descriptor instead.
func (QueryMethod) EnumDescriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{1}
}
// The error type. Any types in here will be gracefully handled unless the
// type os "OTHER"
type QueryStatus_Status int32
const (
// the status has not been specified
QueryStatus_UNSPECIFIED QueryStatus_Status = 0
// the query has been started
QueryStatus_STARTED QueryStatus_Status = 1
// the query has been cancelled.
// This is a final state.
QueryStatus_CANCELLED QueryStatus_Status = 3
// the query has finished with an error status. expect a separate QueryError describing that.
// This is a final state.
// TODO: fold the error details into this message
QueryStatus_ERRORED QueryStatus_Status = 4
// The query has finished and all results have been sent over the wire
// This is a final state.
QueryStatus_FINISHED QueryStatus_Status = 5
)
// Enum value maps for QueryStatus_Status.
var (
QueryStatus_Status_name = map[int32]string{
0: "UNSPECIFIED",
1: "STARTED",
3: "CANCELLED",
4: "ERRORED",
5: "FINISHED",
}
QueryStatus_Status_value = map[string]int32{
"UNSPECIFIED": 0,
"STARTED": 1,
"CANCELLED": 3,
"ERRORED": 4,
"FINISHED": 5,
}
)
func (x QueryStatus_Status) Enum() *QueryStatus_Status {
p := new(QueryStatus_Status)
*p = x
return p
}
func (x QueryStatus_Status) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (QueryStatus_Status) Descriptor() protoreflect.EnumDescriptor {
return file_items_proto_enumTypes[2].Descriptor()
}
func (QueryStatus_Status) Type() protoreflect.EnumType {
return &file_items_proto_enumTypes[2]
}
func (x QueryStatus_Status) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use QueryStatus_Status.Descriptor instead.
func (QueryStatus_Status) EnumDescriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{9, 0}
}
// The error type. Any types in here will be gracefully handled unless the
// type os "OTHER"
type QueryError_ErrorType int32
const (
// This should be used of all other failure modes, such as timeouts,
// unexpected failures when querying state, permissions errors etc. Errors
// that return this type should not be cached as the error may be transient.
QueryError_OTHER QueryError_ErrorType = 0
// NOTFOUND means that the item was not found. This is only returned as the
// result of a GET query since all other queries would return an empty
// list instead
QueryError_NOTFOUND QueryError_ErrorType = 1
// NOSCOPE means that the item was not found because we don't have
// access to the requested scope. This should not be interpreted as "The
// item doesn't exist" (as with a NOTFOUND error) but rather as "We can't
// tell you whether or not the item exists"
QueryError_NOSCOPE QueryError_ErrorType = 2
// TIMEOUT means that the source times out when trying to query the item.
// The timeout is provided in the original query
QueryError_TIMEOUT QueryError_ErrorType = 3
)
// Enum value maps for QueryError_ErrorType.
var (
QueryError_ErrorType_name = map[int32]string{
0: "OTHER",
1: "NOTFOUND",
2: "NOSCOPE",
3: "TIMEOUT",
}
QueryError_ErrorType_value = map[string]int32{
"OTHER": 0,
"NOTFOUND": 1,
"NOSCOPE": 2,
"TIMEOUT": 3,
}
)
func (x QueryError_ErrorType) Enum() *QueryError_ErrorType {
p := new(QueryError_ErrorType)
*p = x
return p
}
func (x QueryError_ErrorType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (QueryError_ErrorType) Descriptor() protoreflect.EnumDescriptor {
return file_items_proto_enumTypes[3].Descriptor()
}
func (QueryError_ErrorType) Type() protoreflect.EnumType {
return &file_items_proto_enumTypes[3]
}
func (x QueryError_ErrorType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use QueryError_ErrorType.Descriptor instead.
func (QueryError_ErrorType) EnumDescriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{10, 0}
}
// This message stores additional information on Edges (and edge-like constructs) to determine how configuration changes can impact
// the linked items.
//
// Blast Propagation options:
//
// |-------|-------|----------------------
// | in | out | result
// |-------|-------|----------------------
// | false | false | no change in any item can affect the other
// | false | true | a change to this item can affect its linked items
// | | | example: a change to an EC2 instance can affect its DNS name (in the sense that other items depending on that DNS name will see the impact)
// | true | false | a change to linked items can affect this item
// | | | example: changing the KMS key used by a DynamoDB table can impact the table, but no change to the table can impact the key
// | true | true | changes on both sides of the link can affect the other
// | | | example: changes to both EC2 Instances and their volumes can affect the other side of the relation.
type BlastPropagation struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// is true if changes on linked items can affect this item
In bool `protobuf:"varint,1,opt,name=in,proto3" json:"in,omitempty"`
// is true if changes on this item can affect linked items
Out bool `protobuf:"varint,2,opt,name=out,proto3" json:"out,omitempty"`
}
func (x *BlastPropagation) Reset() {
*x = BlastPropagation{}
mi := &file_items_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *BlastPropagation) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BlastPropagation) ProtoMessage() {}
func (x *BlastPropagation) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BlastPropagation.ProtoReflect.Descriptor instead.
func (*BlastPropagation) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{0}
}
func (x *BlastPropagation) GetIn() bool {
if x != nil {
return x.In
}
return false
}
func (x *BlastPropagation) GetOut() bool {
if x != nil {
return x.Out
}
return false
}
// An annotated query to indicate potential linked items.
type LinkedItemQuery struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the query that would find linked items
Query *Query `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// how configuration changes (i.e. the "blast") propagates over this link
BlastPropagation *BlastPropagation `protobuf:"bytes,2,opt,name=blastPropagation,proto3" json:"blastPropagation,omitempty"`
}
func (x *LinkedItemQuery) Reset() {
*x = LinkedItemQuery{}
mi := &file_items_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LinkedItemQuery) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LinkedItemQuery) ProtoMessage() {}
func (x *LinkedItemQuery) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LinkedItemQuery.ProtoReflect.Descriptor instead.
func (*LinkedItemQuery) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{1}
}
func (x *LinkedItemQuery) GetQuery() *Query {
if x != nil {
return x.Query
}
return nil
}
func (x *LinkedItemQuery) GetBlastPropagation() *BlastPropagation {
if x != nil {
return x.BlastPropagation
}
return nil
}
// An annotated reference to list linked items.
type LinkedItem struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// the linked item
Item *Reference `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
// how configuration changes (i.e. the "blast") propagates over this link
BlastPropagation *BlastPropagation `protobuf:"bytes,2,opt,name=blastPropagation,proto3" json:"blastPropagation,omitempty"`
}
func (x *LinkedItem) Reset() {
*x = LinkedItem{}
mi := &file_items_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LinkedItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LinkedItem) ProtoMessage() {}
func (x *LinkedItem) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LinkedItem.ProtoReflect.Descriptor instead.
func (*LinkedItem) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{2}
}
func (x *LinkedItem) GetItem() *Reference {
if x != nil {
return x.Item
}
return nil
}
func (x *LinkedItem) GetBlastPropagation() *BlastPropagation {
if x != nil {
return x.BlastPropagation
}
return nil
}
// This is the same as Item within the package with a couple of exceptions, no
// real reason why this whole thing couldn't be modelled in protobuf though if
// required. Just need to decide what if anything should remain private
type Item struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
UniqueAttribute string `protobuf:"bytes,2,opt,name=uniqueAttribute,proto3" json:"uniqueAttribute,omitempty"`
Attributes *ItemAttributes `protobuf:"bytes,3,opt,name=attributes,proto3" json:"attributes,omitempty"`
Metadata *Metadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata,omitempty"`
// The scope within which the item is unique. Item uniqueness is determined
// by the combination of type and uniqueAttribute value. However it is
// possible for the same item to exist in many scopes. There is not formal
// definition for what a scope should be other than the fact that it should
// be somewhat descriptive and should ensure item uniqueness
Scope string `protobuf:"bytes,5,opt,name=scope,proto3" json:"scope,omitempty"`
// Not all items will have relatedItems we are are using a two byte
// integer to save one byte integers for more common things
LinkedItemQueries []*LinkedItemQuery `protobuf:"bytes,16,rep,name=linkedItemQueries,proto3" json:"linkedItemQueries,omitempty"`
// Linked items
LinkedItems []*LinkedItem `protobuf:"bytes,17,rep,name=linkedItems,proto3" json:"linkedItems,omitempty"`
// (optional) Represents the health of the item. Only items that have a
// clearly relevant health attribute should return a value for health
Health *Health `protobuf:"varint,18,opt,name=health,proto3,enum=Health,oneof" json:"health,omitempty"`
// Arbitrary key-value pairs that can be used to store additional information.
// These tags are retrieved from the source and map to the target's definition
// of a tag (e.g. AWS tags, Kubernetes labels, etc.)
Tags map[string]string `protobuf:"bytes,19,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *Item) Reset() {
*x = Item{}
mi := &file_items_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Item) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Item) ProtoMessage() {}
func (x *Item) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Item.ProtoReflect.Descriptor instead.
func (*Item) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{3}
}
func (x *Item) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Item) GetUniqueAttribute() string {
if x != nil {
return x.UniqueAttribute
}
return ""
}
func (x *Item) GetAttributes() *ItemAttributes {
if x != nil {
return x.Attributes
}
return nil
}
func (x *Item) GetMetadata() *Metadata {
if x != nil {
return x.Metadata
}
return nil
}
func (x *Item) GetScope() string {
if x != nil {
return x.Scope
}
return ""
}
func (x *Item) GetLinkedItemQueries() []*LinkedItemQuery {
if x != nil {
return x.LinkedItemQueries
}
return nil
}
func (x *Item) GetLinkedItems() []*LinkedItem {
if x != nil {
return x.LinkedItems
}
return nil
}
func (x *Item) GetHealth() Health {
if x != nil && x.Health != nil {
return *x.Health
}
return Health_HEALTH_UNKNOWN
}
func (x *Item) GetTags() map[string]string {
if x != nil {
return x.Tags
}
return nil
}
// ItemAttributes represents the known attributes for an item. These are likely
// to be common to a given type, but even this is not guaranteed. All items must
// have at least one attribute however as it needs something to uniquely
// identify it
type ItemAttributes struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
AttrStruct *structpb.Struct `protobuf:"bytes,1,opt,name=attrStruct,proto3" json:"attrStruct,omitempty"`
}
func (x *ItemAttributes) Reset() {
*x = ItemAttributes{}
mi := &file_items_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ItemAttributes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ItemAttributes) ProtoMessage() {}
func (x *ItemAttributes) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ItemAttributes.ProtoReflect.Descriptor instead.
func (*ItemAttributes) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{4}
}
func (x *ItemAttributes) GetAttrStruct() *structpb.Struct {
if x != nil {
return x.AttrStruct
}
return nil
}
// Metadata about the item. Where it came from, how long it took, etc.
type Metadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// This is the name of the source that was used to find the item.
SourceName string `protobuf:"bytes,2,opt,name=sourceName,proto3" json:"sourceName,omitempty"`
// The query that caused this item to be found. This is for gateway-internal use and will not be exposed to the frontend.
SourceQuery *Query `protobuf:"bytes,3,opt,name=sourceQuery,proto3" json:"sourceQuery,omitempty"`
// The time that the item was found
Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// How long the source took to execute in total when processing the
// Query
SourceDuration *durationpb.Duration `protobuf:"bytes,5,opt,name=sourceDuration,proto3" json:"sourceDuration,omitempty"`
// How long the source took to execute per item when processing the
// Query
SourceDurationPerItem *durationpb.Duration `protobuf:"bytes,6,opt,name=sourceDurationPerItem,proto3" json:"sourceDurationPerItem,omitempty"`
// Whether the item should be hidden/ignored by user-facing things such as
// GUIs and databases.
//
// Some types of items are only relevant in calculating higher-layer
// abstractions and are therefore always hidden. A good example of this would
// be the output of a command. This could be used by a remote source to gather
// information, but we don't actually want to show the user all the commands
// that were run, just the final item returned by the source
Hidden bool `protobuf:"varint,7,opt,name=hidden,proto3" json:"hidden,omitempty"`
// The UUID of the QUERY that caused this item to be found
//
// Deprecated: Marked as deprecated in items.proto.
SourceQueryUUID []byte `protobuf:"bytes,8,opt,name=sourceQueryUUID,proto3" json:"sourceQueryUUID,omitempty"`
}
func (x *Metadata) Reset() {
*x = Metadata{}
mi := &file_items_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Metadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Metadata) ProtoMessage() {}
func (x *Metadata) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Metadata.ProtoReflect.Descriptor instead.
func (*Metadata) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{5}
}
func (x *Metadata) GetSourceName() string {
if x != nil {
return x.SourceName
}
return ""
}
func (x *Metadata) GetSourceQuery() *Query {
if x != nil {
return x.SourceQuery
}
return nil
}
func (x *Metadata) GetTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.Timestamp
}
return nil
}
func (x *Metadata) GetSourceDuration() *durationpb.Duration {
if x != nil {
return x.SourceDuration
}
return nil
}
func (x *Metadata) GetSourceDurationPerItem() *durationpb.Duration {
if x != nil {
return x.SourceDurationPerItem
}
return nil
}
func (x *Metadata) GetHidden() bool {
if x != nil {
return x.Hidden
}
return false
}
// Deprecated: Marked as deprecated in items.proto.
func (x *Metadata) GetSourceQueryUUID() []byte {
if x != nil {
return x.SourceQueryUUID
}
return nil
}
// This is a list of items, like a List() would return
type Items struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
}
func (x *Items) Reset() {
*x = Items{}
mi := &file_items_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Items) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Items) ProtoMessage() {}
func (x *Items) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Items.ProtoReflect.Descriptor instead.
func (*Items) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{6}
}
func (x *Items) GetItems() []*Item {
if x != nil {
return x.Items
}
return nil
}
// Query represents a query for an item or a list of items.
type Query struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The type of item to search for. "*" means all types
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
// Which method to use when looking for it
Method QueryMethod `protobuf:"varint,2,opt,name=method,proto3,enum=QueryMethod" json:"method,omitempty"`
// What query should be passed to that method
Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
// Defines how this query should behave when finding new items
RecursionBehaviour *Query_RecursionBehaviour `protobuf:"bytes,4,opt,name=recursionBehaviour,proto3" json:"recursionBehaviour,omitempty"`
// The scope for which we are requesting. To query all scopes use the the
// wildcard '*'
Scope string `protobuf:"bytes,5,opt,name=scope,proto3" json:"scope,omitempty"`
// Whether to ignore the cache and execute the query regardless.
//
// By default sources will implement some level of caching, this is
// particularly important for linked items as a single query with a large link
// depth may result in the same item being queried many times as links are
// resolved and more and more items link to each other. However if required
// this caching can be turned off using this parameter
IgnoreCache bool `protobuf:"varint,6,opt,name=ignoreCache,proto3" json:"ignoreCache,omitempty"`
// A UUID to uniquely identify the query. This should be stored by the
// requester as it will be needed later if the requester wants to cancel a
// query. It should be stored as 128 bytes, as opposed to the textual
// representation
UUID []byte `protobuf:"bytes,7,opt,name=UUID,proto3" json:"UUID,omitempty"`
// The deadline for this query. When the deadline elapses, results become
// irrelevant for the sender and any processing can stop. The deadline gets
// propagated to all related queries (e.g. for linked items) and processes.
// Note: there is currently a migration going on from timeouts to durations,
// so depending on which service is hit, either one is evaluated.
Deadline *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=deadline,proto3" json:"deadline,omitempty"`
}
func (x *Query) Reset() {
*x = Query{}
mi := &file_items_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Query) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Query) ProtoMessage() {}
func (x *Query) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Query.ProtoReflect.Descriptor instead.
func (*Query) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{7}
}
func (x *Query) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Query) GetMethod() QueryMethod {
if x != nil {
return x.Method
}
return QueryMethod_GET
}
func (x *Query) GetQuery() string {
if x != nil {
return x.Query
}
return ""
}
func (x *Query) GetRecursionBehaviour() *Query_RecursionBehaviour {
if x != nil {
return x.RecursionBehaviour
}
return nil
}
func (x *Query) GetScope() string {
if x != nil {
return x.Scope
}
return ""
}
func (x *Query) GetIgnoreCache() bool {
if x != nil {
return x.IgnoreCache
}
return false
}
func (x *Query) GetUUID() []byte {
if x != nil {
return x.UUID
}
return nil
}
func (x *Query) GetDeadline() *timestamppb.Timestamp {
if x != nil {
return x.Deadline
}
return nil
}
type QueryResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to ResponseType:
//
// *QueryResponse_NewItem
// *QueryResponse_Response
// *QueryResponse_Error
ResponseType isQueryResponse_ResponseType `protobuf_oneof:"response_type"`
}
func (x *QueryResponse) Reset() {
*x = QueryResponse{}
mi := &file_items_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *QueryResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*QueryResponse) ProtoMessage() {}
func (x *QueryResponse) ProtoReflect() protoreflect.Message {
mi := &file_items_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) Descriptor() ([]byte, []int) {
return file_items_proto_rawDescGZIP(), []int{8}
}
func (m *QueryResponse) GetResponseType() isQueryResponse_ResponseType {
if m != nil {
return m.ResponseType
}
return nil
}
func (x *QueryResponse) GetNewItem() *Item {
if x, ok := x.GetResponseType().(*QueryResponse_NewItem); ok {
return x.NewItem
}
return nil
}
func (x *QueryResponse) GetResponse() *Response {
if x, ok := x.GetResponseType().(*QueryResponse_Response); ok {
return x.Response
}
return nil
}
func (x *QueryResponse) GetError() *QueryError {
if x, ok := x.GetResponseType().(*QueryResponse_Error); ok {
return x.Error
}
return nil
}
type isQueryResponse_ResponseType interface {
isQueryResponse_ResponseType()
}
type QueryResponse_NewItem struct {
NewItem *Item `protobuf:"bytes,2,opt,name=newItem,proto3,oneof"` // A new item that has been discovered
}
type QueryResponse_Response struct {
Response *Response `protobuf:"bytes,3,opt,name=response,proto3,oneof"` // Status update
}