-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvocation_policy.pb.go
More file actions
885 lines (787 loc) · 32.7 KB
/
invocation_policy.pb.go
File metadata and controls
885 lines (787 loc) · 32.7 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
// Copyright 2015 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc v5.27.2
// source: invocation_policy.proto
package proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
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)
)
type SetValue_Behavior int32
const (
SetValue_UNDEFINED SetValue_Behavior = 0
// Change the flag value but allow it to be overridden by explicit settings
// from command line/config expansion/rc files.
// Matching old flag values: append = false, overridable = true.
SetValue_ALLOW_OVERRIDES SetValue_Behavior = 1
// Append a new value for a repeatable flag, leave old values and allow
// further overrides.
// Matching old flag values: append = true, overridable = false.
SetValue_APPEND SetValue_Behavior = 2
// Set a final value of the flag. Any overrides provided by the user for
// this flag will be ignored.
// Matching old flag values: append = false, overridable = false.
SetValue_FINAL_VALUE_IGNORE_OVERRIDES SetValue_Behavior = 3
)
// Enum value maps for SetValue_Behavior.
var (
SetValue_Behavior_name = map[int32]string{
0: "UNDEFINED",
1: "ALLOW_OVERRIDES",
2: "APPEND",
3: "FINAL_VALUE_IGNORE_OVERRIDES",
}
SetValue_Behavior_value = map[string]int32{
"UNDEFINED": 0,
"ALLOW_OVERRIDES": 1,
"APPEND": 2,
"FINAL_VALUE_IGNORE_OVERRIDES": 3,
}
)
func (x SetValue_Behavior) Enum() *SetValue_Behavior {
p := new(SetValue_Behavior)
*p = x
return p
}
func (x SetValue_Behavior) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (SetValue_Behavior) Descriptor() protoreflect.EnumDescriptor {
return file_invocation_policy_proto_enumTypes[0].Descriptor()
}
func (SetValue_Behavior) Type() protoreflect.EnumType {
return &file_invocation_policy_proto_enumTypes[0]
}
func (x SetValue_Behavior) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Do not use.
func (x *SetValue_Behavior) UnmarshalJSON(b []byte) error {
num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)
if err != nil {
return err
}
*x = SetValue_Behavior(num)
return nil
}
// Deprecated: Use SetValue_Behavior.Descriptor instead.
func (SetValue_Behavior) EnumDescriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{2, 0}
}
// The --invocation_policy flag takes a base64-encoded binary-serialized or text
// formatted InvocationPolicy message.
type InvocationPolicy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Order matters.
// After expanding policies on expansion flags or flags with implicit
// requirements, only the final policy on a specific flag will be enforced
// onto the user's command line.
FlagPolicies []*FlagPolicy `protobuf:"bytes,1,rep,name=flag_policies,json=flagPolicies" json:"flag_policies,omitempty"`
}
func (x *InvocationPolicy) Reset() {
*x = InvocationPolicy{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *InvocationPolicy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*InvocationPolicy) ProtoMessage() {}
func (x *InvocationPolicy) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use InvocationPolicy.ProtoReflect.Descriptor instead.
func (*InvocationPolicy) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{0}
}
func (x *InvocationPolicy) GetFlagPolicies() []*FlagPolicy {
if x != nil {
return x.FlagPolicies
}
return nil
}
// A policy for controlling the value of a flag.
type FlagPolicy struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The name of the flag to enforce this policy on.
//
// Note that this should be the full name of the flag, not the abbreviated
// name of the flag. If the user specifies the abbreviated name of a flag,
// that flag will be matched using its full name.
//
// The "no" prefix will not be parsed, so for boolean flags, use
// the flag's full name and explicitly set it to true or false.
FlagName *string `protobuf:"bytes,1,opt,name=flag_name,json=flagName" json:"flag_name,omitempty"`
// If set, this flag policy is applied only if one of the given commands or a
// command that inherits from one of the given commands is being run. For
// instance, if "build" is one of the commands here, then this policy will
// apply to any command that inherits from build, such as info, coverage, or
// test. If empty, this flag policy is applied for all commands. This allows
// the policy setter to add all policies to the proto without having to
// determine which Bazel command the user is actually running. Additionally,
// Bazel allows multiple flags to be defined by the same name, and the
// specific flag definition is determined by the command.
Commands []string `protobuf:"bytes,2,rep,name=commands" json:"commands,omitempty"`
// Types that are assignable to Operation:
//
// *FlagPolicy_SetValue
// *FlagPolicy_UseDefault
// *FlagPolicy_DisallowValues
// *FlagPolicy_AllowValues
Operation isFlagPolicy_Operation `protobuf_oneof:"operation"`
}
func (x *FlagPolicy) Reset() {
*x = FlagPolicy{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FlagPolicy) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FlagPolicy) ProtoMessage() {}
func (x *FlagPolicy) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FlagPolicy.ProtoReflect.Descriptor instead.
func (*FlagPolicy) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{1}
}
func (x *FlagPolicy) GetFlagName() string {
if x != nil && x.FlagName != nil {
return *x.FlagName
}
return ""
}
func (x *FlagPolicy) GetCommands() []string {
if x != nil {
return x.Commands
}
return nil
}
func (m *FlagPolicy) GetOperation() isFlagPolicy_Operation {
if m != nil {
return m.Operation
}
return nil
}
func (x *FlagPolicy) GetSetValue() *SetValue {
if x, ok := x.GetOperation().(*FlagPolicy_SetValue); ok {
return x.SetValue
}
return nil
}
func (x *FlagPolicy) GetUseDefault() *UseDefault {
if x, ok := x.GetOperation().(*FlagPolicy_UseDefault); ok {
return x.UseDefault
}
return nil
}
func (x *FlagPolicy) GetDisallowValues() *DisallowValues {
if x, ok := x.GetOperation().(*FlagPolicy_DisallowValues); ok {
return x.DisallowValues
}
return nil
}
func (x *FlagPolicy) GetAllowValues() *AllowValues {
if x, ok := x.GetOperation().(*FlagPolicy_AllowValues); ok {
return x.AllowValues
}
return nil
}
type isFlagPolicy_Operation interface {
isFlagPolicy_Operation()
}
type FlagPolicy_SetValue struct {
SetValue *SetValue `protobuf:"bytes,3,opt,name=set_value,json=setValue,oneof"`
}
type FlagPolicy_UseDefault struct {
UseDefault *UseDefault `protobuf:"bytes,4,opt,name=use_default,json=useDefault,oneof"`
}
type FlagPolicy_DisallowValues struct {
DisallowValues *DisallowValues `protobuf:"bytes,5,opt,name=disallow_values,json=disallowValues,oneof"`
}
type FlagPolicy_AllowValues struct {
AllowValues *AllowValues `protobuf:"bytes,6,opt,name=allow_values,json=allowValues,oneof"`
}
func (*FlagPolicy_SetValue) isFlagPolicy_Operation() {}
func (*FlagPolicy_UseDefault) isFlagPolicy_Operation() {}
func (*FlagPolicy_DisallowValues) isFlagPolicy_Operation() {}
func (*FlagPolicy_AllowValues) isFlagPolicy_Operation() {}
type SetValue struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Use this value for the specified flag, overriding any default or user-set
// value (unless append is set to true for repeatable flags).
//
// This field is repeated for repeatable flags. It is an error to set
// multiple values for a flag that is not actually a repeatable flag.
// This requires at least 1 value, if even the empty string.
//
// If the flag allows multiple values, all of its values are replaced with the
// value or values from the policy (i.e., no diffing or merging is performed),
// unless the append field (see below) is set to true.
//
// Note that some flags are tricky. For example, some flags look like boolean
// flags, but are actually Void expansion flags that expand into other flags.
// The Bazel flag parser will accept "--void_flag=false", but because
// the flag is Void, the "=false" is ignored. It can get even trickier, like
// "--novoid_flag" which is also an expansion flag with the type Void whose
// name is explicitly "novoid_flag" and which expands into other flags that
// are the opposite of "--void_flag". For expansion flags, it's best to
// explicitly override the flags they expand into.
//
// Other flags may be differently tricky: A flag could have a converter that
// converts some string to a list of values, but that flag may not itself have
// allowMultiple set to true.
//
// An example is "--test_tag_filters": this flag sets its converter to
// CommaSeparatedOptionListConverter, but does not set allowMultiple to true.
// So "--test_tag_filters=foo,bar" results in ["foo", "bar"], however
// "--test_tag_filters=foo --test_tag_filters=bar" results in just ["bar"]
// since the 2nd value overrides the 1st.
//
// Similarly, "--test_tag_filters=foo,bar --test_tag_filters=baz,qux" results
// in ["baz", "qux"]. For flags like these, the policy should specify
// "foo,bar" instead of separately specifying "foo" and "bar" so that the
// converter is appropriately invoked.
//
// Note that the opposite is not necessarily
// true: for a flag that specifies allowMultiple=true, "--flag=foo,bar"
// may fail to parse or result in an unexpected value.
FlagValue []string `protobuf:"bytes,1,rep,name=flag_value,json=flagValue" json:"flag_value,omitempty"`
// Defines how invocation policy should interact with user settings for the
// same flag.
// For the time being, it coexists with overridable and append with duplicate
// semantics.Please fill both of the values as we migrate to use behavior
// only.
Behavior *SetValue_Behavior `protobuf:"varint,4,opt,name=behavior,enum=blaze.invocation_policy.SetValue_Behavior" json:"behavior,omitempty"`
}
func (x *SetValue) Reset() {
*x = SetValue{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SetValue) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetValue) ProtoMessage() {}
func (x *SetValue) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetValue.ProtoReflect.Descriptor instead.
func (*SetValue) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{2}
}
func (x *SetValue) GetFlagValue() []string {
if x != nil {
return x.FlagValue
}
return nil
}
func (x *SetValue) GetBehavior() SetValue_Behavior {
if x != nil && x.Behavior != nil {
return *x.Behavior
}
return SetValue_UNDEFINED
}
type UseDefault struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UseDefault) Reset() {
*x = UseDefault{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UseDefault) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UseDefault) ProtoMessage() {}
func (x *UseDefault) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UseDefault.ProtoReflect.Descriptor instead.
func (*UseDefault) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{3}
}
type DisallowValues struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// It is an error for the user to use any of these values (that is, the Bazel
// command will fail), unless new_value or use_default is set.
//
// For repeatable flags, if any one of the values in the flag matches a value
// in the list of disallowed values, an error is thrown.
//
// Care must be taken for flags with complicated converters. For example,
// it's possible for a repeated flag to be of type List<List<T>>, so that
// "--foo=a,b --foo=c,d" results in foo=[["a","b"], ["c", "d"]]. In this case,
// it is not possible to disallow just "b", nor will ["b", "a"] match, nor
// will ["b", "c"] (but ["a", "b"] will still match).
DisallowedValues []string `protobuf:"bytes,1,rep,name=disallowed_values,json=disallowedValues" json:"disallowed_values,omitempty"`
// Types that are assignable to ReplacementValue:
//
// *DisallowValues_NewValue
// *DisallowValues_UseDefault
ReplacementValue isDisallowValues_ReplacementValue `protobuf_oneof:"replacement_value"`
}
func (x *DisallowValues) Reset() {
*x = DisallowValues{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DisallowValues) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DisallowValues) ProtoMessage() {}
func (x *DisallowValues) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DisallowValues.ProtoReflect.Descriptor instead.
func (*DisallowValues) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{4}
}
func (x *DisallowValues) GetDisallowedValues() []string {
if x != nil {
return x.DisallowedValues
}
return nil
}
func (m *DisallowValues) GetReplacementValue() isDisallowValues_ReplacementValue {
if m != nil {
return m.ReplacementValue
}
return nil
}
func (x *DisallowValues) GetNewValue() string {
if x, ok := x.GetReplacementValue().(*DisallowValues_NewValue); ok {
return x.NewValue
}
return ""
}
func (x *DisallowValues) GetUseDefault() *UseDefault {
if x, ok := x.GetReplacementValue().(*DisallowValues_UseDefault); ok {
return x.UseDefault
}
return nil
}
type isDisallowValues_ReplacementValue interface {
isDisallowValues_ReplacementValue()
}
type DisallowValues_NewValue struct {
// If set and if the value of the flag is disallowed (including the default
// value of the flag if the user doesn't specify a value), use this value as
// the value of the flag instead of raising an error. This does not apply to
// repeatable flags and is ignored if the flag is a repeatable flag.
NewValue string `protobuf:"bytes,3,opt,name=new_value,json=newValue,oneof"`
}
type DisallowValues_UseDefault struct {
// If set and if the value of the flag is disallowed, use the default value
// of the flag instead of raising an error. Unlike new_value, this works for
// repeatable flags, but note that the default value for repeatable flags is
// always empty.
//
// Note that it is an error to disallow the default value of the flag and
// to set use_default, unless the flag is a repeatable flag where the
// default value is always the empty list.
UseDefault *UseDefault `protobuf:"bytes,4,opt,name=use_default,json=useDefault,oneof"`
}
func (*DisallowValues_NewValue) isDisallowValues_ReplacementValue() {}
func (*DisallowValues_UseDefault) isDisallowValues_ReplacementValue() {}
type AllowValues struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// It is an error for the user to use any value not in this list, unless
// new_value or use_default is set.
AllowedValues []string `protobuf:"bytes,1,rep,name=allowed_values,json=allowedValues" json:"allowed_values,omitempty"`
// Types that are assignable to ReplacementValue:
//
// *AllowValues_NewValue
// *AllowValues_UseDefault
ReplacementValue isAllowValues_ReplacementValue `protobuf_oneof:"replacement_value"`
}
func (x *AllowValues) Reset() {
*x = AllowValues{}
if protoimpl.UnsafeEnabled {
mi := &file_invocation_policy_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AllowValues) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AllowValues) ProtoMessage() {}
func (x *AllowValues) ProtoReflect() protoreflect.Message {
mi := &file_invocation_policy_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AllowValues.ProtoReflect.Descriptor instead.
func (*AllowValues) Descriptor() ([]byte, []int) {
return file_invocation_policy_proto_rawDescGZIP(), []int{5}
}
func (x *AllowValues) GetAllowedValues() []string {
if x != nil {
return x.AllowedValues
}
return nil
}
func (m *AllowValues) GetReplacementValue() isAllowValues_ReplacementValue {
if m != nil {
return m.ReplacementValue
}
return nil
}
func (x *AllowValues) GetNewValue() string {
if x, ok := x.GetReplacementValue().(*AllowValues_NewValue); ok {
return x.NewValue
}
return ""
}
func (x *AllowValues) GetUseDefault() *UseDefault {
if x, ok := x.GetReplacementValue().(*AllowValues_UseDefault); ok {
return x.UseDefault
}
return nil
}
type isAllowValues_ReplacementValue interface {
isAllowValues_ReplacementValue()
}
type AllowValues_NewValue struct {
// If set and if the value of the flag is disallowed (including the default
// value of the flag if the user doesn't specify a value), use this value as
// the value of the flag instead of raising an error. This does not apply to
// repeatable flags and is ignored if the flag is a repeatable flag.
NewValue string `protobuf:"bytes,3,opt,name=new_value,json=newValue,oneof"`
}
type AllowValues_UseDefault struct {
// If set and if the value of the flag is disallowed, use the default value
// of the flag instead of raising an error. Unlike new_value, this works for
// repeatable flags, but note that the default value for repeatable flags is
// always empty.
//
// Note that it is an error to disallow the default value of the flag and
// to set use_default, unless the flag is a repeatable flag where the
// default value is always the empty list.
UseDefault *UseDefault `protobuf:"bytes,4,opt,name=use_default,json=useDefault,oneof"`
}
func (*AllowValues_NewValue) isAllowValues_ReplacementValue() {}
func (*AllowValues_UseDefault) isAllowValues_ReplacementValue() {}
var File_invocation_policy_proto protoreflect.FileDescriptor
var file_invocation_policy_proto_rawDesc = []byte{
0x0a, 0x17, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x62, 0x6c, 0x61, 0x7a, 0x65,
0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x22, 0x5c, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x48, 0x0a, 0x0d, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x70,
0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e,
0x62, 0x6c, 0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x52, 0x0c, 0x66, 0x6c, 0x61, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73,
0x22, 0xfb, 0x02, 0x0a, 0x0a, 0x46, 0x6c, 0x61, 0x67, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12,
0x1b, 0x0a, 0x09, 0x66, 0x6c, 0x61, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x66, 0x6c, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x73, 0x65, 0x74, 0x5f,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x6c,
0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00,
0x52, 0x08, 0x73, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x75, 0x73,
0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x23, 0x2e, 0x62, 0x6c, 0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x55, 0x73, 0x65, 0x44, 0x65, 0x66,
0x61, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75,
0x6c, 0x74, 0x12, 0x52, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x6c,
0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x44, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61,
0x6c, 0x75, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x49, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62,
0x6c, 0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x73, 0x42, 0x0b, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xdb,
0x01, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66,
0x6c, 0x61, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
0x09, 0x66, 0x6c, 0x61, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x62, 0x65,
0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x62,
0x6c, 0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e,
0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x52, 0x08, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,
0x6f, 0x72, 0x22, 0x5c, 0x0a, 0x08, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x12, 0x0d,
0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a,
0x0f, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x53,
0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x50, 0x50, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x20,
0x0a, 0x1c, 0x46, 0x49, 0x4e, 0x41, 0x4c, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x49, 0x47,
0x4e, 0x4f, 0x52, 0x45, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0x53, 0x10, 0x03,
0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x0c, 0x0a, 0x0a,
0x55, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0xbf, 0x01, 0x0a, 0x0e, 0x44,
0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x2b, 0x0a,
0x11, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c,
0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x09, 0x6e, 0x65,
0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x75, 0x73, 0x65,
0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23,
0x2e, 0x62, 0x6c, 0x61, 0x7a, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x55, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61,
0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,
0x74, 0x42, 0x13, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74,
0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x22, 0xb6, 0x01, 0x0a,
0x0b, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e,
0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x6c, 0x61, 0x7a, 0x65, 0x2e,
0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63,
0x79, 0x2e, 0x55, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0a,
0x75, 0x73, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x72, 0x65,
0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4a,
0x04, 0x08, 0x02, 0x10, 0x03, 0x42, 0x1c, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x6a, 0x6f, 0x6f, 0x6d, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x67, 0x6f, 0x2d,
0x62, 0x65, 0x73,
}
var (
file_invocation_policy_proto_rawDescOnce sync.Once
file_invocation_policy_proto_rawDescData = file_invocation_policy_proto_rawDesc
)
func file_invocation_policy_proto_rawDescGZIP() []byte {
file_invocation_policy_proto_rawDescOnce.Do(func() {
file_invocation_policy_proto_rawDescData = protoimpl.X.CompressGZIP(file_invocation_policy_proto_rawDescData)
})
return file_invocation_policy_proto_rawDescData
}
var file_invocation_policy_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_invocation_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_invocation_policy_proto_goTypes = []interface{}{
(SetValue_Behavior)(0), // 0: blaze.invocation_policy.SetValue.Behavior
(*InvocationPolicy)(nil), // 1: blaze.invocation_policy.InvocationPolicy
(*FlagPolicy)(nil), // 2: blaze.invocation_policy.FlagPolicy
(*SetValue)(nil), // 3: blaze.invocation_policy.SetValue
(*UseDefault)(nil), // 4: blaze.invocation_policy.UseDefault
(*DisallowValues)(nil), // 5: blaze.invocation_policy.DisallowValues
(*AllowValues)(nil), // 6: blaze.invocation_policy.AllowValues
}
var file_invocation_policy_proto_depIdxs = []int32{
2, // 0: blaze.invocation_policy.InvocationPolicy.flag_policies:type_name -> blaze.invocation_policy.FlagPolicy
3, // 1: blaze.invocation_policy.FlagPolicy.set_value:type_name -> blaze.invocation_policy.SetValue
4, // 2: blaze.invocation_policy.FlagPolicy.use_default:type_name -> blaze.invocation_policy.UseDefault
5, // 3: blaze.invocation_policy.FlagPolicy.disallow_values:type_name -> blaze.invocation_policy.DisallowValues
6, // 4: blaze.invocation_policy.FlagPolicy.allow_values:type_name -> blaze.invocation_policy.AllowValues
0, // 5: blaze.invocation_policy.SetValue.behavior:type_name -> blaze.invocation_policy.SetValue.Behavior
4, // 6: blaze.invocation_policy.DisallowValues.use_default:type_name -> blaze.invocation_policy.UseDefault
4, // 7: blaze.invocation_policy.AllowValues.use_default:type_name -> blaze.invocation_policy.UseDefault
8, // [8:8] is the sub-list for method output_type
8, // [8:8] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_invocation_policy_proto_init() }
func file_invocation_policy_proto_init() {
if File_invocation_policy_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_invocation_policy_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InvocationPolicy); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_invocation_policy_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FlagPolicy); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_invocation_policy_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetValue); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_invocation_policy_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UseDefault); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_invocation_policy_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DisallowValues); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_invocation_policy_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AllowValues); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_invocation_policy_proto_msgTypes[1].OneofWrappers = []interface{}{
(*FlagPolicy_SetValue)(nil),
(*FlagPolicy_UseDefault)(nil),
(*FlagPolicy_DisallowValues)(nil),
(*FlagPolicy_AllowValues)(nil),
}
file_invocation_policy_proto_msgTypes[4].OneofWrappers = []interface{}{
(*DisallowValues_NewValue)(nil),
(*DisallowValues_UseDefault)(nil),
}
file_invocation_policy_proto_msgTypes[5].OneofWrappers = []interface{}{
(*AllowValues_NewValue)(nil),
(*AllowValues_UseDefault)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_invocation_policy_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_invocation_policy_proto_goTypes,
DependencyIndexes: file_invocation_policy_proto_depIdxs,
EnumInfos: file_invocation_policy_proto_enumTypes,
MessageInfos: file_invocation_policy_proto_msgTypes,
}.Build()
File_invocation_policy_proto = out.File
file_invocation_policy_proto_rawDesc = nil
file_invocation_policy_proto_goTypes = nil
file_invocation_policy_proto_depIdxs = nil
}