| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
package lightsteppb |
| 15 |
|
| 16 |
import proto "github.com/gogo/protobuf/proto" |
| 17 |
import fmt "fmt" |
| 18 |
import math "math" |
| 19 |
|
| 20 |
import encoding_binary "encoding/binary" |
| 21 |
|
| 22 |
import io "io" |
| 23 |
|
| 24 |
|
| 25 |
var _ = proto.Marshal |
| 26 |
var _ = fmt.Errorf |
| 27 |
var _ = math.Inf |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
const _ = proto.GoGoProtoPackageIsVersion2 |
| 34 |
|
| 35 |
|
| 36 |
type BinaryCarrier struct { |
| 37 |
|
| 38 |
DeprecatedTextCtx [][]byte `protobuf:"bytes,1,rep,name=deprecated_text_ctx,json=deprecatedTextCtx" json:"deprecated_text_ctx,omitempty"` |
| 39 |
|
| 40 |
BasicCtx *BasicTracerCarrier `protobuf:"bytes,2,opt,name=basic_ctx,json=basicCtx" json:"basic_ctx,omitempty"` |
| 41 |
} |
| 42 |
|
| 43 |
func (m *BinaryCarrier) Reset() { *m = BinaryCarrier{} } |
| 44 |
func (m *BinaryCarrier) String() string { return proto.CompactTextString(m) } |
| 45 |
func (*BinaryCarrier) ProtoMessage() {} |
| 46 |
func (*BinaryCarrier) Descriptor() ([]byte, []int) { return fileDescriptorLightstep, []int{0} } |
| 47 |
|
| 48 |
func (m *BinaryCarrier) GetDeprecatedTextCtx() [][]byte { |
| 49 |
if m != nil { |
| 50 |
return m.DeprecatedTextCtx |
| 51 |
} |
| 52 |
return nil |
| 53 |
} |
| 54 |
|
| 55 |
func (m *BinaryCarrier) GetBasicCtx() *BasicTracerCarrier { |
| 56 |
if m != nil { |
| 57 |
return m.BasicCtx |
| 58 |
} |
| 59 |
return nil |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
type BasicTracerCarrier struct { |
| 64 |
TraceId uint64 `protobuf:"fixed64,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` |
| 65 |
SpanId uint64 `protobuf:"fixed64,2,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` |
| 66 |
Sampled bool `protobuf:"varint,3,opt,name=sampled,proto3" json:"sampled,omitempty"` |
| 67 |
BaggageItems map[string]string `protobuf:"bytes,4,rep,name=baggage_items,json=baggageItems" json:"baggage_items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` |
| 68 |
} |
| 69 |
|
| 70 |
func (m *BasicTracerCarrier) Reset() { *m = BasicTracerCarrier{} } |
| 71 |
func (m *BasicTracerCarrier) String() string { return proto.CompactTextString(m) } |
| 72 |
func (*BasicTracerCarrier) ProtoMessage() {} |
| 73 |
func (*BasicTracerCarrier) Descriptor() ([]byte, []int) { return fileDescriptorLightstep, []int{1} } |
| 74 |
|
| 75 |
func (m *BasicTracerCarrier) GetTraceId() uint64 { |
| 76 |
if m != nil { |
| 77 |
return m.TraceId |
| 78 |
} |
| 79 |
return 0 |
| 80 |
} |
| 81 |
|
| 82 |
func (m *BasicTracerCarrier) GetSpanId() uint64 { |
| 83 |
if m != nil { |
| 84 |
return m.SpanId |
| 85 |
} |
| 86 |
return 0 |
| 87 |
} |
| 88 |
|
| 89 |
func (m *BasicTracerCarrier) GetSampled() bool { |
| 90 |
if m != nil { |
| 91 |
return m.Sampled |
| 92 |
} |
| 93 |
return false |
| 94 |
} |
| 95 |
|
| 96 |
func (m *BasicTracerCarrier) GetBaggageItems() map[string]string { |
| 97 |
if m != nil { |
| 98 |
return m.BaggageItems |
| 99 |
} |
| 100 |
return nil |
| 101 |
} |
| 102 |
|
| 103 |
func init() { |
| 104 |
proto.RegisterType((*BinaryCarrier)(nil), "lightstep.BinaryCarrier") |
| 105 |
proto.RegisterType((*BasicTracerCarrier)(nil), "lightstep.BasicTracerCarrier") |
| 106 |
} |
| 107 |
func (m *BinaryCarrier) Marshal() (dAtA []byte, err error) { |
| 108 |
size := m.Size() |
| 109 |
dAtA = make([]byte, size) |
| 110 |
n, err := m.MarshalTo(dAtA) |
| 111 |
if err != nil { |
| 112 |
return nil, err |
| 113 |
} |
| 114 |
return dAtA[:n], nil |
| 115 |
} |
| 116 |
|
| 117 |
func (m *BinaryCarrier) MarshalTo(dAtA []byte) (int, error) { |
| 118 |
var i int |
| 119 |
_ = i |
| 120 |
var l int |
| 121 |
_ = l |
| 122 |
if len(m.DeprecatedTextCtx) > 0 { |
| 123 |
for _, b := range m.DeprecatedTextCtx { |
| 124 |
dAtA[i] = 0xa |
| 125 |
i++ |
| 126 |
i = encodeVarintLightstep(dAtA, i, uint64(len(b))) |
| 127 |
i += copy(dAtA[i:], b) |
| 128 |
} |
| 129 |
} |
| 130 |
if m.BasicCtx != nil { |
| 131 |
dAtA[i] = 0x12 |
| 132 |
i++ |
| 133 |
i = encodeVarintLightstep(dAtA, i, uint64(m.BasicCtx.Size())) |
| 134 |
n1, err := m.BasicCtx.MarshalTo(dAtA[i:]) |
| 135 |
if err != nil { |
| 136 |
return 0, err |
| 137 |
} |
| 138 |
i += n1 |
| 139 |
} |
| 140 |
return i, nil |
| 141 |
} |
| 142 |
|
| 143 |
func (m *BasicTracerCarrier) Marshal() (dAtA []byte, err error) { |
| 144 |
size := m.Size() |
| 145 |
dAtA = make([]byte, size) |
| 146 |
n, err := m.MarshalTo(dAtA) |
| 147 |
if err != nil { |
| 148 |
return nil, err |
| 149 |
} |
| 150 |
return dAtA[:n], nil |
| 151 |
} |
| 152 |
|
| 153 |
func (m *BasicTracerCarrier) MarshalTo(dAtA []byte) (int, error) { |
| 154 |
var i int |
| 155 |
_ = i |
| 156 |
var l int |
| 157 |
_ = l |
| 158 |
if m.TraceId != 0 { |
| 159 |
dAtA[i] = 0x9 |
| 160 |
i++ |
| 161 |
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TraceId)) |
| 162 |
i += 8 |
| 163 |
} |
| 164 |
if m.SpanId != 0 { |
| 165 |
dAtA[i] = 0x11 |
| 166 |
i++ |
| 167 |
encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.SpanId)) |
| 168 |
i += 8 |
| 169 |
} |
| 170 |
if m.Sampled { |
| 171 |
dAtA[i] = 0x18 |
| 172 |
i++ |
| 173 |
if m.Sampled { |
| 174 |
dAtA[i] = 1 |
| 175 |
} else { |
| 176 |
dAtA[i] = 0 |
| 177 |
} |
| 178 |
i++ |
| 179 |
} |
| 180 |
if len(m.BaggageItems) > 0 { |
| 181 |
for k, _ := range m.BaggageItems { |
| 182 |
dAtA[i] = 0x22 |
| 183 |
i++ |
| 184 |
v := m.BaggageItems[k] |
| 185 |
mapSize := 1 + len(k) + sovLightstep(uint64(len(k))) + 1 + len(v) + sovLightstep(uint64(len(v))) |
| 186 |
i = encodeVarintLightstep(dAtA, i, uint64(mapSize)) |
| 187 |
dAtA[i] = 0xa |
| 188 |
i++ |
| 189 |
i = encodeVarintLightstep(dAtA, i, uint64(len(k))) |
| 190 |
i += copy(dAtA[i:], k) |
| 191 |
dAtA[i] = 0x12 |
| 192 |
i++ |
| 193 |
i = encodeVarintLightstep(dAtA, i, uint64(len(v))) |
| 194 |
i += copy(dAtA[i:], v) |
| 195 |
} |
| 196 |
} |
| 197 |
return i, nil |
| 198 |
} |
| 199 |
|
| 200 |
func encodeVarintLightstep(dAtA []byte, offset int, v uint64) int { |
| 201 |
for v >= 1<<7 { |
| 202 |
dAtA[offset] = uint8(v&0x7f | 0x80) |
| 203 |
v >>= 7 |
| 204 |
offset++ |
| 205 |
} |
| 206 |
dAtA[offset] = uint8(v) |
| 207 |
return offset + 1 |
| 208 |
} |
| 209 |
func (m *BinaryCarrier) Size() (n int) { |
| 210 |
var l int |
| 211 |
_ = l |
| 212 |
if len(m.DeprecatedTextCtx) > 0 { |
| 213 |
for _, b := range m.DeprecatedTextCtx { |
| 214 |
l = len(b) |
| 215 |
n += 1 + l + sovLightstep(uint64(l)) |
| 216 |
} |
| 217 |
} |
| 218 |
if m.BasicCtx != nil { |
| 219 |
l = m.BasicCtx.Size() |
| 220 |
n += 1 + l + sovLightstep(uint64(l)) |
| 221 |
} |
| 222 |
return n |
| 223 |
} |
| 224 |
|
| 225 |
func (m *BasicTracerCarrier) Size() (n int) { |
| 226 |
var l int |
| 227 |
_ = l |
| 228 |
if m.TraceId != 0 { |
| 229 |
n += 9 |
| 230 |
} |
| 231 |
if m.SpanId != 0 { |
| 232 |
n += 9 |
| 233 |
} |
| 234 |
if m.Sampled { |
| 235 |
n += 2 |
| 236 |
} |
| 237 |
if len(m.BaggageItems) > 0 { |
| 238 |
for k, v := range m.BaggageItems { |
| 239 |
_ = k |
| 240 |
_ = v |
| 241 |
mapEntrySize := 1 + len(k) + sovLightstep(uint64(len(k))) + 1 + len(v) + sovLightstep(uint64(len(v))) |
| 242 |
n += mapEntrySize + 1 + sovLightstep(uint64(mapEntrySize)) |
| 243 |
} |
| 244 |
} |
| 245 |
return n |
| 246 |
} |
| 247 |
|
| 248 |
func sovLightstep(x uint64) (n int) { |
| 249 |
for { |
| 250 |
n++ |
| 251 |
x >>= 7 |
| 252 |
if x == 0 { |
| 253 |
break |
| 254 |
} |
| 255 |
} |
| 256 |
return n |
| 257 |
} |
| 258 |
func sozLightstep(x uint64) (n int) { |
| 259 |
return sovLightstep(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 260 |
} |
| 261 |
func (m *BinaryCarrier) Unmarshal(dAtA []byte) error { |
| 262 |
l := len(dAtA) |
| 263 |
iNdEx := 0 |
| 264 |
for iNdEx < l { |
| 265 |
preIndex := iNdEx |
| 266 |
var wire uint64 |
| 267 |
for shift := uint(0); ; shift += 7 { |
| 268 |
if shift >= 64 { |
| 269 |
return ErrIntOverflowLightstep |
| 270 |
} |
| 271 |
if iNdEx >= l { |
| 272 |
return io.ErrUnexpectedEOF |
| 273 |
} |
| 274 |
b := dAtA[iNdEx] |
| 275 |
iNdEx++ |
| 276 |
wire |= (uint64(b) & 0x7F) << shift |
| 277 |
if b < 0x80 { |
| 278 |
break |
| 279 |
} |
| 280 |
} |
| 281 |
fieldNum := int32(wire >> 3) |
| 282 |
wireType := int(wire & 0x7) |
| 283 |
if wireType == 4 { |
| 284 |
return fmt.Errorf("proto: BinaryCarrier: wiretype end group for non-group") |
| 285 |
} |
| 286 |
if fieldNum <= 0 { |
| 287 |
return fmt.Errorf("proto: BinaryCarrier: illegal tag %d (wire type %d)", fieldNum, wire) |
| 288 |
} |
| 289 |
switch fieldNum { |
| 290 |
case 1: |
| 291 |
if wireType != 2 { |
| 292 |
return fmt.Errorf("proto: wrong wireType = %d for field DeprecatedTextCtx", wireType) |
| 293 |
} |
| 294 |
var byteLen int |
| 295 |
for shift := uint(0); ; shift += 7 { |
| 296 |
if shift >= 64 { |
| 297 |
return ErrIntOverflowLightstep |
| 298 |
} |
| 299 |
if iNdEx >= l { |
| 300 |
return io.ErrUnexpectedEOF |
| 301 |
} |
| 302 |
b := dAtA[iNdEx] |
| 303 |
iNdEx++ |
| 304 |
byteLen |= (int(b) & 0x7F) << shift |
| 305 |
if b < 0x80 { |
| 306 |
break |
| 307 |
} |
| 308 |
} |
| 309 |
if byteLen < 0 { |
| 310 |
return ErrInvalidLengthLightstep |
| 311 |
} |
| 312 |
postIndex := iNdEx + byteLen |
| 313 |
if postIndex > l { |
| 314 |
return io.ErrUnexpectedEOF |
| 315 |
} |
| 316 |
m.DeprecatedTextCtx = append(m.DeprecatedTextCtx, make([]byte, postIndex-iNdEx)) |
| 317 |
copy(m.DeprecatedTextCtx[len(m.DeprecatedTextCtx)-1], dAtA[iNdEx:postIndex]) |
| 318 |
iNdEx = postIndex |
| 319 |
case 2: |
| 320 |
if wireType != 2 { |
| 321 |
return fmt.Errorf("proto: wrong wireType = %d for field BasicCtx", wireType) |
| 322 |
} |
| 323 |
var msglen int |
| 324 |
for shift := uint(0); ; shift += 7 { |
| 325 |
if shift >= 64 { |
| 326 |
return ErrIntOverflowLightstep |
| 327 |
} |
| 328 |
if iNdEx >= l { |
| 329 |
return io.ErrUnexpectedEOF |
| 330 |
} |
| 331 |
b := dAtA[iNdEx] |
| 332 |
iNdEx++ |
| 333 |
msglen |= (int(b) & 0x7F) << shift |
| 334 |
if b < 0x80 { |
| 335 |
break |
| 336 |
} |
| 337 |
} |
| 338 |
if msglen < 0 { |
| 339 |
return ErrInvalidLengthLightstep |
| 340 |
} |
| 341 |
postIndex := iNdEx + msglen |
| 342 |
if postIndex > l { |
| 343 |
return io.ErrUnexpectedEOF |
| 344 |
} |
| 345 |
if m.BasicCtx == nil { |
| 346 |
m.BasicCtx = &BasicTracerCarrier{} |
| 347 |
} |
| 348 |
if err := m.BasicCtx.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 349 |
return err |
| 350 |
} |
| 351 |
iNdEx = postIndex |
| 352 |
default: |
| 353 |
iNdEx = preIndex |
| 354 |
skippy, err := skipLightstep(dAtA[iNdEx:]) |
| 355 |
if err != nil { |
| 356 |
return err |
| 357 |
} |
| 358 |
if skippy < 0 { |
| 359 |
return ErrInvalidLengthLightstep |
| 360 |
} |
| 361 |
if (iNdEx + skippy) > l { |
| 362 |
return io.ErrUnexpectedEOF |
| 363 |
} |
| 364 |
iNdEx += skippy |
| 365 |
} |
| 366 |
} |
| 367 |
|
| 368 |
if iNdEx > l { |
| 369 |
return io.ErrUnexpectedEOF |
| 370 |
} |
| 371 |
return nil |
| 372 |
} |
| 373 |
func (m *BasicTracerCarrier) Unmarshal(dAtA []byte) error { |
| 374 |
l := len(dAtA) |
| 375 |
iNdEx := 0 |
| 376 |
for iNdEx < l { |
| 377 |
preIndex := iNdEx |
| 378 |
var wire uint64 |
| 379 |
for shift := uint(0); ; shift += 7 { |
| 380 |
if shift >= 64 { |
| 381 |
return ErrIntOverflowLightstep |
| 382 |
} |
| 383 |
if iNdEx >= l { |
| 384 |
return io.ErrUnexpectedEOF |
| 385 |
} |
| 386 |
b := dAtA[iNdEx] |
| 387 |
iNdEx++ |
| 388 |
wire |= (uint64(b) & 0x7F) << shift |
| 389 |
if b < 0x80 { |
| 390 |
break |
| 391 |
} |
| 392 |
} |
| 393 |
fieldNum := int32(wire >> 3) |
| 394 |
wireType := int(wire & 0x7) |
| 395 |
if wireType == 4 { |
| 396 |
return fmt.Errorf("proto: BasicTracerCarrier: wiretype end group for non-group") |
| 397 |
} |
| 398 |
if fieldNum <= 0 { |
| 399 |
return fmt.Errorf("proto: BasicTracerCarrier: illegal tag %d (wire type %d)", fieldNum, wire) |
| 400 |
} |
| 401 |
switch fieldNum { |
| 402 |
case 1: |
| 403 |
if wireType != 1 { |
| 404 |
return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) |
| 405 |
} |
| 406 |
m.TraceId = 0 |
| 407 |
if (iNdEx + 8) > l { |
| 408 |
return io.ErrUnexpectedEOF |
| 409 |
} |
| 410 |
m.TraceId = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) |
| 411 |
iNdEx += 8 |
| 412 |
case 2: |
| 413 |
if wireType != 1 { |
| 414 |
return fmt.Errorf("proto: wrong wireType = %d for field SpanId", wireType) |
| 415 |
} |
| 416 |
m.SpanId = 0 |
| 417 |
if (iNdEx + 8) > l { |
| 418 |
return io.ErrUnexpectedEOF |
| 419 |
} |
| 420 |
m.SpanId = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) |
| 421 |
iNdEx += 8 |
| 422 |
case 3: |
| 423 |
if wireType != 0 { |
| 424 |
return fmt.Errorf("proto: wrong wireType = %d for field Sampled", wireType) |
| 425 |
} |
| 426 |
var v int |
| 427 |
for shift := uint(0); ; shift += 7 { |
| 428 |
if shift >= 64 { |
| 429 |
return ErrIntOverflowLightstep |
| 430 |
} |
| 431 |
if iNdEx >= l { |
| 432 |
return io.ErrUnexpectedEOF |
| 433 |
} |
| 434 |
b := dAtA[iNdEx] |
| 435 |
iNdEx++ |
| 436 |
v |= (int(b) & 0x7F) << shift |
| 437 |
if b < 0x80 { |
| 438 |
break |
| 439 |
} |
| 440 |
} |
| 441 |
m.Sampled = bool(v != 0) |
| 442 |
case 4: |
| 443 |
if wireType != 2 { |
| 444 |
return fmt.Errorf("proto: wrong wireType = %d for field BaggageItems", wireType) |
| 445 |
} |
| 446 |
var msglen int |
| 447 |
for shift := uint(0); ; shift += 7 { |
| 448 |
if shift >= 64 { |
| 449 |
return ErrIntOverflowLightstep |
| 450 |
} |
| 451 |
if iNdEx >= l { |
| 452 |
return io.ErrUnexpectedEOF |
| 453 |
} |
| 454 |
b := dAtA[iNdEx] |
| 455 |
iNdEx++ |
| 456 |
msglen |= (int(b) & 0x7F) << shift |
| 457 |
if b < 0x80 { |
| 458 |
break |
| 459 |
} |
| 460 |
} |
| 461 |
if msglen < 0 { |
| 462 |
return ErrInvalidLengthLightstep |
| 463 |
} |
| 464 |
postIndex := iNdEx + msglen |
| 465 |
if postIndex > l { |
| 466 |
return io.ErrUnexpectedEOF |
| 467 |
} |
| 468 |
if m.BaggageItems == nil { |
| 469 |
m.BaggageItems = make(map[string]string) |
| 470 |
} |
| 471 |
var mapkey string |
| 472 |
var mapvalue string |
| 473 |
for iNdEx < postIndex { |
| 474 |
entryPreIndex := iNdEx |
| 475 |
var wire uint64 |
| 476 |
for shift := uint(0); ; shift += 7 { |
| 477 |
if shift >= 64 { |
| 478 |
return ErrIntOverflowLightstep |
| 479 |
} |
| 480 |
if iNdEx >= l { |
| 481 |
return io.ErrUnexpectedEOF |
| 482 |
} |
| 483 |
b := dAtA[iNdEx] |
| 484 |
iNdEx++ |
| 485 |
wire |= (uint64(b) & 0x7F) << shift |
| 486 |
if b < 0x80 { |
| 487 |
break |
| 488 |
} |
| 489 |
} |
| 490 |
fieldNum := int32(wire >> 3) |
| 491 |
if fieldNum == 1 { |
| 492 |
var stringLenmapkey uint64 |
| 493 |
for shift := uint(0); ; shift += 7 { |
| 494 |
if shift >= 64 { |
| 495 |
return ErrIntOverflowLightstep |
| 496 |
} |
| 497 |
if iNdEx >= l { |
| 498 |
return io.ErrUnexpectedEOF |
| 499 |
} |
| 500 |
b := dAtA[iNdEx] |
| 501 |
iNdEx++ |
| 502 |
stringLenmapkey |= (uint64(b) & 0x7F) << shift |
| 503 |
if b < 0x80 { |
| 504 |
break |
| 505 |
} |
| 506 |
} |
| 507 |
intStringLenmapkey := int(stringLenmapkey) |
| 508 |
if intStringLenmapkey < 0 { |
| 509 |
return ErrInvalidLengthLightstep |
| 510 |
} |
| 511 |
postStringIndexmapkey := iNdEx + intStringLenmapkey |
| 512 |
if postStringIndexmapkey > l { |
| 513 |
return io.ErrUnexpectedEOF |
| 514 |
} |
| 515 |
mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) |
| 516 |
iNdEx = postStringIndexmapkey |
| 517 |
} else if fieldNum == 2 { |
| 518 |
var stringLenmapvalue uint64 |
| 519 |
for shift := uint(0); ; shift += 7 { |
| 520 |
if shift >= 64 { |
| 521 |
return ErrIntOverflowLightstep |
| 522 |
} |
| 523 |
if iNdEx >= l { |
| 524 |
return io.ErrUnexpectedEOF |
| 525 |
} |
| 526 |
b := dAtA[iNdEx] |
| 527 |
iNdEx++ |
| 528 |
stringLenmapvalue |= (uint64(b) & 0x7F) << shift |
| 529 |
if b < 0x80 { |
| 530 |
break |
| 531 |
} |
| 532 |
} |
| 533 |
intStringLenmapvalue := int(stringLenmapvalue) |
| 534 |
if intStringLenmapvalue < 0 { |
| 535 |
return ErrInvalidLengthLightstep |
| 536 |
} |
| 537 |
postStringIndexmapvalue := iNdEx + intStringLenmapvalue |
| 538 |
if postStringIndexmapvalue > l { |
| 539 |
return io.ErrUnexpectedEOF |
| 540 |
} |
| 541 |
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) |
| 542 |
iNdEx = postStringIndexmapvalue |
| 543 |
} else { |
| 544 |
iNdEx = entryPreIndex |
| 545 |
skippy, err := skipLightstep(dAtA[iNdEx:]) |
| 546 |
if err != nil { |
| 547 |
return err |
| 548 |
} |
| 549 |
if skippy < 0 { |
| 550 |
return ErrInvalidLengthLightstep |
| 551 |
} |
| 552 |
if (iNdEx + skippy) > postIndex { |
| 553 |
return io.ErrUnexpectedEOF |
| 554 |
} |
| 555 |
iNdEx += skippy |
| 556 |
} |
| 557 |
} |
| 558 |
m.BaggageItems[mapkey] = mapvalue |
| 559 |
iNdEx = postIndex |
| 560 |
default: |
| 561 |
iNdEx = preIndex |
| 562 |
skippy, err := skipLightstep(dAtA[iNdEx:]) |
| 563 |
if err != nil { |
| 564 |
return err |
| 565 |
} |
| 566 |
if skippy < 0 { |
| 567 |
return ErrInvalidLengthLightstep |
| 568 |
} |
| 569 |
if (iNdEx + skippy) > l { |
| 570 |
return io.ErrUnexpectedEOF |
| 571 |
} |
| 572 |
iNdEx += skippy |
| 573 |
} |
| 574 |
} |
| 575 |
|
| 576 |
if iNdEx > l { |
| 577 |
return io.ErrUnexpectedEOF |
| 578 |
} |
| 579 |
return nil |
| 580 |
} |
| 581 |
func skipLightstep(dAtA []byte) (n int, err error) { |
| 582 |
l := len(dAtA) |
| 583 |
iNdEx := 0 |
| 584 |
for iNdEx < l { |
| 585 |
var wire uint64 |
| 586 |
for shift := uint(0); ; shift += 7 { |
| 587 |
if shift >= 64 { |
| 588 |
return 0, ErrIntOverflowLightstep |
| 589 |
} |
| 590 |
if iNdEx >= l { |
| 591 |
return 0, io.ErrUnexpectedEOF |
| 592 |
} |
| 593 |
b := dAtA[iNdEx] |
| 594 |
iNdEx++ |
| 595 |
wire |= (uint64(b) & 0x7F) << shift |
| 596 |
if b < 0x80 { |
| 597 |
break |
| 598 |
} |
| 599 |
} |
| 600 |
wireType := int(wire & 0x7) |
| 601 |
switch wireType { |
| 602 |
case 0: |
| 603 |
for shift := uint(0); ; shift += 7 { |
| 604 |
if shift >= 64 { |
| 605 |
return 0, ErrIntOverflowLightstep |
| 606 |
} |
| 607 |
if iNdEx >= l { |
| 608 |
return 0, io.ErrUnexpectedEOF |
| 609 |
} |
| 610 |
iNdEx++ |
| 611 |
if dAtA[iNdEx-1] < 0x80 { |
| 612 |
break |
| 613 |
} |
| 614 |
} |
| 615 |
return iNdEx, nil |
| 616 |
case 1: |
| 617 |
iNdEx += 8 |
| 618 |
return iNdEx, nil |
| 619 |
case 2: |
| 620 |
var length int |
| 621 |
for shift := uint(0); ; shift += 7 { |
| 622 |
if shift >= 64 { |
| 623 |
return 0, ErrIntOverflowLightstep |
| 624 |
} |
| 625 |
if iNdEx >= l { |
| 626 |
return 0, io.ErrUnexpectedEOF |
| 627 |
} |
| 628 |
b := dAtA[iNdEx] |
| 629 |
iNdEx++ |
| 630 |
length |= (int(b) & 0x7F) << shift |
| 631 |
if b < 0x80 { |
| 632 |
break |
| 633 |
} |
| 634 |
} |
| 635 |
iNdEx += length |
| 636 |
if length < 0 { |
| 637 |
return 0, ErrInvalidLengthLightstep |
| 638 |
} |
| 639 |
return iNdEx, nil |
| 640 |
case 3: |
| 641 |
for { |
| 642 |
var innerWire uint64 |
| 643 |
var start int = iNdEx |
| 644 |
for shift := uint(0); ; shift += 7 { |
| 645 |
if shift >= 64 { |
| 646 |
return 0, ErrIntOverflowLightstep |
| 647 |
} |
| 648 |
if iNdEx >= l { |
| 649 |
return 0, io.ErrUnexpectedEOF |
| 650 |
} |
| 651 |
b := dAtA[iNdEx] |
| 652 |
iNdEx++ |
| 653 |
innerWire |= (uint64(b) & 0x7F) << shift |
| 654 |
if b < 0x80 { |
| 655 |
break |
| 656 |
} |
| 657 |
} |
| 658 |
innerWireType := int(innerWire & 0x7) |
| 659 |
if innerWireType == 4 { |
| 660 |
break |
| 661 |
} |
| 662 |
next, err := skipLightstep(dAtA[start:]) |
| 663 |
if err != nil { |
| 664 |
return 0, err |
| 665 |
} |
| 666 |
iNdEx = start + next |
| 667 |
} |
| 668 |
return iNdEx, nil |
| 669 |
case 4: |
| 670 |
return iNdEx, nil |
| 671 |
case 5: |
| 672 |
iNdEx += 4 |
| 673 |
return iNdEx, nil |
| 674 |
default: |
| 675 |
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 676 |
} |
| 677 |
} |
| 678 |
panic("unreachable") |
| 679 |
} |
| 680 |
|
| 681 |
var ( |
| 682 |
ErrInvalidLengthLightstep = fmt.Errorf("proto: negative length found during unmarshaling") |
| 683 |
ErrIntOverflowLightstep = fmt.Errorf("proto: integer overflow") |
| 684 |
) |
| 685 |
|
| 686 |
func init() { |
| 687 |
proto.RegisterFile("github.com/lightstep/lightstep-tracer-common/tmpgen/lightstep.proto", fileDescriptorLightstep) |
| 688 |
} |
| 689 |
|
| 690 |
var fileDescriptorLightstep = []byte{ |
| 691 |
|
| 692 |
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xc1, 0x4a, 0xc3, 0x40, |
| 693 |
0x10, 0x86, 0xdd, 0x46, 0xdb, 0x66, 0xdb, 0x82, 0x5d, 0x05, 0xa3, 0xd0, 0x10, 0x7a, 0xca, 0xa5, |
| 694 |
0x29, 0xd4, 0x8b, 0xf4, 0x22, 0x24, 0x78, 0xe8, 0x35, 0xf4, 0xe4, 0x25, 0x6c, 0x92, 0x21, 0x0d, |
| 695 |
0x36, 0xc9, 0xb2, 0x99, 0x4a, 0x8a, 0x2f, 0xe1, 0x63, 0x79, 0xf4, 0x11, 0xa4, 0x3e, 0x85, 0x37, |
| 696 |
0xc9, 0x56, 0x1b, 0xa1, 0xe0, 0x6d, 0xfe, 0xf9, 0xff, 0xe1, 0xff, 0x96, 0xa5, 0x5e, 0x92, 0xe2, |
| 697 |
0x6a, 0x13, 0x3a, 0x51, 0x91, 0x4d, 0xd7, 0x69, 0xb2, 0xc2, 0x12, 0x41, 0x34, 0xd3, 0x04, 0x25, |
| 698 |
0x8f, 0x40, 0x4e, 0xa2, 0x22, 0xcb, 0x8a, 0x7c, 0x8a, 0x99, 0x48, 0x20, 0x6f, 0x6c, 0x47, 0xc8, |
| 699 |
0x02, 0x0b, 0xa6, 0x1f, 0x16, 0xe3, 0x17, 0x3a, 0x70, 0xd3, 0x9c, 0xcb, 0xad, 0xc7, 0xa5, 0x4c, |
| 700 |
0x41, 0x32, 0x87, 0x5e, 0xc4, 0x20, 0x24, 0x44, 0x1c, 0x21, 0x0e, 0x10, 0x2a, 0x0c, 0x22, 0xac, |
| 701 |
0x0c, 0x62, 0x69, 0x76, 0xdf, 0x1f, 0x36, 0xd6, 0x12, 0x2a, 0xf4, 0xb0, 0x62, 0x73, 0xaa, 0x87, |
| 702 |
0xbc, 0x4c, 0x23, 0x95, 0x6a, 0x59, 0xc4, 0xee, 0xcd, 0x46, 0x4e, 0x53, 0xe8, 0xd6, 0xde, 0x52, |
| 703 |
0x41, 0xfd, 0x34, 0xf8, 0x5d, 0x95, 0xf7, 0xb0, 0x1a, 0x7f, 0x11, 0xca, 0x8e, 0x03, 0xec, 0x9a, |
| 704 |
0x76, 0xd5, 0x33, 0x82, 0x34, 0x36, 0x88, 0x45, 0xec, 0xb6, 0xdf, 0x51, 0x7a, 0x11, 0xb3, 0x2b, |
| 705 |
0xda, 0x29, 0x05, 0xcf, 0x6b, 0xa7, 0xa5, 0x9c, 0x76, 0x2d, 0x17, 0x31, 0x33, 0x68, 0xa7, 0xe4, |
| 706 |
0x99, 0x58, 0x43, 0x6c, 0x68, 0x16, 0xb1, 0xbb, 0xfe, 0xaf, 0x64, 0x4b, 0x3a, 0x08, 0x79, 0x92, |
| 707 |
0xf0, 0x04, 0x82, 0x14, 0x21, 0x2b, 0x8d, 0x53, 0x4b, 0xb3, 0x7b, 0xb3, 0xe9, 0xbf, 0x90, 0x8e, |
| 708 |
0xbb, 0x3f, 0x59, 0xd4, 0x17, 0x0f, 0x39, 0xca, 0xad, 0xdf, 0x0f, 0xff, 0xac, 0x6e, 0xee, 0xe9, |
| 709 |
0xf0, 0x28, 0xc2, 0xce, 0xa9, 0xf6, 0x04, 0x5b, 0xc5, 0xac, 0xfb, 0xf5, 0xc8, 0x2e, 0xe9, 0xd9, |
| 710 |
0x33, 0x5f, 0x6f, 0x40, 0xd1, 0xea, 0xfe, 0x5e, 0xcc, 0x5b, 0x77, 0xc4, 0x1d, 0xbd, 0xed, 0x4c, |
| 711 |
0xf2, 0xbe, 0x33, 0xc9, 0xc7, 0xce, 0x24, 0xaf, 0x9f, 0xe6, 0xc9, 0x63, 0xef, 0x00, 0x24, 0xc2, |
| 712 |
0xb0, 0xad, 0x7e, 0xea, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x95, 0x72, 0x6a, 0xa9, 0xf0, 0x01, |
| 713 |
0x00, 0x00, |
| 714 |
} |