This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
forked from istio/api
/
l4_fault.pb.go
344 lines (310 loc) · 14.6 KB
/
l4_fault.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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: routing/v1alpha1/l4_fault.proto
package v1alpha1 // import "istio.io/api/routing/v1alpha1"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import duration "github.com/golang/protobuf/ptypes/duration"
// 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
// (-- Faults can be injected into the connections from downstream by the
// Envoy, for testing the failure recovery capabilities of downstream
// services. Faults include aborting the connection from downstream
// service, delaying proxying of connection to the destination
// service, and throttling the bandwidth of the connection (either
// end). Bandwidth throttling for failure testing should not be confused
// with the rate limiting policy enforcement provided by the Mixer
// component. L4 fault injection is not supported at the moment. --)
type L4FaultInjection struct {
// Unlike Http services, we have very little context for raw Tcp|Udp
// connections. We could throttle bandwidth of the connections (slow down
// the connection) and/or abruptly reset (terminate) the Tcp connection
// after it has been established.
// We first throttle (if set) and then terminate the connection.
Throttle *L4FaultInjection_Throttle `protobuf:"bytes,1,opt,name=throttle,proto3" json:"throttle,omitempty"`
Terminate *L4FaultInjection_Terminate `protobuf:"bytes,2,opt,name=terminate,proto3" json:"terminate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *L4FaultInjection) Reset() { *m = L4FaultInjection{} }
func (m *L4FaultInjection) String() string { return proto.CompactTextString(m) }
func (*L4FaultInjection) ProtoMessage() {}
func (*L4FaultInjection) Descriptor() ([]byte, []int) {
return fileDescriptor_l4_fault_a9fe5b227cbbe295, []int{0}
}
func (m *L4FaultInjection) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_L4FaultInjection.Unmarshal(m, b)
}
func (m *L4FaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_L4FaultInjection.Marshal(b, m, deterministic)
}
func (dst *L4FaultInjection) XXX_Merge(src proto.Message) {
xxx_messageInfo_L4FaultInjection.Merge(dst, src)
}
func (m *L4FaultInjection) XXX_Size() int {
return xxx_messageInfo_L4FaultInjection.Size(m)
}
func (m *L4FaultInjection) XXX_DiscardUnknown() {
xxx_messageInfo_L4FaultInjection.DiscardUnknown(m)
}
var xxx_messageInfo_L4FaultInjection proto.InternalMessageInfo
func (m *L4FaultInjection) GetThrottle() *L4FaultInjection_Throttle {
if m != nil {
return m.Throttle
}
return nil
}
func (m *L4FaultInjection) GetTerminate() *L4FaultInjection_Terminate {
if m != nil {
return m.Terminate
}
return nil
}
// Bandwidth throttling for Tcp and Udp connections
type L4FaultInjection_Throttle struct {
// percentage of connections to throttle.
Percent float32 `protobuf:"fixed32,1,opt,name=percent,proto3" json:"percent,omitempty"`
// bandwidth limit in "bits" per second between downstream and Envoy
DownstreamLimitBps int64 `protobuf:"varint,2,opt,name=downstream_limit_bps,json=downstreamLimitBps,proto3" json:"downstream_limit_bps,omitempty"`
// bandwidth limits in "bits" per second between Envoy and upstream
UpstreamLimitBps int64 `protobuf:"varint,3,opt,name=upstream_limit_bps,json=upstreamLimitBps,proto3" json:"upstream_limit_bps,omitempty"`
// Types that are valid to be assigned to ThrottleAfter:
// *L4FaultInjection_Throttle_ThrottleAfterPeriod
// *L4FaultInjection_Throttle_ThrottleAfterBytes
ThrottleAfter isL4FaultInjection_Throttle_ThrottleAfter `protobuf_oneof:"throttle_after"`
// Stop throttling after the given duration. If not set, the connection
// will be throttled for its lifetime.
ThrottleForPeriod *duration.Duration `protobuf:"bytes,6,opt,name=throttle_for_period,json=throttleForPeriod,proto3" json:"throttle_for_period,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *L4FaultInjection_Throttle) Reset() { *m = L4FaultInjection_Throttle{} }
func (m *L4FaultInjection_Throttle) String() string { return proto.CompactTextString(m) }
func (*L4FaultInjection_Throttle) ProtoMessage() {}
func (*L4FaultInjection_Throttle) Descriptor() ([]byte, []int) {
return fileDescriptor_l4_fault_a9fe5b227cbbe295, []int{0, 0}
}
func (m *L4FaultInjection_Throttle) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_L4FaultInjection_Throttle.Unmarshal(m, b)
}
func (m *L4FaultInjection_Throttle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_L4FaultInjection_Throttle.Marshal(b, m, deterministic)
}
func (dst *L4FaultInjection_Throttle) XXX_Merge(src proto.Message) {
xxx_messageInfo_L4FaultInjection_Throttle.Merge(dst, src)
}
func (m *L4FaultInjection_Throttle) XXX_Size() int {
return xxx_messageInfo_L4FaultInjection_Throttle.Size(m)
}
func (m *L4FaultInjection_Throttle) XXX_DiscardUnknown() {
xxx_messageInfo_L4FaultInjection_Throttle.DiscardUnknown(m)
}
var xxx_messageInfo_L4FaultInjection_Throttle proto.InternalMessageInfo
type isL4FaultInjection_Throttle_ThrottleAfter interface {
isL4FaultInjection_Throttle_ThrottleAfter()
}
type L4FaultInjection_Throttle_ThrottleAfterPeriod struct {
ThrottleAfterPeriod *duration.Duration `protobuf:"bytes,4,opt,name=throttle_after_period,json=throttleAfterPeriod,proto3,oneof"`
}
type L4FaultInjection_Throttle_ThrottleAfterBytes struct {
ThrottleAfterBytes float64 `protobuf:"fixed64,5,opt,name=throttle_after_bytes,json=throttleAfterBytes,proto3,oneof"`
}
func (*L4FaultInjection_Throttle_ThrottleAfterPeriod) isL4FaultInjection_Throttle_ThrottleAfter() {}
func (*L4FaultInjection_Throttle_ThrottleAfterBytes) isL4FaultInjection_Throttle_ThrottleAfter() {}
func (m *L4FaultInjection_Throttle) GetThrottleAfter() isL4FaultInjection_Throttle_ThrottleAfter {
if m != nil {
return m.ThrottleAfter
}
return nil
}
func (m *L4FaultInjection_Throttle) GetPercent() float32 {
if m != nil {
return m.Percent
}
return 0
}
func (m *L4FaultInjection_Throttle) GetDownstreamLimitBps() int64 {
if m != nil {
return m.DownstreamLimitBps
}
return 0
}
func (m *L4FaultInjection_Throttle) GetUpstreamLimitBps() int64 {
if m != nil {
return m.UpstreamLimitBps
}
return 0
}
func (m *L4FaultInjection_Throttle) GetThrottleAfterPeriod() *duration.Duration {
if x, ok := m.GetThrottleAfter().(*L4FaultInjection_Throttle_ThrottleAfterPeriod); ok {
return x.ThrottleAfterPeriod
}
return nil
}
func (m *L4FaultInjection_Throttle) GetThrottleAfterBytes() float64 {
if x, ok := m.GetThrottleAfter().(*L4FaultInjection_Throttle_ThrottleAfterBytes); ok {
return x.ThrottleAfterBytes
}
return 0
}
func (m *L4FaultInjection_Throttle) GetThrottleForPeriod() *duration.Duration {
if m != nil {
return m.ThrottleForPeriod
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*L4FaultInjection_Throttle) 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 _L4FaultInjection_Throttle_OneofMarshaler, _L4FaultInjection_Throttle_OneofUnmarshaler, _L4FaultInjection_Throttle_OneofSizer, []interface{}{
(*L4FaultInjection_Throttle_ThrottleAfterPeriod)(nil),
(*L4FaultInjection_Throttle_ThrottleAfterBytes)(nil),
}
}
func _L4FaultInjection_Throttle_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*L4FaultInjection_Throttle)
// throttle_after
switch x := m.ThrottleAfter.(type) {
case *L4FaultInjection_Throttle_ThrottleAfterPeriod:
b.EncodeVarint(4<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.ThrottleAfterPeriod); err != nil {
return err
}
case *L4FaultInjection_Throttle_ThrottleAfterBytes:
b.EncodeVarint(5<<3 | proto.WireFixed64)
b.EncodeFixed64(math.Float64bits(x.ThrottleAfterBytes))
case nil:
default:
return fmt.Errorf("L4FaultInjection_Throttle.ThrottleAfter has unexpected type %T", x)
}
return nil
}
func _L4FaultInjection_Throttle_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*L4FaultInjection_Throttle)
switch tag {
case 4: // throttle_after.throttle_after_period
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(duration.Duration)
err := b.DecodeMessage(msg)
m.ThrottleAfter = &L4FaultInjection_Throttle_ThrottleAfterPeriod{msg}
return true, err
case 5: // throttle_after.throttle_after_bytes
if wire != proto.WireFixed64 {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeFixed64()
m.ThrottleAfter = &L4FaultInjection_Throttle_ThrottleAfterBytes{math.Float64frombits(x)}
return true, err
default:
return false, nil
}
}
func _L4FaultInjection_Throttle_OneofSizer(msg proto.Message) (n int) {
m := msg.(*L4FaultInjection_Throttle)
// throttle_after
switch x := m.ThrottleAfter.(type) {
case *L4FaultInjection_Throttle_ThrottleAfterPeriod:
s := proto.Size(x.ThrottleAfterPeriod)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *L4FaultInjection_Throttle_ThrottleAfterBytes:
n += 1 // tag and wire
n += 8
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// Abruptly reset (terminate) the Tcp connection after it has been
// established, emulating remote server crash or link failure.
type L4FaultInjection_Terminate struct {
// percentage of established Tcp connections to be terminated/reset
Percent float32 `protobuf:"fixed32,1,opt,name=percent,proto3" json:"percent,omitempty"`
// TODO: see if it makes sense to create a generic Duration type to
// express time interval related configs.
TerminateAfterPeriod *duration.Duration `protobuf:"bytes,2,opt,name=terminate_after_period,json=terminateAfterPeriod,proto3" json:"terminate_after_period,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *L4FaultInjection_Terminate) Reset() { *m = L4FaultInjection_Terminate{} }
func (m *L4FaultInjection_Terminate) String() string { return proto.CompactTextString(m) }
func (*L4FaultInjection_Terminate) ProtoMessage() {}
func (*L4FaultInjection_Terminate) Descriptor() ([]byte, []int) {
return fileDescriptor_l4_fault_a9fe5b227cbbe295, []int{0, 1}
}
func (m *L4FaultInjection_Terminate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_L4FaultInjection_Terminate.Unmarshal(m, b)
}
func (m *L4FaultInjection_Terminate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_L4FaultInjection_Terminate.Marshal(b, m, deterministic)
}
func (dst *L4FaultInjection_Terminate) XXX_Merge(src proto.Message) {
xxx_messageInfo_L4FaultInjection_Terminate.Merge(dst, src)
}
func (m *L4FaultInjection_Terminate) XXX_Size() int {
return xxx_messageInfo_L4FaultInjection_Terminate.Size(m)
}
func (m *L4FaultInjection_Terminate) XXX_DiscardUnknown() {
xxx_messageInfo_L4FaultInjection_Terminate.DiscardUnknown(m)
}
var xxx_messageInfo_L4FaultInjection_Terminate proto.InternalMessageInfo
func (m *L4FaultInjection_Terminate) GetPercent() float32 {
if m != nil {
return m.Percent
}
return 0
}
func (m *L4FaultInjection_Terminate) GetTerminateAfterPeriod() *duration.Duration {
if m != nil {
return m.TerminateAfterPeriod
}
return nil
}
func init() {
proto.RegisterType((*L4FaultInjection)(nil), "istio.routing.v1alpha1.L4FaultInjection")
proto.RegisterType((*L4FaultInjection_Throttle)(nil), "istio.routing.v1alpha1.L4FaultInjection.Throttle")
proto.RegisterType((*L4FaultInjection_Terminate)(nil), "istio.routing.v1alpha1.L4FaultInjection.Terminate")
}
func init() {
proto.RegisterFile("routing/v1alpha1/l4_fault.proto", fileDescriptor_l4_fault_a9fe5b227cbbe295)
}
var fileDescriptor_l4_fault_a9fe5b227cbbe295 = []byte{
// 375 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xd1, 0x4e, 0xc2, 0x30,
0x18, 0x85, 0xd9, 0x10, 0x84, 0x9a, 0x18, 0xac, 0x48, 0x26, 0x89, 0x42, 0xbc, 0xe2, 0xc2, 0x74,
0x82, 0xbc, 0x80, 0x8b, 0x21, 0x90, 0x60, 0x20, 0x8b, 0x57, 0xde, 0x2c, 0x1d, 0x74, 0x50, 0x33,
0xd6, 0xa6, 0xeb, 0x30, 0xbe, 0x87, 0xcf, 0xe8, 0x73, 0x98, 0x95, 0x75, 0x08, 0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