forked from openconfig/gnmi
/
fake.pb.go
1708 lines (1552 loc) · 54.9 KB
/
fake.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.
// source: testing/fake/proto/fake.proto
package gnmi_fake
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import any "github.com/golang/protobuf/ptypes/any"
import gnmi "github.com/openconfig/gnmi/proto/gnmi"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type State int32
const (
State_STOPPED State = 0
State_INIT State = 1
State_RUNNING State = 2
)
var State_name = map[int32]string{
0: "STOPPED",
1: "INIT",
2: "RUNNING",
}
var State_value = map[string]int32{
"STOPPED": 0,
"INIT": 1,
"RUNNING": 2,
}
func (x State) String() string {
return proto.EnumName(State_name, int32(x))
}
func (State) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{0}
}
type Config_ClientType int32
const (
Config_GRPC Config_ClientType = 0
Config_STUBBY Config_ClientType = 1
Config_GRPC_GNMI Config_ClientType = 2
Config_GRPC_GNMI_PROD Config_ClientType = 3
)
var Config_ClientType_name = map[int32]string{
0: "GRPC",
1: "STUBBY",
2: "GRPC_GNMI",
3: "GRPC_GNMI_PROD",
}
var Config_ClientType_value = map[string]int32{
"GRPC": 0,
"STUBBY": 1,
"GRPC_GNMI": 2,
"GRPC_GNMI_PROD": 3,
}
func (x Config_ClientType) String() string {
return proto.EnumName(Config_ClientType_name, int32(x))
}
func (Config_ClientType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{2, 0}
}
// Configuration is used to store all agent configuration for the fake agent
// server. Each config describes a single agent hosted on the server.
type Configuration struct {
// Repeated list of targets to emulate.
Config []*Config `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Configuration) Reset() { *m = Configuration{} }
func (m *Configuration) String() string { return proto.CompactTextString(m) }
func (*Configuration) ProtoMessage() {}
func (*Configuration) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{0}
}
func (m *Configuration) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Configuration.Unmarshal(m, b)
}
func (m *Configuration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Configuration.Marshal(b, m, deterministic)
}
func (dst *Configuration) XXX_Merge(src proto.Message) {
xxx_messageInfo_Configuration.Merge(dst, src)
}
func (m *Configuration) XXX_Size() int {
return xxx_messageInfo_Configuration.Size(m)
}
func (m *Configuration) XXX_DiscardUnknown() {
xxx_messageInfo_Configuration.DiscardUnknown(m)
}
var xxx_messageInfo_Configuration proto.InternalMessageInfo
func (m *Configuration) GetConfig() []*Config {
if m != nil {
return m.Config
}
return nil
}
type Credentials struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Credentials) Reset() { *m = Credentials{} }
func (m *Credentials) String() string { return proto.CompactTextString(m) }
func (*Credentials) ProtoMessage() {}
func (*Credentials) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{1}
}
func (m *Credentials) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Credentials.Unmarshal(m, b)
}
func (m *Credentials) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Credentials.Marshal(b, m, deterministic)
}
func (dst *Credentials) XXX_Merge(src proto.Message) {
xxx_messageInfo_Credentials.Merge(dst, src)
}
func (m *Credentials) XXX_Size() int {
return xxx_messageInfo_Credentials.Size(m)
}
func (m *Credentials) XXX_DiscardUnknown() {
xxx_messageInfo_Credentials.DiscardUnknown(m)
}
var xxx_messageInfo_Credentials proto.InternalMessageInfo
func (m *Credentials) GetUsername() string {
if m != nil {
return m.Username
}
return ""
}
func (m *Credentials) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
// Config is a collection of values that together represent the update streams
// for one or more fake devices.
type Config struct {
// The target for which the fake will publish values for.
Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
// Port for the agent to listen on. If 0 or unset the agent will pick a port
// for this agent.
Port int64 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
// A global random seed used in generating subsequent values. Set to have
// reproducible results.
Seed int64 `protobuf:"varint,6,opt,name=seed,proto3" json:"seed,omitempty"` // Deprecated: Do not use.
// The list of values generated. Each value will contain its corresponding
// target as the first string in the event.GetValue().path meaning that it is
// possible to generate streams that will be rejected by the cache for testing
// purposes.
Values []*Value `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"` // Deprecated: Do not use.
// Setting disable sync will keep the configured client from autogenerating a
// sync message. This allows negative testing on sync handling.
DisableSync bool `protobuf:"varint,4,opt,name=disable_sync,json=disableSync,proto3" json:"disable_sync,omitempty"`
// Type of client to fake either Stubby or GRPC based fake.
ClientType Config_ClientType `protobuf:"varint,5,opt,name=client_type,json=clientType,proto3,enum=gnmi.fake.Config_ClientType" json:"client_type,omitempty"`
// Disable EOF will hold open the subscription and not automagically close
// the stream once the value queue is empty.
DisableEof bool `protobuf:"varint,7,opt,name=disable_eof,json=disableEof,proto3" json:"disable_eof,omitempty"`
// Per RPC credentials for the agent. If not set no per RPC auth will be used.
Credentials *Credentials `protobuf:"bytes,8,opt,name=credentials,proto3" json:"credentials,omitempty"`
// TLS cert for use on the agent. If not set the transport will not be TLS.
Cert []byte `protobuf:"bytes,9,opt,name=cert,proto3" json:"cert,omitempty"`
// Honor the delay between events in the generated value streams. Default will
// play events as fast as the can be streamed.
EnableDelay bool `protobuf:"varint,10,opt,name=enable_delay,json=enableDelay,proto3" json:"enable_delay,omitempty"`
// Generator for value series for the target.
//
// Types that are valid to be assigned to Generator:
// *Config_Custom
// *Config_Random
// *Config_Fixed
Generator isConfig_Generator `protobuf_oneof:"generator"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Config) Reset() { *m = Config{} }
func (m *Config) String() string { return proto.CompactTextString(m) }
func (*Config) ProtoMessage() {}
func (*Config) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{2}
}
func (m *Config) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Config.Unmarshal(m, b)
}
func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Config.Marshal(b, m, deterministic)
}
func (dst *Config) XXX_Merge(src proto.Message) {
xxx_messageInfo_Config.Merge(dst, src)
}
func (m *Config) XXX_Size() int {
return xxx_messageInfo_Config.Size(m)
}
func (m *Config) XXX_DiscardUnknown() {
xxx_messageInfo_Config.DiscardUnknown(m)
}
var xxx_messageInfo_Config proto.InternalMessageInfo
type isConfig_Generator interface {
isConfig_Generator()
}
type Config_Custom struct {
Custom *any.Any `protobuf:"bytes,100,opt,name=custom,proto3,oneof"`
}
type Config_Random struct {
Random *RandomGenerator `protobuf:"bytes,101,opt,name=random,proto3,oneof"`
}
type Config_Fixed struct {
Fixed *FixedGenerator `protobuf:"bytes,102,opt,name=fixed,proto3,oneof"`
}
func (*Config_Custom) isConfig_Generator() {}
func (*Config_Random) isConfig_Generator() {}
func (*Config_Fixed) isConfig_Generator() {}
func (m *Config) GetGenerator() isConfig_Generator {
if m != nil {
return m.Generator
}
return nil
}
func (m *Config) GetTarget() string {
if m != nil {
return m.Target
}
return ""
}
func (m *Config) GetPort() int64 {
if m != nil {
return m.Port
}
return 0
}
// Deprecated: Do not use.
func (m *Config) GetSeed() int64 {
if m != nil {
return m.Seed
}
return 0
}
// Deprecated: Do not use.
func (m *Config) GetValues() []*Value {
if m != nil {
return m.Values
}
return nil
}
func (m *Config) GetDisableSync() bool {
if m != nil {
return m.DisableSync
}
return false
}
func (m *Config) GetClientType() Config_ClientType {
if m != nil {
return m.ClientType
}
return Config_GRPC
}
func (m *Config) GetDisableEof() bool {
if m != nil {
return m.DisableEof
}
return false
}
func (m *Config) GetCredentials() *Credentials {
if m != nil {
return m.Credentials
}
return nil
}
func (m *Config) GetCert() []byte {
if m != nil {
return m.Cert
}
return nil
}
func (m *Config) GetEnableDelay() bool {
if m != nil {
return m.EnableDelay
}
return false
}
func (m *Config) GetCustom() *any.Any {
if x, ok := m.GetGenerator().(*Config_Custom); ok {
return x.Custom
}
return nil
}
func (m *Config) GetRandom() *RandomGenerator {
if x, ok := m.GetGenerator().(*Config_Random); ok {
return x.Random
}
return nil
}
func (m *Config) GetFixed() *FixedGenerator {
if x, ok := m.GetGenerator().(*Config_Fixed); ok {
return x.Fixed
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Config) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Config_OneofMarshaler, _Config_OneofUnmarshaler, _Config_OneofSizer, []interface{}{
(*Config_Custom)(nil),
(*Config_Random)(nil),
(*Config_Fixed)(nil),
}
}
func _Config_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Config)
// generator
switch x := m.Generator.(type) {
case *Config_Custom:
b.EncodeVarint(100<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Custom); err != nil {
return err
}
case *Config_Random:
b.EncodeVarint(101<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Random); err != nil {
return err
}
case *Config_Fixed:
b.EncodeVarint(102<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Fixed); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Config.Generator has unexpected type %T", x)
}
return nil
}
func _Config_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Config)
switch tag {
case 100: // generator.custom
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(any.Any)
err := b.DecodeMessage(msg)
m.Generator = &Config_Custom{msg}
return true, err
case 101: // generator.random
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(RandomGenerator)
err := b.DecodeMessage(msg)
m.Generator = &Config_Random{msg}
return true, err
case 102: // generator.fixed
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(FixedGenerator)
err := b.DecodeMessage(msg)
m.Generator = &Config_Fixed{msg}
return true, err
default:
return false, nil
}
}
func _Config_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Config)
// generator
switch x := m.Generator.(type) {
case *Config_Custom:
s := proto.Size(x.Custom)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Config_Random:
s := proto.Size(x.Random)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Config_Fixed:
s := proto.Size(x.Fixed)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type FixedGenerator struct {
Responses []*gnmi.SubscribeResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FixedGenerator) Reset() { *m = FixedGenerator{} }
func (m *FixedGenerator) String() string { return proto.CompactTextString(m) }
func (*FixedGenerator) ProtoMessage() {}
func (*FixedGenerator) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{3}
}
func (m *FixedGenerator) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FixedGenerator.Unmarshal(m, b)
}
func (m *FixedGenerator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FixedGenerator.Marshal(b, m, deterministic)
}
func (dst *FixedGenerator) XXX_Merge(src proto.Message) {
xxx_messageInfo_FixedGenerator.Merge(dst, src)
}
func (m *FixedGenerator) XXX_Size() int {
return xxx_messageInfo_FixedGenerator.Size(m)
}
func (m *FixedGenerator) XXX_DiscardUnknown() {
xxx_messageInfo_FixedGenerator.DiscardUnknown(m)
}
var xxx_messageInfo_FixedGenerator proto.InternalMessageInfo
func (m *FixedGenerator) GetResponses() []*gnmi.SubscribeResponse {
if m != nil {
return m.Responses
}
return nil
}
type RandomGenerator struct {
Seed int64 `protobuf:"varint,1,opt,name=seed,proto3" json:"seed,omitempty"`
Values []*Value `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RandomGenerator) Reset() { *m = RandomGenerator{} }
func (m *RandomGenerator) String() string { return proto.CompactTextString(m) }
func (*RandomGenerator) ProtoMessage() {}
func (*RandomGenerator) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{4}
}
func (m *RandomGenerator) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RandomGenerator.Unmarshal(m, b)
}
func (m *RandomGenerator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RandomGenerator.Marshal(b, m, deterministic)
}
func (dst *RandomGenerator) XXX_Merge(src proto.Message) {
xxx_messageInfo_RandomGenerator.Merge(dst, src)
}
func (m *RandomGenerator) XXX_Size() int {
return xxx_messageInfo_RandomGenerator.Size(m)
}
func (m *RandomGenerator) XXX_DiscardUnknown() {
xxx_messageInfo_RandomGenerator.DiscardUnknown(m)
}
var xxx_messageInfo_RandomGenerator proto.InternalMessageInfo
func (m *RandomGenerator) GetSeed() int64 {
if m != nil {
return m.Seed
}
return 0
}
func (m *RandomGenerator) GetValues() []*Value {
if m != nil {
return m.Values
}
return nil
}
// Delete will cause the value to be deleted at the Value's path.
type DeleteValue struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteValue) Reset() { *m = DeleteValue{} }
func (m *DeleteValue) String() string { return proto.CompactTextString(m) }
func (*DeleteValue) ProtoMessage() {}
func (*DeleteValue) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{5}
}
func (m *DeleteValue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteValue.Unmarshal(m, b)
}
func (m *DeleteValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteValue.Marshal(b, m, deterministic)
}
func (dst *DeleteValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteValue.Merge(dst, src)
}
func (m *DeleteValue) XXX_Size() int {
return xxx_messageInfo_DeleteValue.Size(m)
}
func (m *DeleteValue) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteValue.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteValue proto.InternalMessageInfo
// Value is the main message that will trigger a stream of updates for a given
// path. A file containing a list of values can be used to simulate a network
// device for integration tests.
type Value struct {
// The device specific, or OpenConfig path corresponding to a value.
Path []string `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"`
// The initial timestamp and configuration on how the timestamp will change
// for subsequent values. If timestamp is not set the default will assume to
// be the current system time.
Timestamp *Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// If set, repeat indicates that the value should be repeated this many times,
// otherwise it is repeated indefinitely.
Repeat int32 `protobuf:"varint,6,opt,name=repeat,proto3" json:"repeat,omitempty"`
// A local random seed used in generating subsequent values for this path. If
// not set, will share the global random source with seed defined in Config.
Seed int64 `protobuf:"varint,7,opt,name=seed,proto3" json:"seed,omitempty"`
// The initial value of the chosen type including configuration on how the
// value will mutate for subsequent updates.
//
// Types that are valid to be assigned to Value:
// *Value_IntValue
// *Value_DoubleValue
// *Value_StringValue
// *Value_Sync
// *Value_Delete
Value isValue_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Value) Reset() { *m = Value{} }
func (m *Value) String() string { return proto.CompactTextString(m) }
func (*Value) ProtoMessage() {}
func (*Value) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{6}
}
func (m *Value) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Value.Unmarshal(m, b)
}
func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Value.Marshal(b, m, deterministic)
}
func (dst *Value) XXX_Merge(src proto.Message) {
xxx_messageInfo_Value.Merge(dst, src)
}
func (m *Value) XXX_Size() int {
return xxx_messageInfo_Value.Size(m)
}
func (m *Value) XXX_DiscardUnknown() {
xxx_messageInfo_Value.DiscardUnknown(m)
}
var xxx_messageInfo_Value proto.InternalMessageInfo
type isValue_Value interface {
isValue_Value()
}
type Value_IntValue struct {
IntValue *IntValue `protobuf:"bytes,100,opt,name=int_value,json=intValue,proto3,oneof"`
}
type Value_DoubleValue struct {
DoubleValue *DoubleValue `protobuf:"bytes,101,opt,name=double_value,json=doubleValue,proto3,oneof"`
}
type Value_StringValue struct {
StringValue *StringValue `protobuf:"bytes,102,opt,name=string_value,json=stringValue,proto3,oneof"`
}
type Value_Sync struct {
Sync uint64 `protobuf:"varint,103,opt,name=sync,proto3,oneof"`
}
type Value_Delete struct {
Delete *DeleteValue `protobuf:"bytes,104,opt,name=delete,proto3,oneof"`
}
func (*Value_IntValue) isValue_Value() {}
func (*Value_DoubleValue) isValue_Value() {}
func (*Value_StringValue) isValue_Value() {}
func (*Value_Sync) isValue_Value() {}
func (*Value_Delete) isValue_Value() {}
func (m *Value) GetValue() isValue_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *Value) GetPath() []string {
if m != nil {
return m.Path
}
return nil
}
func (m *Value) GetTimestamp() *Timestamp {
if m != nil {
return m.Timestamp
}
return nil
}
func (m *Value) GetRepeat() int32 {
if m != nil {
return m.Repeat
}
return 0
}
func (m *Value) GetSeed() int64 {
if m != nil {
return m.Seed
}
return 0
}
func (m *Value) GetIntValue() *IntValue {
if x, ok := m.GetValue().(*Value_IntValue); ok {
return x.IntValue
}
return nil
}
func (m *Value) GetDoubleValue() *DoubleValue {
if x, ok := m.GetValue().(*Value_DoubleValue); ok {
return x.DoubleValue
}
return nil
}
func (m *Value) GetStringValue() *StringValue {
if x, ok := m.GetValue().(*Value_StringValue); ok {
return x.StringValue
}
return nil
}
func (m *Value) GetSync() uint64 {
if x, ok := m.GetValue().(*Value_Sync); ok {
return x.Sync
}
return 0
}
func (m *Value) GetDelete() *DeleteValue {
if x, ok := m.GetValue().(*Value_Delete); ok {
return x.Delete
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Value_OneofMarshaler, _Value_OneofUnmarshaler, _Value_OneofSizer, []interface{}{
(*Value_IntValue)(nil),
(*Value_DoubleValue)(nil),
(*Value_StringValue)(nil),
(*Value_Sync)(nil),
(*Value_Delete)(nil),
}
}
func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Value)
// value
switch x := m.Value.(type) {
case *Value_IntValue:
b.EncodeVarint(100<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.IntValue); err != nil {
return err
}
case *Value_DoubleValue:
b.EncodeVarint(101<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.DoubleValue); err != nil {
return err
}
case *Value_StringValue:
b.EncodeVarint(102<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.StringValue); err != nil {
return err
}
case *Value_Sync:
b.EncodeVarint(103<<3 | proto.WireVarint)
b.EncodeVarint(uint64(x.Sync))
case *Value_Delete:
b.EncodeVarint(104<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Delete); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Value.Value has unexpected type %T", x)
}
return nil
}
func _Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Value)
switch tag {
case 100: // value.int_value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(IntValue)
err := b.DecodeMessage(msg)
m.Value = &Value_IntValue{msg}
return true, err
case 101: // value.double_value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DoubleValue)
err := b.DecodeMessage(msg)
m.Value = &Value_DoubleValue{msg}
return true, err
case 102: // value.string_value
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(StringValue)
err := b.DecodeMessage(msg)
m.Value = &Value_StringValue{msg}
return true, err
case 103: // value.sync
if wire != proto.WireVarint {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeVarint()
m.Value = &Value_Sync{x}
return true, err
case 104: // value.delete
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(DeleteValue)
err := b.DecodeMessage(msg)
m.Value = &Value_Delete{msg}
return true, err
default:
return false, nil
}
}
func _Value_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Value)
// value
switch x := m.Value.(type) {
case *Value_IntValue:
s := proto.Size(x.IntValue)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Value_DoubleValue:
s := proto.Size(x.DoubleValue)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Value_StringValue:
s := proto.Size(x.StringValue)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Value_Sync:
n += 2 // tag and wire
n += proto.SizeVarint(uint64(x.Sync))
case *Value_Delete:
s := proto.Size(x.Delete)
n += 2 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type Timestamp struct {
// Initial timestamp for the corresponding value, nanoseconds since epoch.
// This value need have no relation to absolute real-time as the stream of
// of updates is generated without regard to the real clock and can be run
// repeatably at any time if the seed is set in the corresponding Value.
Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
// These values will vary the change in the timestamp for subsequent outputs
// by a value between delta_min and delta_max. Set to the same value to force
// a set periodic interval.
DeltaMin int64 `protobuf:"varint,2,opt,name=delta_min,json=deltaMin,proto3" json:"delta_min,omitempty"`
DeltaMax int64 `protobuf:"varint,3,opt,name=delta_max,json=deltaMax,proto3" json:"delta_max,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Timestamp) Reset() { *m = Timestamp{} }
func (m *Timestamp) String() string { return proto.CompactTextString(m) }
func (*Timestamp) ProtoMessage() {}
func (*Timestamp) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{7}
}
func (m *Timestamp) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Timestamp.Unmarshal(m, b)
}
func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic)
}
func (dst *Timestamp) XXX_Merge(src proto.Message) {
xxx_messageInfo_Timestamp.Merge(dst, src)
}
func (m *Timestamp) XXX_Size() int {
return xxx_messageInfo_Timestamp.Size(m)
}
func (m *Timestamp) XXX_DiscardUnknown() {
xxx_messageInfo_Timestamp.DiscardUnknown(m)
}
var xxx_messageInfo_Timestamp proto.InternalMessageInfo
func (m *Timestamp) GetTimestamp() int64 {
if m != nil {
return m.Timestamp
}
return 0
}
func (m *Timestamp) GetDeltaMin() int64 {
if m != nil {
return m.DeltaMin
}
return 0
}
func (m *Timestamp) GetDeltaMax() int64 {
if m != nil {
return m.DeltaMax
}
return 0
}
type IntValue struct {
// If distribution is IntRange, value is used as the initial value
// inside [minimum, maximum] and hold the value as it mutates.
// If distribution is IntList, value is only used to hold the value as it
// mutates.
// If no distribution is set, value is used as it mutates, i.e. constant
// update.
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
// Types that are valid to be assigned to Distribution:
// *IntValue_Range
// *IntValue_List
Distribution isIntValue_Distribution `protobuf_oneof:"distribution"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IntValue) Reset() { *m = IntValue{} }
func (m *IntValue) String() string { return proto.CompactTextString(m) }
func (*IntValue) ProtoMessage() {}
func (*IntValue) Descriptor() ([]byte, []int) {
return fileDescriptor_fake_448924c4992cbd6c, []int{8}
}
func (m *IntValue) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IntValue.Unmarshal(m, b)
}
func (m *IntValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IntValue.Marshal(b, m, deterministic)
}
func (dst *IntValue) XXX_Merge(src proto.Message) {
xxx_messageInfo_IntValue.Merge(dst, src)
}
func (m *IntValue) XXX_Size() int {
return xxx_messageInfo_IntValue.Size(m)
}
func (m *IntValue) XXX_DiscardUnknown() {
xxx_messageInfo_IntValue.DiscardUnknown(m)
}
var xxx_messageInfo_IntValue proto.InternalMessageInfo
type isIntValue_Distribution interface {
isIntValue_Distribution()
}
type IntValue_Range struct {
Range *IntRange `protobuf:"bytes,2,opt,name=range,proto3,oneof"`
}
type IntValue_List struct {
List *IntList `protobuf:"bytes,3,opt,name=list,proto3,oneof"`
}
func (*IntValue_Range) isIntValue_Distribution() {}
func (*IntValue_List) isIntValue_Distribution() {}
func (m *IntValue) GetDistribution() isIntValue_Distribution {
if m != nil {
return m.Distribution
}
return nil
}
func (m *IntValue) GetValue() int64 {
if m != nil {
return m.Value
}
return 0
}
func (m *IntValue) GetRange() *IntRange {
if x, ok := m.GetDistribution().(*IntValue_Range); ok {
return x.Range
}
return nil
}
func (m *IntValue) GetList() *IntList {
if x, ok := m.GetDistribution().(*IntValue_List); ok {
return x.List
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*IntValue) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _IntValue_OneofMarshaler, _IntValue_OneofUnmarshaler, _IntValue_OneofSizer, []interface{}{
(*IntValue_Range)(nil),
(*IntValue_List)(nil),
}
}
func _IntValue_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*IntValue)
// distribution
switch x := m.Distribution.(type) {
case *IntValue_Range:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Range); err != nil {
return err
}
case *IntValue_List:
b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.List); err != nil {
return err
}