1// Code generated by protoc-gen-gogo. DO NOT EDIT. 2// source: mixer/adapter/bypass/config/config.proto 3 4// The `bypass` adapter makes it possible to connect to gRPC based remote adapters using the compiled-in adapter 5// model. 6// 7// This adapter supports the following templates: 8// [metric](https://istio.io/docs/reference/config/policy-and-telemetry/templates/metric/). 9// [checknothing](https://istio.io/docs/reference/config/policy-and-telemetry/templates/checknothing/). 10// [reportnothing](https://istio.io/docs/reference/config/policy-and-telemetry/templates/reportnothing/). 11// [quota](https://istio.io/docs/reference/config/policy-and-telemetry/templates/quota/). 12// 13// Example configuration: 14// ``` 15// # sessionBased indicates whether the client should use the Infrastructure API of the backend 16// # to create sessions. If set to true, the bypass adapter will first create a session. 17// sessionBased: false 18// 19// # backendAddress is the remote adapter service backend address. 20// backendAddress: localhost:4567 21// 22// # params is base64 encoded Any proto that should be passed to the remote backend as 23// # configuration. 24// params: RGFuJ3MgVG9vbHMgYXJlIGNvb2wh... 25// ``` 26// 27 28package config 29 30import ( 31 fmt "fmt" 32 _ "github.com/gogo/protobuf/gogoproto" 33 proto "github.com/gogo/protobuf/proto" 34 types "github.com/gogo/protobuf/types" 35 io "io" 36 math "math" 37 math_bits "math/bits" 38 reflect "reflect" 39 strings "strings" 40) 41 42// Reference imports to suppress errors if they are not otherwise used. 43var _ = proto.Marshal 44var _ = fmt.Errorf 45var _ = math.Inf 46 47// This is a compile-time assertion to ensure that this generated file 48// is compatible with the proto package it is being compiled against. 49// A compilation error at this line likely means your copy of the 50// proto package needs to be updated. 51const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 52 53// Configuration format for the Bypass adapter. 54type Params struct { 55 // The backend address for the remote policy backend. 56 BackendAddress string `protobuf:"bytes,1,opt,name=backend_address,json=backendAddress,proto3" json:"backend_address,omitempty"` 57 // The actual config parameters to send to the remote backend. 58 Params *types.Any `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` 59 // Indicates whether the protocol is session based or not. 60 SessionBased bool `protobuf:"varint,3,opt,name=session_based,json=sessionBased,proto3" json:"session_based,omitempty"` 61} 62 63func (m *Params) Reset() { *m = Params{} } 64func (*Params) ProtoMessage() {} 65func (*Params) Descriptor() ([]byte, []int) { 66 return fileDescriptor_f65603491c411b72, []int{0} 67} 68func (m *Params) XXX_Unmarshal(b []byte) error { 69 return m.Unmarshal(b) 70} 71func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 72 if deterministic { 73 return xxx_messageInfo_Params.Marshal(b, m, deterministic) 74 } else { 75 b = b[:cap(b)] 76 n, err := m.MarshalToSizedBuffer(b) 77 if err != nil { 78 return nil, err 79 } 80 return b[:n], nil 81 } 82} 83func (m *Params) XXX_Merge(src proto.Message) { 84 xxx_messageInfo_Params.Merge(m, src) 85} 86func (m *Params) XXX_Size() int { 87 return m.Size() 88} 89func (m *Params) XXX_DiscardUnknown() { 90 xxx_messageInfo_Params.DiscardUnknown(m) 91} 92 93var xxx_messageInfo_Params proto.InternalMessageInfo 94 95func init() { 96 proto.RegisterType((*Params)(nil), "adapter.bypass.config.Params") 97} 98 99func init() { 100 proto.RegisterFile("mixer/adapter/bypass/config/config.proto", fileDescriptor_f65603491c411b72) 101} 102 103var fileDescriptor_f65603491c411b72 = []byte{ 104 // 271 bytes of a gzipped FileDescriptorProto 105 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x8f, 0x3f, 0x4e, 0xc3, 0x30, 106 0x14, 0xc6, 0xfd, 0x40, 0x8a, 0x20, 0xfc, 0x93, 0xa2, 0x22, 0x95, 0x0e, 0x4f, 0x11, 0x0c, 0x64, 107 0x40, 0xb6, 0x04, 0x17, 0xa0, 0x3d, 0x01, 0xca, 0xc8, 0x52, 0x39, 0x8d, 0x6b, 0x45, 0x50, 0x3b, 108 0xb2, 0x8b, 0x44, 0x36, 0x06, 0x0e, 0xc0, 0x31, 0x38, 0x4a, 0xc7, 0x8c, 0x1d, 0x89, 0xb3, 0x30, 109 0xf6, 0x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x8f, 0x64, 0xdb, 0x23, 0x79, 0x8e, 0xfc, 0xe6, 0x45, 0x34, 0x0c, 121 0x7f, 0xf8, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x96, 0xf4, 0x21, 0x7d, 0x43, 0x01, 0x00, 0x00, 122} 123 124func (m *Params) Marshal() (dAtA []byte, err error) { 125 size := m.Size() 126 dAtA = make([]byte, size) 127 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 128 if err != nil { 129 return nil, err 130 } 131 return dAtA[:n], nil 132} 133 134func (m *Params) MarshalTo(dAtA []byte) (int, error) { 135 size := m.Size() 136 return m.MarshalToSizedBuffer(dAtA[:size]) 137} 138 139func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { 140 i := len(dAtA) 141 _ = i 142 var l int 143 _ = l 144 if m.SessionBased { 145 i-- 146 if m.SessionBased { 147 dAtA[i] = 1 148 } else { 149 dAtA[i] = 0 150 } 151 i-- 152 dAtA[i] = 0x18 153 } 154 if m.Params != nil { 155 { 156 size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) 157 if err != nil { 158 return 0, err 159 } 160 i -= size 161 i = encodeVarintConfig(dAtA, i, uint64(size)) 162 } 163 i-- 164 dAtA[i] = 0x12 165 } 166 if len(m.BackendAddress) > 0 { 167 i -= len(m.BackendAddress) 168 copy(dAtA[i:], m.BackendAddress) 169 i = encodeVarintConfig(dAtA, i, uint64(len(m.BackendAddress))) 170 i-- 171 dAtA[i] = 0xa 172 } 173 return len(dAtA) - i, nil 174} 175 176func encodeVarintConfig(dAtA []byte, offset int, v uint64) int { 177 offset -= sovConfig(v) 178 base := offset 179 for v >= 1<<7 { 180 dAtA[offset] = uint8(v&0x7f | 0x80) 181 v >>= 7 182 offset++ 183 } 184 dAtA[offset] = uint8(v) 185 return base 186} 187func (m *Params) Size() (n int) { 188 if m == nil { 189 return 0 190 } 191 var l int 192 _ = l 193 l = len(m.BackendAddress) 194 if l > 0 { 195 n += 1 + l + sovConfig(uint64(l)) 196 } 197 if m.Params != nil { 198 l = m.Params.Size() 199 n += 1 + l + sovConfig(uint64(l)) 200 } 201 if m.SessionBased { 202 n += 2 203 } 204 return n 205} 206 207func sovConfig(x uint64) (n int) { 208 return (math_bits.Len64(x|1) + 6) / 7 209} 210func sozConfig(x uint64) (n int) { 211 return sovConfig(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 212} 213func (this *Params) String() string { 214 if this == nil { 215 return "nil" 216 } 217 s := strings.Join([]string{`&Params{`, 218 `BackendAddress:` + fmt.Sprintf("%v", this.BackendAddress) + `,`, 219 `Params:` + strings.Replace(fmt.Sprintf("%v", this.Params), "Any", "types.Any", 1) + `,`, 220 `SessionBased:` + fmt.Sprintf("%v", this.SessionBased) + `,`, 221 `}`, 222 }, "") 223 return s 224} 225func valueToStringConfig(v interface{}) string { 226 rv := reflect.ValueOf(v) 227 if rv.IsNil() { 228 return "nil" 229 } 230 pv := reflect.Indirect(rv).Interface() 231 return fmt.Sprintf("*%v", pv) 232} 233func (m *Params) Unmarshal(dAtA []byte) error { 234 l := len(dAtA) 235 iNdEx := 0 236 for iNdEx < l { 237 preIndex := iNdEx 238 var wire uint64 239 for shift := uint(0); ; shift += 7 { 240 if shift >= 64 { 241 return ErrIntOverflowConfig 242 } 243 if iNdEx >= l { 244 return io.ErrUnexpectedEOF 245 } 246 b := dAtA[iNdEx] 247 iNdEx++ 248 wire |= uint64(b&0x7F) << shift 249 if b < 0x80 { 250 break 251 } 252 } 253 fieldNum := int32(wire >> 3) 254 wireType := int(wire & 0x7) 255 if wireType == 4 { 256 return fmt.Errorf("proto: Params: wiretype end group for non-group") 257 } 258 if fieldNum <= 0 { 259 return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) 260 } 261 switch fieldNum { 262 case 1: 263 if wireType != 2 { 264 return fmt.Errorf("proto: wrong wireType = %d for field BackendAddress", wireType) 265 } 266 var stringLen uint64 267 for shift := uint(0); ; shift += 7 { 268 if shift >= 64 { 269 return ErrIntOverflowConfig 270 } 271 if iNdEx >= l { 272 return io.ErrUnexpectedEOF 273 } 274 b := dAtA[iNdEx] 275 iNdEx++ 276 stringLen |= uint64(b&0x7F) << shift 277 if b < 0x80 { 278 break 279 } 280 } 281 intStringLen := int(stringLen) 282 if intStringLen < 0 { 283 return ErrInvalidLengthConfig 284 } 285 postIndex := iNdEx + intStringLen 286 if postIndex < 0 { 287 return ErrInvalidLengthConfig 288 } 289 if postIndex > l { 290 return io.ErrUnexpectedEOF 291 } 292 m.BackendAddress = string(dAtA[iNdEx:postIndex]) 293 iNdEx = postIndex 294 case 2: 295 if wireType != 2 { 296 return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) 297 } 298 var msglen int 299 for shift := uint(0); ; shift += 7 { 300 if shift >= 64 { 301 return ErrIntOverflowConfig 302 } 303 if iNdEx >= l { 304 return io.ErrUnexpectedEOF 305 } 306 b := dAtA[iNdEx] 307 iNdEx++ 308 msglen |= int(b&0x7F) << shift 309 if b < 0x80 { 310 break 311 } 312 } 313 if msglen < 0 { 314 return ErrInvalidLengthConfig 315 } 316 postIndex := iNdEx + msglen 317 if postIndex < 0 { 318 return ErrInvalidLengthConfig 319 } 320 if postIndex > l { 321 return io.ErrUnexpectedEOF 322 } 323 if m.Params == nil { 324 m.Params = &types.Any{} 325 } 326 if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 327 return err 328 } 329 iNdEx = postIndex 330 case 3: 331 if wireType != 0 { 332 return fmt.Errorf("proto: wrong wireType = %d for field SessionBased", wireType) 333 } 334 var v int 335 for shift := uint(0); ; shift += 7 { 336 if shift >= 64 { 337 return ErrIntOverflowConfig 338 } 339 if iNdEx >= l { 340 return io.ErrUnexpectedEOF 341 } 342 b := dAtA[iNdEx] 343 iNdEx++ 344 v |= int(b&0x7F) << shift 345 if b < 0x80 { 346 break 347 } 348 } 349 m.SessionBased = bool(v != 0) 350 default: 351 iNdEx = preIndex 352 skippy, err := skipConfig(dAtA[iNdEx:]) 353 if err != nil { 354 return err 355 } 356 if skippy < 0 { 357 return ErrInvalidLengthConfig 358 } 359 if (iNdEx + skippy) < 0 { 360 return ErrInvalidLengthConfig 361 } 362 if (iNdEx + skippy) > l { 363 return io.ErrUnexpectedEOF 364 } 365 iNdEx += skippy 366 } 367 } 368 369 if iNdEx > l { 370 return io.ErrUnexpectedEOF 371 } 372 return nil 373} 374func skipConfig(dAtA []byte) (n int, err error) { 375 l := len(dAtA) 376 iNdEx := 0 377 for iNdEx < l { 378 var wire uint64 379 for shift := uint(0); ; shift += 7 { 380 if shift >= 64 { 381 return 0, ErrIntOverflowConfig 382 } 383 if iNdEx >= l { 384 return 0, io.ErrUnexpectedEOF 385 } 386 b := dAtA[iNdEx] 387 iNdEx++ 388 wire |= (uint64(b) & 0x7F) << shift 389 if b < 0x80 { 390 break 391 } 392 } 393 wireType := int(wire & 0x7) 394 switch wireType { 395 case 0: 396 for shift := uint(0); ; shift += 7 { 397 if shift >= 64 { 398 return 0, ErrIntOverflowConfig 399 } 400 if iNdEx >= l { 401 return 0, io.ErrUnexpectedEOF 402 } 403 iNdEx++ 404 if dAtA[iNdEx-1] < 0x80 { 405 break 406 } 407 } 408 return iNdEx, nil 409 case 1: 410 iNdEx += 8 411 return iNdEx, nil 412 case 2: 413 var length int 414 for shift := uint(0); ; shift += 7 { 415 if shift >= 64 { 416 return 0, ErrIntOverflowConfig 417 } 418 if iNdEx >= l { 419 return 0, io.ErrUnexpectedEOF 420 } 421 b := dAtA[iNdEx] 422 iNdEx++ 423 length |= (int(b) & 0x7F) << shift 424 if b < 0x80 { 425 break 426 } 427 } 428 if length < 0 { 429 return 0, ErrInvalidLengthConfig 430 } 431 iNdEx += length 432 if iNdEx < 0 { 433 return 0, ErrInvalidLengthConfig 434 } 435 return iNdEx, nil 436 case 3: 437 for { 438 var innerWire uint64 439 var start int = iNdEx 440 for shift := uint(0); ; shift += 7 { 441 if shift >= 64 { 442 return 0, ErrIntOverflowConfig 443 } 444 if iNdEx >= l { 445 return 0, io.ErrUnexpectedEOF 446 } 447 b := dAtA[iNdEx] 448 iNdEx++ 449 innerWire |= (uint64(b) & 0x7F) << shift 450 if b < 0x80 { 451 break 452 } 453 } 454 innerWireType := int(innerWire & 0x7) 455 if innerWireType == 4 { 456 break 457 } 458 next, err := skipConfig(dAtA[start:]) 459 if err != nil { 460 return 0, err 461 } 462 iNdEx = start + next 463 if iNdEx < 0 { 464 return 0, ErrInvalidLengthConfig 465 } 466 } 467 return iNdEx, nil 468 case 4: 469 return iNdEx, nil 470 case 5: 471 iNdEx += 4 472 return iNdEx, nil 473 default: 474 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 475 } 476 } 477 panic("unreachable") 478} 479 480var ( 481 ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling") 482 ErrIntOverflowConfig = fmt.Errorf("proto: integer overflow") 483) 484