Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 1 | // Autogenerated by Thrift Compiler (0.9.3) |
| 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| 3 | |
| 4 | package jaeger |
| 5 | |
| 6 | import ( |
| 7 | "bytes" |
| 8 | "fmt" |
| 9 | "github.com/uber/jaeger-client-go/thrift" |
| 10 | ) |
| 11 | |
| 12 | // (needed to ensure safety because of naive import list construction.) |
| 13 | var _ = thrift.ZERO |
| 14 | var _ = fmt.Printf |
| 15 | var _ = bytes.Equal |
| 16 | |
| 17 | var GoUnusedProtection__ int |
| 18 | |
| 19 | type TagType int64 |
| 20 | |
| 21 | const ( |
| 22 | TagType_STRING TagType = 0 |
| 23 | TagType_DOUBLE TagType = 1 |
| 24 | TagType_BOOL TagType = 2 |
| 25 | TagType_LONG TagType = 3 |
| 26 | TagType_BINARY TagType = 4 |
| 27 | ) |
| 28 | |
| 29 | func (p TagType) String() string { |
| 30 | switch p { |
| 31 | case TagType_STRING: |
| 32 | return "STRING" |
| 33 | case TagType_DOUBLE: |
| 34 | return "DOUBLE" |
| 35 | case TagType_BOOL: |
| 36 | return "BOOL" |
| 37 | case TagType_LONG: |
| 38 | return "LONG" |
| 39 | case TagType_BINARY: |
| 40 | return "BINARY" |
| 41 | } |
| 42 | return "<UNSET>" |
| 43 | } |
| 44 | |
| 45 | func TagTypeFromString(s string) (TagType, error) { |
| 46 | switch s { |
| 47 | case "STRING": |
| 48 | return TagType_STRING, nil |
| 49 | case "DOUBLE": |
| 50 | return TagType_DOUBLE, nil |
| 51 | case "BOOL": |
| 52 | return TagType_BOOL, nil |
| 53 | case "LONG": |
| 54 | return TagType_LONG, nil |
| 55 | case "BINARY": |
| 56 | return TagType_BINARY, nil |
| 57 | } |
| 58 | return TagType(0), fmt.Errorf("not a valid TagType string") |
| 59 | } |
| 60 | |
| 61 | func TagTypePtr(v TagType) *TagType { return &v } |
| 62 | |
| 63 | func (p TagType) MarshalText() ([]byte, error) { |
| 64 | return []byte(p.String()), nil |
| 65 | } |
| 66 | |
| 67 | func (p *TagType) UnmarshalText(text []byte) error { |
| 68 | q, err := TagTypeFromString(string(text)) |
| 69 | if err != nil { |
| 70 | return err |
| 71 | } |
| 72 | *p = q |
| 73 | return nil |
| 74 | } |
| 75 | |
| 76 | type SpanRefType int64 |
| 77 | |
| 78 | const ( |
| 79 | SpanRefType_CHILD_OF SpanRefType = 0 |
| 80 | SpanRefType_FOLLOWS_FROM SpanRefType = 1 |
| 81 | ) |
| 82 | |
| 83 | func (p SpanRefType) String() string { |
| 84 | switch p { |
| 85 | case SpanRefType_CHILD_OF: |
| 86 | return "CHILD_OF" |
| 87 | case SpanRefType_FOLLOWS_FROM: |
| 88 | return "FOLLOWS_FROM" |
| 89 | } |
| 90 | return "<UNSET>" |
| 91 | } |
| 92 | |
| 93 | func SpanRefTypeFromString(s string) (SpanRefType, error) { |
| 94 | switch s { |
| 95 | case "CHILD_OF": |
| 96 | return SpanRefType_CHILD_OF, nil |
| 97 | case "FOLLOWS_FROM": |
| 98 | return SpanRefType_FOLLOWS_FROM, nil |
| 99 | } |
| 100 | return SpanRefType(0), fmt.Errorf("not a valid SpanRefType string") |
| 101 | } |
| 102 | |
| 103 | func SpanRefTypePtr(v SpanRefType) *SpanRefType { return &v } |
| 104 | |
| 105 | func (p SpanRefType) MarshalText() ([]byte, error) { |
| 106 | return []byte(p.String()), nil |
| 107 | } |
| 108 | |
| 109 | func (p *SpanRefType) UnmarshalText(text []byte) error { |
| 110 | q, err := SpanRefTypeFromString(string(text)) |
| 111 | if err != nil { |
| 112 | return err |
| 113 | } |
| 114 | *p = q |
| 115 | return nil |
| 116 | } |
| 117 | |
| 118 | // Attributes: |
| 119 | // - Key |
| 120 | // - VType |
| 121 | // - VStr |
| 122 | // - VDouble |
| 123 | // - VBool |
| 124 | // - VLong |
| 125 | // - VBinary |
| 126 | type Tag struct { |
| 127 | Key string `thrift:"key,1,required" json:"key"` |
| 128 | VType TagType `thrift:"vType,2,required" json:"vType"` |
| 129 | VStr *string `thrift:"vStr,3" json:"vStr,omitempty"` |
| 130 | VDouble *float64 `thrift:"vDouble,4" json:"vDouble,omitempty"` |
| 131 | VBool *bool `thrift:"vBool,5" json:"vBool,omitempty"` |
| 132 | VLong *int64 `thrift:"vLong,6" json:"vLong,omitempty"` |
| 133 | VBinary []byte `thrift:"vBinary,7" json:"vBinary,omitempty"` |
| 134 | } |
| 135 | |
| 136 | func NewTag() *Tag { |
| 137 | return &Tag{} |
| 138 | } |
| 139 | |
| 140 | func (p *Tag) GetKey() string { |
| 141 | return p.Key |
| 142 | } |
| 143 | |
| 144 | func (p *Tag) GetVType() TagType { |
| 145 | return p.VType |
| 146 | } |
| 147 | |
| 148 | var Tag_VStr_DEFAULT string |
| 149 | |
| 150 | func (p *Tag) GetVStr() string { |
| 151 | if !p.IsSetVStr() { |
| 152 | return Tag_VStr_DEFAULT |
| 153 | } |
| 154 | return *p.VStr |
| 155 | } |
| 156 | |
| 157 | var Tag_VDouble_DEFAULT float64 |
| 158 | |
| 159 | func (p *Tag) GetVDouble() float64 { |
| 160 | if !p.IsSetVDouble() { |
| 161 | return Tag_VDouble_DEFAULT |
| 162 | } |
| 163 | return *p.VDouble |
| 164 | } |
| 165 | |
| 166 | var Tag_VBool_DEFAULT bool |
| 167 | |
| 168 | func (p *Tag) GetVBool() bool { |
| 169 | if !p.IsSetVBool() { |
| 170 | return Tag_VBool_DEFAULT |
| 171 | } |
| 172 | return *p.VBool |
| 173 | } |
| 174 | |
| 175 | var Tag_VLong_DEFAULT int64 |
| 176 | |
| 177 | func (p *Tag) GetVLong() int64 { |
| 178 | if !p.IsSetVLong() { |
| 179 | return Tag_VLong_DEFAULT |
| 180 | } |
| 181 | return *p.VLong |
| 182 | } |
| 183 | |
| 184 | var Tag_VBinary_DEFAULT []byte |
| 185 | |
| 186 | func (p *Tag) GetVBinary() []byte { |
| 187 | return p.VBinary |
| 188 | } |
| 189 | func (p *Tag) IsSetVStr() bool { |
| 190 | return p.VStr != nil |
| 191 | } |
| 192 | |
| 193 | func (p *Tag) IsSetVDouble() bool { |
| 194 | return p.VDouble != nil |
| 195 | } |
| 196 | |
| 197 | func (p *Tag) IsSetVBool() bool { |
| 198 | return p.VBool != nil |
| 199 | } |
| 200 | |
| 201 | func (p *Tag) IsSetVLong() bool { |
| 202 | return p.VLong != nil |
| 203 | } |
| 204 | |
| 205 | func (p *Tag) IsSetVBinary() bool { |
| 206 | return p.VBinary != nil |
| 207 | } |
| 208 | |
| 209 | func (p *Tag) Read(iprot thrift.TProtocol) error { |
| 210 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 211 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 212 | } |
| 213 | |
| 214 | var issetKey bool = false |
| 215 | var issetVType bool = false |
| 216 | |
| 217 | for { |
| 218 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 219 | if err != nil { |
| 220 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 221 | } |
| 222 | if fieldTypeId == thrift.STOP { |
| 223 | break |
| 224 | } |
| 225 | switch fieldId { |
| 226 | case 1: |
| 227 | if err := p.readField1(iprot); err != nil { |
| 228 | return err |
| 229 | } |
| 230 | issetKey = true |
| 231 | case 2: |
| 232 | if err := p.readField2(iprot); err != nil { |
| 233 | return err |
| 234 | } |
| 235 | issetVType = true |
| 236 | case 3: |
| 237 | if err := p.readField3(iprot); err != nil { |
| 238 | return err |
| 239 | } |
| 240 | case 4: |
| 241 | if err := p.readField4(iprot); err != nil { |
| 242 | return err |
| 243 | } |
| 244 | case 5: |
| 245 | if err := p.readField5(iprot); err != nil { |
| 246 | return err |
| 247 | } |
| 248 | case 6: |
| 249 | if err := p.readField6(iprot); err != nil { |
| 250 | return err |
| 251 | } |
| 252 | case 7: |
| 253 | if err := p.readField7(iprot); err != nil { |
| 254 | return err |
| 255 | } |
| 256 | default: |
| 257 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 258 | return err |
| 259 | } |
| 260 | } |
| 261 | if err := iprot.ReadFieldEnd(); err != nil { |
| 262 | return err |
| 263 | } |
| 264 | } |
| 265 | if err := iprot.ReadStructEnd(); err != nil { |
| 266 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 267 | } |
| 268 | if !issetKey { |
| 269 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")) |
| 270 | } |
| 271 | if !issetVType { |
| 272 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field VType is not set")) |
| 273 | } |
| 274 | return nil |
| 275 | } |
| 276 | |
| 277 | func (p *Tag) readField1(iprot thrift.TProtocol) error { |
| 278 | if v, err := iprot.ReadString(); err != nil { |
| 279 | return thrift.PrependError("error reading field 1: ", err) |
| 280 | } else { |
| 281 | p.Key = v |
| 282 | } |
| 283 | return nil |
| 284 | } |
| 285 | |
| 286 | func (p *Tag) readField2(iprot thrift.TProtocol) error { |
| 287 | if v, err := iprot.ReadI32(); err != nil { |
| 288 | return thrift.PrependError("error reading field 2: ", err) |
| 289 | } else { |
| 290 | temp := TagType(v) |
| 291 | p.VType = temp |
| 292 | } |
| 293 | return nil |
| 294 | } |
| 295 | |
| 296 | func (p *Tag) readField3(iprot thrift.TProtocol) error { |
| 297 | if v, err := iprot.ReadString(); err != nil { |
| 298 | return thrift.PrependError("error reading field 3: ", err) |
| 299 | } else { |
| 300 | p.VStr = &v |
| 301 | } |
| 302 | return nil |
| 303 | } |
| 304 | |
| 305 | func (p *Tag) readField4(iprot thrift.TProtocol) error { |
| 306 | if v, err := iprot.ReadDouble(); err != nil { |
| 307 | return thrift.PrependError("error reading field 4: ", err) |
| 308 | } else { |
| 309 | p.VDouble = &v |
| 310 | } |
| 311 | return nil |
| 312 | } |
| 313 | |
| 314 | func (p *Tag) readField5(iprot thrift.TProtocol) error { |
| 315 | if v, err := iprot.ReadBool(); err != nil { |
| 316 | return thrift.PrependError("error reading field 5: ", err) |
| 317 | } else { |
| 318 | p.VBool = &v |
| 319 | } |
| 320 | return nil |
| 321 | } |
| 322 | |
| 323 | func (p *Tag) readField6(iprot thrift.TProtocol) error { |
| 324 | if v, err := iprot.ReadI64(); err != nil { |
| 325 | return thrift.PrependError("error reading field 6: ", err) |
| 326 | } else { |
| 327 | p.VLong = &v |
| 328 | } |
| 329 | return nil |
| 330 | } |
| 331 | |
| 332 | func (p *Tag) readField7(iprot thrift.TProtocol) error { |
| 333 | if v, err := iprot.ReadBinary(); err != nil { |
| 334 | return thrift.PrependError("error reading field 7: ", err) |
| 335 | } else { |
| 336 | p.VBinary = v |
| 337 | } |
| 338 | return nil |
| 339 | } |
| 340 | |
| 341 | func (p *Tag) Write(oprot thrift.TProtocol) error { |
| 342 | if err := oprot.WriteStructBegin("Tag"); err != nil { |
| 343 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 344 | } |
| 345 | if err := p.writeField1(oprot); err != nil { |
| 346 | return err |
| 347 | } |
| 348 | if err := p.writeField2(oprot); err != nil { |
| 349 | return err |
| 350 | } |
| 351 | if err := p.writeField3(oprot); err != nil { |
| 352 | return err |
| 353 | } |
| 354 | if err := p.writeField4(oprot); err != nil { |
| 355 | return err |
| 356 | } |
| 357 | if err := p.writeField5(oprot); err != nil { |
| 358 | return err |
| 359 | } |
| 360 | if err := p.writeField6(oprot); err != nil { |
| 361 | return err |
| 362 | } |
| 363 | if err := p.writeField7(oprot); err != nil { |
| 364 | return err |
| 365 | } |
| 366 | if err := oprot.WriteFieldStop(); err != nil { |
| 367 | return thrift.PrependError("write field stop error: ", err) |
| 368 | } |
| 369 | if err := oprot.WriteStructEnd(); err != nil { |
| 370 | return thrift.PrependError("write struct stop error: ", err) |
| 371 | } |
| 372 | return nil |
| 373 | } |
| 374 | |
| 375 | func (p *Tag) writeField1(oprot thrift.TProtocol) (err error) { |
| 376 | if err := oprot.WriteFieldBegin("key", thrift.STRING, 1); err != nil { |
| 377 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) |
| 378 | } |
| 379 | if err := oprot.WriteString(string(p.Key)); err != nil { |
| 380 | return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) |
| 381 | } |
| 382 | if err := oprot.WriteFieldEnd(); err != nil { |
| 383 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) |
| 384 | } |
| 385 | return err |
| 386 | } |
| 387 | |
| 388 | func (p *Tag) writeField2(oprot thrift.TProtocol) (err error) { |
| 389 | if err := oprot.WriteFieldBegin("vType", thrift.I32, 2); err != nil { |
| 390 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vType: ", p), err) |
| 391 | } |
| 392 | if err := oprot.WriteI32(int32(p.VType)); err != nil { |
| 393 | return thrift.PrependError(fmt.Sprintf("%T.vType (2) field write error: ", p), err) |
| 394 | } |
| 395 | if err := oprot.WriteFieldEnd(); err != nil { |
| 396 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vType: ", p), err) |
| 397 | } |
| 398 | return err |
| 399 | } |
| 400 | |
| 401 | func (p *Tag) writeField3(oprot thrift.TProtocol) (err error) { |
| 402 | if p.IsSetVStr() { |
| 403 | if err := oprot.WriteFieldBegin("vStr", thrift.STRING, 3); err != nil { |
| 404 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:vStr: ", p), err) |
| 405 | } |
| 406 | if err := oprot.WriteString(string(*p.VStr)); err != nil { |
| 407 | return thrift.PrependError(fmt.Sprintf("%T.vStr (3) field write error: ", p), err) |
| 408 | } |
| 409 | if err := oprot.WriteFieldEnd(); err != nil { |
| 410 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vStr: ", p), err) |
| 411 | } |
| 412 | } |
| 413 | return err |
| 414 | } |
| 415 | |
| 416 | func (p *Tag) writeField4(oprot thrift.TProtocol) (err error) { |
| 417 | if p.IsSetVDouble() { |
| 418 | if err := oprot.WriteFieldBegin("vDouble", thrift.DOUBLE, 4); err != nil { |
| 419 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:vDouble: ", p), err) |
| 420 | } |
| 421 | if err := oprot.WriteDouble(float64(*p.VDouble)); err != nil { |
| 422 | return thrift.PrependError(fmt.Sprintf("%T.vDouble (4) field write error: ", p), err) |
| 423 | } |
| 424 | if err := oprot.WriteFieldEnd(); err != nil { |
| 425 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:vDouble: ", p), err) |
| 426 | } |
| 427 | } |
| 428 | return err |
| 429 | } |
| 430 | |
| 431 | func (p *Tag) writeField5(oprot thrift.TProtocol) (err error) { |
| 432 | if p.IsSetVBool() { |
| 433 | if err := oprot.WriteFieldBegin("vBool", thrift.BOOL, 5); err != nil { |
| 434 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:vBool: ", p), err) |
| 435 | } |
| 436 | if err := oprot.WriteBool(bool(*p.VBool)); err != nil { |
| 437 | return thrift.PrependError(fmt.Sprintf("%T.vBool (5) field write error: ", p), err) |
| 438 | } |
| 439 | if err := oprot.WriteFieldEnd(); err != nil { |
| 440 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vBool: ", p), err) |
| 441 | } |
| 442 | } |
| 443 | return err |
| 444 | } |
| 445 | |
| 446 | func (p *Tag) writeField6(oprot thrift.TProtocol) (err error) { |
| 447 | if p.IsSetVLong() { |
| 448 | if err := oprot.WriteFieldBegin("vLong", thrift.I64, 6); err != nil { |
| 449 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:vLong: ", p), err) |
| 450 | } |
| 451 | if err := oprot.WriteI64(int64(*p.VLong)); err != nil { |
| 452 | return thrift.PrependError(fmt.Sprintf("%T.vLong (6) field write error: ", p), err) |
| 453 | } |
| 454 | if err := oprot.WriteFieldEnd(); err != nil { |
| 455 | return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vLong: ", p), err) |
| 456 | } |
| 457 | } |
| 458 | return err |
| 459 | } |
| 460 | |
| 461 | func (p *Tag) writeField7(oprot thrift.TProtocol) (err error) { |
| 462 | if p.IsSetVBinary() { |
| 463 | if err := oprot.WriteFieldBegin("vBinary", thrift.STRING, 7); err != nil { |
| 464 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:vBinary: ", p), err) |
| 465 | } |
| 466 | if err := oprot.WriteBinary(p.VBinary); err != nil { |
| 467 | return thrift.PrependError(fmt.Sprintf("%T.vBinary (7) field write error: ", p), err) |
| 468 | } |
| 469 | if err := oprot.WriteFieldEnd(); err != nil { |
| 470 | return thrift.PrependError(fmt.Sprintf("%T write field end error 7:vBinary: ", p), err) |
| 471 | } |
| 472 | } |
| 473 | return err |
| 474 | } |
| 475 | |
| 476 | func (p *Tag) String() string { |
| 477 | if p == nil { |
| 478 | return "<nil>" |
| 479 | } |
| 480 | return fmt.Sprintf("Tag(%+v)", *p) |
| 481 | } |
| 482 | |
| 483 | // Attributes: |
| 484 | // - Timestamp |
| 485 | // - Fields |
| 486 | type Log struct { |
| 487 | Timestamp int64 `thrift:"timestamp,1,required" json:"timestamp"` |
| 488 | Fields []*Tag `thrift:"fields,2,required" json:"fields"` |
| 489 | } |
| 490 | |
| 491 | func NewLog() *Log { |
| 492 | return &Log{} |
| 493 | } |
| 494 | |
| 495 | func (p *Log) GetTimestamp() int64 { |
| 496 | return p.Timestamp |
| 497 | } |
| 498 | |
| 499 | func (p *Log) GetFields() []*Tag { |
| 500 | return p.Fields |
| 501 | } |
| 502 | func (p *Log) Read(iprot thrift.TProtocol) error { |
| 503 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 504 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 505 | } |
| 506 | |
| 507 | var issetTimestamp bool = false |
| 508 | var issetFields bool = false |
| 509 | |
| 510 | for { |
| 511 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 512 | if err != nil { |
| 513 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 514 | } |
| 515 | if fieldTypeId == thrift.STOP { |
| 516 | break |
| 517 | } |
| 518 | switch fieldId { |
| 519 | case 1: |
| 520 | if err := p.readField1(iprot); err != nil { |
| 521 | return err |
| 522 | } |
| 523 | issetTimestamp = true |
| 524 | case 2: |
| 525 | if err := p.readField2(iprot); err != nil { |
| 526 | return err |
| 527 | } |
| 528 | issetFields = true |
| 529 | default: |
| 530 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 531 | return err |
| 532 | } |
| 533 | } |
| 534 | if err := iprot.ReadFieldEnd(); err != nil { |
| 535 | return err |
| 536 | } |
| 537 | } |
| 538 | if err := iprot.ReadStructEnd(); err != nil { |
| 539 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 540 | } |
| 541 | if !issetTimestamp { |
| 542 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Timestamp is not set")) |
| 543 | } |
| 544 | if !issetFields { |
| 545 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Fields is not set")) |
| 546 | } |
| 547 | return nil |
| 548 | } |
| 549 | |
| 550 | func (p *Log) readField1(iprot thrift.TProtocol) error { |
| 551 | if v, err := iprot.ReadI64(); err != nil { |
| 552 | return thrift.PrependError("error reading field 1: ", err) |
| 553 | } else { |
| 554 | p.Timestamp = v |
| 555 | } |
| 556 | return nil |
| 557 | } |
| 558 | |
| 559 | func (p *Log) readField2(iprot thrift.TProtocol) error { |
| 560 | _, size, err := iprot.ReadListBegin() |
| 561 | if err != nil { |
| 562 | return thrift.PrependError("error reading list begin: ", err) |
| 563 | } |
| 564 | tSlice := make([]*Tag, 0, size) |
| 565 | p.Fields = tSlice |
| 566 | for i := 0; i < size; i++ { |
| 567 | _elem0 := &Tag{} |
| 568 | if err := _elem0.Read(iprot); err != nil { |
| 569 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) |
| 570 | } |
| 571 | p.Fields = append(p.Fields, _elem0) |
| 572 | } |
| 573 | if err := iprot.ReadListEnd(); err != nil { |
| 574 | return thrift.PrependError("error reading list end: ", err) |
| 575 | } |
| 576 | return nil |
| 577 | } |
| 578 | |
| 579 | func (p *Log) Write(oprot thrift.TProtocol) error { |
| 580 | if err := oprot.WriteStructBegin("Log"); err != nil { |
| 581 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 582 | } |
| 583 | if err := p.writeField1(oprot); err != nil { |
| 584 | return err |
| 585 | } |
| 586 | if err := p.writeField2(oprot); err != nil { |
| 587 | return err |
| 588 | } |
| 589 | if err := oprot.WriteFieldStop(); err != nil { |
| 590 | return thrift.PrependError("write field stop error: ", err) |
| 591 | } |
| 592 | if err := oprot.WriteStructEnd(); err != nil { |
| 593 | return thrift.PrependError("write struct stop error: ", err) |
| 594 | } |
| 595 | return nil |
| 596 | } |
| 597 | |
| 598 | func (p *Log) writeField1(oprot thrift.TProtocol) (err error) { |
| 599 | if err := oprot.WriteFieldBegin("timestamp", thrift.I64, 1); err != nil { |
| 600 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timestamp: ", p), err) |
| 601 | } |
| 602 | if err := oprot.WriteI64(int64(p.Timestamp)); err != nil { |
| 603 | return thrift.PrependError(fmt.Sprintf("%T.timestamp (1) field write error: ", p), err) |
| 604 | } |
| 605 | if err := oprot.WriteFieldEnd(); err != nil { |
| 606 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timestamp: ", p), err) |
| 607 | } |
| 608 | return err |
| 609 | } |
| 610 | |
| 611 | func (p *Log) writeField2(oprot thrift.TProtocol) (err error) { |
| 612 | if err := oprot.WriteFieldBegin("fields", thrift.LIST, 2); err != nil { |
| 613 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:fields: ", p), err) |
| 614 | } |
| 615 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil { |
| 616 | return thrift.PrependError("error writing list begin: ", err) |
| 617 | } |
| 618 | for _, v := range p.Fields { |
| 619 | if err := v.Write(oprot); err != nil { |
| 620 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 621 | } |
| 622 | } |
| 623 | if err := oprot.WriteListEnd(); err != nil { |
| 624 | return thrift.PrependError("error writing list end: ", err) |
| 625 | } |
| 626 | if err := oprot.WriteFieldEnd(); err != nil { |
| 627 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fields: ", p), err) |
| 628 | } |
| 629 | return err |
| 630 | } |
| 631 | |
| 632 | func (p *Log) String() string { |
| 633 | if p == nil { |
| 634 | return "<nil>" |
| 635 | } |
| 636 | return fmt.Sprintf("Log(%+v)", *p) |
| 637 | } |
| 638 | |
| 639 | // Attributes: |
| 640 | // - RefType |
| 641 | // - TraceIdLow |
| 642 | // - TraceIdHigh |
| 643 | // - SpanId |
| 644 | type SpanRef struct { |
| 645 | RefType SpanRefType `thrift:"refType,1,required" json:"refType"` |
| 646 | TraceIdLow int64 `thrift:"traceIdLow,2,required" json:"traceIdLow"` |
| 647 | TraceIdHigh int64 `thrift:"traceIdHigh,3,required" json:"traceIdHigh"` |
| 648 | SpanId int64 `thrift:"spanId,4,required" json:"spanId"` |
| 649 | } |
| 650 | |
| 651 | func NewSpanRef() *SpanRef { |
| 652 | return &SpanRef{} |
| 653 | } |
| 654 | |
| 655 | func (p *SpanRef) GetRefType() SpanRefType { |
| 656 | return p.RefType |
| 657 | } |
| 658 | |
| 659 | func (p *SpanRef) GetTraceIdLow() int64 { |
| 660 | return p.TraceIdLow |
| 661 | } |
| 662 | |
| 663 | func (p *SpanRef) GetTraceIdHigh() int64 { |
| 664 | return p.TraceIdHigh |
| 665 | } |
| 666 | |
| 667 | func (p *SpanRef) GetSpanId() int64 { |
| 668 | return p.SpanId |
| 669 | } |
| 670 | func (p *SpanRef) Read(iprot thrift.TProtocol) error { |
| 671 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 672 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 673 | } |
| 674 | |
| 675 | var issetRefType bool = false |
| 676 | var issetTraceIdLow bool = false |
| 677 | var issetTraceIdHigh bool = false |
| 678 | var issetSpanId bool = false |
| 679 | |
| 680 | for { |
| 681 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 682 | if err != nil { |
| 683 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 684 | } |
| 685 | if fieldTypeId == thrift.STOP { |
| 686 | break |
| 687 | } |
| 688 | switch fieldId { |
| 689 | case 1: |
| 690 | if err := p.readField1(iprot); err != nil { |
| 691 | return err |
| 692 | } |
| 693 | issetRefType = true |
| 694 | case 2: |
| 695 | if err := p.readField2(iprot); err != nil { |
| 696 | return err |
| 697 | } |
| 698 | issetTraceIdLow = true |
| 699 | case 3: |
| 700 | if err := p.readField3(iprot); err != nil { |
| 701 | return err |
| 702 | } |
| 703 | issetTraceIdHigh = true |
| 704 | case 4: |
| 705 | if err := p.readField4(iprot); err != nil { |
| 706 | return err |
| 707 | } |
| 708 | issetSpanId = true |
| 709 | default: |
| 710 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 711 | return err |
| 712 | } |
| 713 | } |
| 714 | if err := iprot.ReadFieldEnd(); err != nil { |
| 715 | return err |
| 716 | } |
| 717 | } |
| 718 | if err := iprot.ReadStructEnd(); err != nil { |
| 719 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 720 | } |
| 721 | if !issetRefType { |
| 722 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RefType is not set")) |
| 723 | } |
| 724 | if !issetTraceIdLow { |
| 725 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")) |
| 726 | } |
| 727 | if !issetTraceIdHigh { |
| 728 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")) |
| 729 | } |
| 730 | if !issetSpanId { |
| 731 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")) |
| 732 | } |
| 733 | return nil |
| 734 | } |
| 735 | |
| 736 | func (p *SpanRef) readField1(iprot thrift.TProtocol) error { |
| 737 | if v, err := iprot.ReadI32(); err != nil { |
| 738 | return thrift.PrependError("error reading field 1: ", err) |
| 739 | } else { |
| 740 | temp := SpanRefType(v) |
| 741 | p.RefType = temp |
| 742 | } |
| 743 | return nil |
| 744 | } |
| 745 | |
| 746 | func (p *SpanRef) readField2(iprot thrift.TProtocol) error { |
| 747 | if v, err := iprot.ReadI64(); err != nil { |
| 748 | return thrift.PrependError("error reading field 2: ", err) |
| 749 | } else { |
| 750 | p.TraceIdLow = v |
| 751 | } |
| 752 | return nil |
| 753 | } |
| 754 | |
| 755 | func (p *SpanRef) readField3(iprot thrift.TProtocol) error { |
| 756 | if v, err := iprot.ReadI64(); err != nil { |
| 757 | return thrift.PrependError("error reading field 3: ", err) |
| 758 | } else { |
| 759 | p.TraceIdHigh = v |
| 760 | } |
| 761 | return nil |
| 762 | } |
| 763 | |
| 764 | func (p *SpanRef) readField4(iprot thrift.TProtocol) error { |
| 765 | if v, err := iprot.ReadI64(); err != nil { |
| 766 | return thrift.PrependError("error reading field 4: ", err) |
| 767 | } else { |
| 768 | p.SpanId = v |
| 769 | } |
| 770 | return nil |
| 771 | } |
| 772 | |
| 773 | func (p *SpanRef) Write(oprot thrift.TProtocol) error { |
| 774 | if err := oprot.WriteStructBegin("SpanRef"); err != nil { |
| 775 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 776 | } |
| 777 | if err := p.writeField1(oprot); err != nil { |
| 778 | return err |
| 779 | } |
| 780 | if err := p.writeField2(oprot); err != nil { |
| 781 | return err |
| 782 | } |
| 783 | if err := p.writeField3(oprot); err != nil { |
| 784 | return err |
| 785 | } |
| 786 | if err := p.writeField4(oprot); err != nil { |
| 787 | return err |
| 788 | } |
| 789 | if err := oprot.WriteFieldStop(); err != nil { |
| 790 | return thrift.PrependError("write field stop error: ", err) |
| 791 | } |
| 792 | if err := oprot.WriteStructEnd(); err != nil { |
| 793 | return thrift.PrependError("write struct stop error: ", err) |
| 794 | } |
| 795 | return nil |
| 796 | } |
| 797 | |
| 798 | func (p *SpanRef) writeField1(oprot thrift.TProtocol) (err error) { |
| 799 | if err := oprot.WriteFieldBegin("refType", thrift.I32, 1); err != nil { |
| 800 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:refType: ", p), err) |
| 801 | } |
| 802 | if err := oprot.WriteI32(int32(p.RefType)); err != nil { |
| 803 | return thrift.PrependError(fmt.Sprintf("%T.refType (1) field write error: ", p), err) |
| 804 | } |
| 805 | if err := oprot.WriteFieldEnd(); err != nil { |
| 806 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:refType: ", p), err) |
| 807 | } |
| 808 | return err |
| 809 | } |
| 810 | |
| 811 | func (p *SpanRef) writeField2(oprot thrift.TProtocol) (err error) { |
| 812 | if err := oprot.WriteFieldBegin("traceIdLow", thrift.I64, 2); err != nil { |
| 813 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdLow: ", p), err) |
| 814 | } |
| 815 | if err := oprot.WriteI64(int64(p.TraceIdLow)); err != nil { |
| 816 | return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (2) field write error: ", p), err) |
| 817 | } |
| 818 | if err := oprot.WriteFieldEnd(); err != nil { |
| 819 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdLow: ", p), err) |
| 820 | } |
| 821 | return err |
| 822 | } |
| 823 | |
| 824 | func (p *SpanRef) writeField3(oprot thrift.TProtocol) (err error) { |
| 825 | if err := oprot.WriteFieldBegin("traceIdHigh", thrift.I64, 3); err != nil { |
| 826 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:traceIdHigh: ", p), err) |
| 827 | } |
| 828 | if err := oprot.WriteI64(int64(p.TraceIdHigh)); err != nil { |
| 829 | return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (3) field write error: ", p), err) |
| 830 | } |
| 831 | if err := oprot.WriteFieldEnd(); err != nil { |
| 832 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:traceIdHigh: ", p), err) |
| 833 | } |
| 834 | return err |
| 835 | } |
| 836 | |
| 837 | func (p *SpanRef) writeField4(oprot thrift.TProtocol) (err error) { |
| 838 | if err := oprot.WriteFieldBegin("spanId", thrift.I64, 4); err != nil { |
| 839 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:spanId: ", p), err) |
| 840 | } |
| 841 | if err := oprot.WriteI64(int64(p.SpanId)); err != nil { |
| 842 | return thrift.PrependError(fmt.Sprintf("%T.spanId (4) field write error: ", p), err) |
| 843 | } |
| 844 | if err := oprot.WriteFieldEnd(); err != nil { |
| 845 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:spanId: ", p), err) |
| 846 | } |
| 847 | return err |
| 848 | } |
| 849 | |
| 850 | func (p *SpanRef) String() string { |
| 851 | if p == nil { |
| 852 | return "<nil>" |
| 853 | } |
| 854 | return fmt.Sprintf("SpanRef(%+v)", *p) |
| 855 | } |
| 856 | |
| 857 | // Attributes: |
| 858 | // - TraceIdLow |
| 859 | // - TraceIdHigh |
| 860 | // - SpanId |
| 861 | // - ParentSpanId |
| 862 | // - OperationName |
| 863 | // - References |
| 864 | // - Flags |
| 865 | // - StartTime |
| 866 | // - Duration |
| 867 | // - Tags |
| 868 | // - Logs |
| 869 | type Span struct { |
| 870 | TraceIdLow int64 `thrift:"traceIdLow,1,required" json:"traceIdLow"` |
| 871 | TraceIdHigh int64 `thrift:"traceIdHigh,2,required" json:"traceIdHigh"` |
| 872 | SpanId int64 `thrift:"spanId,3,required" json:"spanId"` |
| 873 | ParentSpanId int64 `thrift:"parentSpanId,4,required" json:"parentSpanId"` |
| 874 | OperationName string `thrift:"operationName,5,required" json:"operationName"` |
| 875 | References []*SpanRef `thrift:"references,6" json:"references,omitempty"` |
| 876 | Flags int32 `thrift:"flags,7,required" json:"flags"` |
| 877 | StartTime int64 `thrift:"startTime,8,required" json:"startTime"` |
| 878 | Duration int64 `thrift:"duration,9,required" json:"duration"` |
| 879 | Tags []*Tag `thrift:"tags,10" json:"tags,omitempty"` |
| 880 | Logs []*Log `thrift:"logs,11" json:"logs,omitempty"` |
| 881 | } |
| 882 | |
| 883 | func NewSpan() *Span { |
| 884 | return &Span{} |
| 885 | } |
| 886 | |
| 887 | func (p *Span) GetTraceIdLow() int64 { |
| 888 | return p.TraceIdLow |
| 889 | } |
| 890 | |
| 891 | func (p *Span) GetTraceIdHigh() int64 { |
| 892 | return p.TraceIdHigh |
| 893 | } |
| 894 | |
| 895 | func (p *Span) GetSpanId() int64 { |
| 896 | return p.SpanId |
| 897 | } |
| 898 | |
| 899 | func (p *Span) GetParentSpanId() int64 { |
| 900 | return p.ParentSpanId |
| 901 | } |
| 902 | |
| 903 | func (p *Span) GetOperationName() string { |
| 904 | return p.OperationName |
| 905 | } |
| 906 | |
| 907 | var Span_References_DEFAULT []*SpanRef |
| 908 | |
| 909 | func (p *Span) GetReferences() []*SpanRef { |
| 910 | return p.References |
| 911 | } |
| 912 | |
| 913 | func (p *Span) GetFlags() int32 { |
| 914 | return p.Flags |
| 915 | } |
| 916 | |
| 917 | func (p *Span) GetStartTime() int64 { |
| 918 | return p.StartTime |
| 919 | } |
| 920 | |
| 921 | func (p *Span) GetDuration() int64 { |
| 922 | return p.Duration |
| 923 | } |
| 924 | |
| 925 | var Span_Tags_DEFAULT []*Tag |
| 926 | |
| 927 | func (p *Span) GetTags() []*Tag { |
| 928 | return p.Tags |
| 929 | } |
| 930 | |
| 931 | var Span_Logs_DEFAULT []*Log |
| 932 | |
| 933 | func (p *Span) GetLogs() []*Log { |
| 934 | return p.Logs |
| 935 | } |
| 936 | func (p *Span) IsSetReferences() bool { |
| 937 | return p.References != nil |
| 938 | } |
| 939 | |
| 940 | func (p *Span) IsSetTags() bool { |
| 941 | return p.Tags != nil |
| 942 | } |
| 943 | |
| 944 | func (p *Span) IsSetLogs() bool { |
| 945 | return p.Logs != nil |
| 946 | } |
| 947 | |
| 948 | func (p *Span) Read(iprot thrift.TProtocol) error { |
| 949 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 950 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 951 | } |
| 952 | |
| 953 | var issetTraceIdLow bool = false |
| 954 | var issetTraceIdHigh bool = false |
| 955 | var issetSpanId bool = false |
| 956 | var issetParentSpanId bool = false |
| 957 | var issetOperationName bool = false |
| 958 | var issetFlags bool = false |
| 959 | var issetStartTime bool = false |
| 960 | var issetDuration bool = false |
| 961 | |
| 962 | for { |
| 963 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 964 | if err != nil { |
| 965 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 966 | } |
| 967 | if fieldTypeId == thrift.STOP { |
| 968 | break |
| 969 | } |
| 970 | switch fieldId { |
| 971 | case 1: |
| 972 | if err := p.readField1(iprot); err != nil { |
| 973 | return err |
| 974 | } |
| 975 | issetTraceIdLow = true |
| 976 | case 2: |
| 977 | if err := p.readField2(iprot); err != nil { |
| 978 | return err |
| 979 | } |
| 980 | issetTraceIdHigh = true |
| 981 | case 3: |
| 982 | if err := p.readField3(iprot); err != nil { |
| 983 | return err |
| 984 | } |
| 985 | issetSpanId = true |
| 986 | case 4: |
| 987 | if err := p.readField4(iprot); err != nil { |
| 988 | return err |
| 989 | } |
| 990 | issetParentSpanId = true |
| 991 | case 5: |
| 992 | if err := p.readField5(iprot); err != nil { |
| 993 | return err |
| 994 | } |
| 995 | issetOperationName = true |
| 996 | case 6: |
| 997 | if err := p.readField6(iprot); err != nil { |
| 998 | return err |
| 999 | } |
| 1000 | case 7: |
| 1001 | if err := p.readField7(iprot); err != nil { |
| 1002 | return err |
| 1003 | } |
| 1004 | issetFlags = true |
| 1005 | case 8: |
| 1006 | if err := p.readField8(iprot); err != nil { |
| 1007 | return err |
| 1008 | } |
| 1009 | issetStartTime = true |
| 1010 | case 9: |
| 1011 | if err := p.readField9(iprot); err != nil { |
| 1012 | return err |
| 1013 | } |
| 1014 | issetDuration = true |
| 1015 | case 10: |
| 1016 | if err := p.readField10(iprot); err != nil { |
| 1017 | return err |
| 1018 | } |
| 1019 | case 11: |
| 1020 | if err := p.readField11(iprot); err != nil { |
| 1021 | return err |
| 1022 | } |
| 1023 | default: |
| 1024 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 1025 | return err |
| 1026 | } |
| 1027 | } |
| 1028 | if err := iprot.ReadFieldEnd(); err != nil { |
| 1029 | return err |
| 1030 | } |
| 1031 | } |
| 1032 | if err := iprot.ReadStructEnd(); err != nil { |
| 1033 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 1034 | } |
| 1035 | if !issetTraceIdLow { |
| 1036 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdLow is not set")) |
| 1037 | } |
| 1038 | if !issetTraceIdHigh { |
| 1039 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TraceIdHigh is not set")) |
| 1040 | } |
| 1041 | if !issetSpanId { |
| 1042 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpanId is not set")) |
| 1043 | } |
| 1044 | if !issetParentSpanId { |
| 1045 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ParentSpanId is not set")) |
| 1046 | } |
| 1047 | if !issetOperationName { |
| 1048 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationName is not set")) |
| 1049 | } |
| 1050 | if !issetFlags { |
| 1051 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Flags is not set")) |
| 1052 | } |
| 1053 | if !issetStartTime { |
| 1054 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")) |
| 1055 | } |
| 1056 | if !issetDuration { |
| 1057 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Duration is not set")) |
| 1058 | } |
| 1059 | return nil |
| 1060 | } |
| 1061 | |
| 1062 | func (p *Span) readField1(iprot thrift.TProtocol) error { |
| 1063 | if v, err := iprot.ReadI64(); err != nil { |
| 1064 | return thrift.PrependError("error reading field 1: ", err) |
| 1065 | } else { |
| 1066 | p.TraceIdLow = v |
| 1067 | } |
| 1068 | return nil |
| 1069 | } |
| 1070 | |
| 1071 | func (p *Span) readField2(iprot thrift.TProtocol) error { |
| 1072 | if v, err := iprot.ReadI64(); err != nil { |
| 1073 | return thrift.PrependError("error reading field 2: ", err) |
| 1074 | } else { |
| 1075 | p.TraceIdHigh = v |
| 1076 | } |
| 1077 | return nil |
| 1078 | } |
| 1079 | |
| 1080 | func (p *Span) readField3(iprot thrift.TProtocol) error { |
| 1081 | if v, err := iprot.ReadI64(); err != nil { |
| 1082 | return thrift.PrependError("error reading field 3: ", err) |
| 1083 | } else { |
| 1084 | p.SpanId = v |
| 1085 | } |
| 1086 | return nil |
| 1087 | } |
| 1088 | |
| 1089 | func (p *Span) readField4(iprot thrift.TProtocol) error { |
| 1090 | if v, err := iprot.ReadI64(); err != nil { |
| 1091 | return thrift.PrependError("error reading field 4: ", err) |
| 1092 | } else { |
| 1093 | p.ParentSpanId = v |
| 1094 | } |
| 1095 | return nil |
| 1096 | } |
| 1097 | |
| 1098 | func (p *Span) readField5(iprot thrift.TProtocol) error { |
| 1099 | if v, err := iprot.ReadString(); err != nil { |
| 1100 | return thrift.PrependError("error reading field 5: ", err) |
| 1101 | } else { |
| 1102 | p.OperationName = v |
| 1103 | } |
| 1104 | return nil |
| 1105 | } |
| 1106 | |
| 1107 | func (p *Span) readField6(iprot thrift.TProtocol) error { |
| 1108 | _, size, err := iprot.ReadListBegin() |
| 1109 | if err != nil { |
| 1110 | return thrift.PrependError("error reading list begin: ", err) |
| 1111 | } |
| 1112 | tSlice := make([]*SpanRef, 0, size) |
| 1113 | p.References = tSlice |
| 1114 | for i := 0; i < size; i++ { |
| 1115 | _elem1 := &SpanRef{} |
| 1116 | if err := _elem1.Read(iprot); err != nil { |
| 1117 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) |
| 1118 | } |
| 1119 | p.References = append(p.References, _elem1) |
| 1120 | } |
| 1121 | if err := iprot.ReadListEnd(); err != nil { |
| 1122 | return thrift.PrependError("error reading list end: ", err) |
| 1123 | } |
| 1124 | return nil |
| 1125 | } |
| 1126 | |
| 1127 | func (p *Span) readField7(iprot thrift.TProtocol) error { |
| 1128 | if v, err := iprot.ReadI32(); err != nil { |
| 1129 | return thrift.PrependError("error reading field 7: ", err) |
| 1130 | } else { |
| 1131 | p.Flags = v |
| 1132 | } |
| 1133 | return nil |
| 1134 | } |
| 1135 | |
| 1136 | func (p *Span) readField8(iprot thrift.TProtocol) error { |
| 1137 | if v, err := iprot.ReadI64(); err != nil { |
| 1138 | return thrift.PrependError("error reading field 8: ", err) |
| 1139 | } else { |
| 1140 | p.StartTime = v |
| 1141 | } |
| 1142 | return nil |
| 1143 | } |
| 1144 | |
| 1145 | func (p *Span) readField9(iprot thrift.TProtocol) error { |
| 1146 | if v, err := iprot.ReadI64(); err != nil { |
| 1147 | return thrift.PrependError("error reading field 9: ", err) |
| 1148 | } else { |
| 1149 | p.Duration = v |
| 1150 | } |
| 1151 | return nil |
| 1152 | } |
| 1153 | |
| 1154 | func (p *Span) readField10(iprot thrift.TProtocol) error { |
| 1155 | _, size, err := iprot.ReadListBegin() |
| 1156 | if err != nil { |
| 1157 | return thrift.PrependError("error reading list begin: ", err) |
| 1158 | } |
| 1159 | tSlice := make([]*Tag, 0, size) |
| 1160 | p.Tags = tSlice |
| 1161 | for i := 0; i < size; i++ { |
| 1162 | _elem2 := &Tag{} |
| 1163 | if err := _elem2.Read(iprot); err != nil { |
| 1164 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err) |
| 1165 | } |
| 1166 | p.Tags = append(p.Tags, _elem2) |
| 1167 | } |
| 1168 | if err := iprot.ReadListEnd(); err != nil { |
| 1169 | return thrift.PrependError("error reading list end: ", err) |
| 1170 | } |
| 1171 | return nil |
| 1172 | } |
| 1173 | |
| 1174 | func (p *Span) readField11(iprot thrift.TProtocol) error { |
| 1175 | _, size, err := iprot.ReadListBegin() |
| 1176 | if err != nil { |
| 1177 | return thrift.PrependError("error reading list begin: ", err) |
| 1178 | } |
| 1179 | tSlice := make([]*Log, 0, size) |
| 1180 | p.Logs = tSlice |
| 1181 | for i := 0; i < size; i++ { |
| 1182 | _elem3 := &Log{} |
| 1183 | if err := _elem3.Read(iprot); err != nil { |
| 1184 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) |
| 1185 | } |
| 1186 | p.Logs = append(p.Logs, _elem3) |
| 1187 | } |
| 1188 | if err := iprot.ReadListEnd(); err != nil { |
| 1189 | return thrift.PrependError("error reading list end: ", err) |
| 1190 | } |
| 1191 | return nil |
| 1192 | } |
| 1193 | |
| 1194 | func (p *Span) Write(oprot thrift.TProtocol) error { |
| 1195 | if err := oprot.WriteStructBegin("Span"); err != nil { |
| 1196 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 1197 | } |
| 1198 | if err := p.writeField1(oprot); err != nil { |
| 1199 | return err |
| 1200 | } |
| 1201 | if err := p.writeField2(oprot); err != nil { |
| 1202 | return err |
| 1203 | } |
| 1204 | if err := p.writeField3(oprot); err != nil { |
| 1205 | return err |
| 1206 | } |
| 1207 | if err := p.writeField4(oprot); err != nil { |
| 1208 | return err |
| 1209 | } |
| 1210 | if err := p.writeField5(oprot); err != nil { |
| 1211 | return err |
| 1212 | } |
| 1213 | if err := p.writeField6(oprot); err != nil { |
| 1214 | return err |
| 1215 | } |
| 1216 | if err := p.writeField7(oprot); err != nil { |
| 1217 | return err |
| 1218 | } |
| 1219 | if err := p.writeField8(oprot); err != nil { |
| 1220 | return err |
| 1221 | } |
| 1222 | if err := p.writeField9(oprot); err != nil { |
| 1223 | return err |
| 1224 | } |
| 1225 | if err := p.writeField10(oprot); err != nil { |
| 1226 | return err |
| 1227 | } |
| 1228 | if err := p.writeField11(oprot); err != nil { |
| 1229 | return err |
| 1230 | } |
| 1231 | if err := oprot.WriteFieldStop(); err != nil { |
| 1232 | return thrift.PrependError("write field stop error: ", err) |
| 1233 | } |
| 1234 | if err := oprot.WriteStructEnd(); err != nil { |
| 1235 | return thrift.PrependError("write struct stop error: ", err) |
| 1236 | } |
| 1237 | return nil |
| 1238 | } |
| 1239 | |
| 1240 | func (p *Span) writeField1(oprot thrift.TProtocol) (err error) { |
| 1241 | if err := oprot.WriteFieldBegin("traceIdLow", thrift.I64, 1); err != nil { |
| 1242 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:traceIdLow: ", p), err) |
| 1243 | } |
| 1244 | if err := oprot.WriteI64(int64(p.TraceIdLow)); err != nil { |
| 1245 | return thrift.PrependError(fmt.Sprintf("%T.traceIdLow (1) field write error: ", p), err) |
| 1246 | } |
| 1247 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1248 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:traceIdLow: ", p), err) |
| 1249 | } |
| 1250 | return err |
| 1251 | } |
| 1252 | |
| 1253 | func (p *Span) writeField2(oprot thrift.TProtocol) (err error) { |
| 1254 | if err := oprot.WriteFieldBegin("traceIdHigh", thrift.I64, 2); err != nil { |
| 1255 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:traceIdHigh: ", p), err) |
| 1256 | } |
| 1257 | if err := oprot.WriteI64(int64(p.TraceIdHigh)); err != nil { |
| 1258 | return thrift.PrependError(fmt.Sprintf("%T.traceIdHigh (2) field write error: ", p), err) |
| 1259 | } |
| 1260 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1261 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:traceIdHigh: ", p), err) |
| 1262 | } |
| 1263 | return err |
| 1264 | } |
| 1265 | |
| 1266 | func (p *Span) writeField3(oprot thrift.TProtocol) (err error) { |
| 1267 | if err := oprot.WriteFieldBegin("spanId", thrift.I64, 3); err != nil { |
| 1268 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spanId: ", p), err) |
| 1269 | } |
| 1270 | if err := oprot.WriteI64(int64(p.SpanId)); err != nil { |
| 1271 | return thrift.PrependError(fmt.Sprintf("%T.spanId (3) field write error: ", p), err) |
| 1272 | } |
| 1273 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1274 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spanId: ", p), err) |
| 1275 | } |
| 1276 | return err |
| 1277 | } |
| 1278 | |
| 1279 | func (p *Span) writeField4(oprot thrift.TProtocol) (err error) { |
| 1280 | if err := oprot.WriteFieldBegin("parentSpanId", thrift.I64, 4); err != nil { |
| 1281 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentSpanId: ", p), err) |
| 1282 | } |
| 1283 | if err := oprot.WriteI64(int64(p.ParentSpanId)); err != nil { |
| 1284 | return thrift.PrependError(fmt.Sprintf("%T.parentSpanId (4) field write error: ", p), err) |
| 1285 | } |
| 1286 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1287 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentSpanId: ", p), err) |
| 1288 | } |
| 1289 | return err |
| 1290 | } |
| 1291 | |
| 1292 | func (p *Span) writeField5(oprot thrift.TProtocol) (err error) { |
| 1293 | if err := oprot.WriteFieldBegin("operationName", thrift.STRING, 5); err != nil { |
| 1294 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:operationName: ", p), err) |
| 1295 | } |
| 1296 | if err := oprot.WriteString(string(p.OperationName)); err != nil { |
| 1297 | return thrift.PrependError(fmt.Sprintf("%T.operationName (5) field write error: ", p), err) |
| 1298 | } |
| 1299 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1300 | return thrift.PrependError(fmt.Sprintf("%T write field end error 5:operationName: ", p), err) |
| 1301 | } |
| 1302 | return err |
| 1303 | } |
| 1304 | |
| 1305 | func (p *Span) writeField6(oprot thrift.TProtocol) (err error) { |
| 1306 | if p.IsSetReferences() { |
| 1307 | if err := oprot.WriteFieldBegin("references", thrift.LIST, 6); err != nil { |
| 1308 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:references: ", p), err) |
| 1309 | } |
| 1310 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.References)); err != nil { |
| 1311 | return thrift.PrependError("error writing list begin: ", err) |
| 1312 | } |
| 1313 | for _, v := range p.References { |
| 1314 | if err := v.Write(oprot); err != nil { |
| 1315 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 1316 | } |
| 1317 | } |
| 1318 | if err := oprot.WriteListEnd(); err != nil { |
| 1319 | return thrift.PrependError("error writing list end: ", err) |
| 1320 | } |
| 1321 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1322 | return thrift.PrependError(fmt.Sprintf("%T write field end error 6:references: ", p), err) |
| 1323 | } |
| 1324 | } |
| 1325 | return err |
| 1326 | } |
| 1327 | |
| 1328 | func (p *Span) writeField7(oprot thrift.TProtocol) (err error) { |
| 1329 | if err := oprot.WriteFieldBegin("flags", thrift.I32, 7); err != nil { |
| 1330 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:flags: ", p), err) |
| 1331 | } |
| 1332 | if err := oprot.WriteI32(int32(p.Flags)); err != nil { |
| 1333 | return thrift.PrependError(fmt.Sprintf("%T.flags (7) field write error: ", p), err) |
| 1334 | } |
| 1335 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1336 | return thrift.PrependError(fmt.Sprintf("%T write field end error 7:flags: ", p), err) |
| 1337 | } |
| 1338 | return err |
| 1339 | } |
| 1340 | |
| 1341 | func (p *Span) writeField8(oprot thrift.TProtocol) (err error) { |
| 1342 | if err := oprot.WriteFieldBegin("startTime", thrift.I64, 8); err != nil { |
| 1343 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:startTime: ", p), err) |
| 1344 | } |
| 1345 | if err := oprot.WriteI64(int64(p.StartTime)); err != nil { |
| 1346 | return thrift.PrependError(fmt.Sprintf("%T.startTime (8) field write error: ", p), err) |
| 1347 | } |
| 1348 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1349 | return thrift.PrependError(fmt.Sprintf("%T write field end error 8:startTime: ", p), err) |
| 1350 | } |
| 1351 | return err |
| 1352 | } |
| 1353 | |
| 1354 | func (p *Span) writeField9(oprot thrift.TProtocol) (err error) { |
| 1355 | if err := oprot.WriteFieldBegin("duration", thrift.I64, 9); err != nil { |
| 1356 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:duration: ", p), err) |
| 1357 | } |
| 1358 | if err := oprot.WriteI64(int64(p.Duration)); err != nil { |
| 1359 | return thrift.PrependError(fmt.Sprintf("%T.duration (9) field write error: ", p), err) |
| 1360 | } |
| 1361 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1362 | return thrift.PrependError(fmt.Sprintf("%T write field end error 9:duration: ", p), err) |
| 1363 | } |
| 1364 | return err |
| 1365 | } |
| 1366 | |
| 1367 | func (p *Span) writeField10(oprot thrift.TProtocol) (err error) { |
| 1368 | if p.IsSetTags() { |
| 1369 | if err := oprot.WriteFieldBegin("tags", thrift.LIST, 10); err != nil { |
| 1370 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:tags: ", p), err) |
| 1371 | } |
| 1372 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { |
| 1373 | return thrift.PrependError("error writing list begin: ", err) |
| 1374 | } |
| 1375 | for _, v := range p.Tags { |
| 1376 | if err := v.Write(oprot); err != nil { |
| 1377 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 1378 | } |
| 1379 | } |
| 1380 | if err := oprot.WriteListEnd(); err != nil { |
| 1381 | return thrift.PrependError("error writing list end: ", err) |
| 1382 | } |
| 1383 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1384 | return thrift.PrependError(fmt.Sprintf("%T write field end error 10:tags: ", p), err) |
| 1385 | } |
| 1386 | } |
| 1387 | return err |
| 1388 | } |
| 1389 | |
| 1390 | func (p *Span) writeField11(oprot thrift.TProtocol) (err error) { |
| 1391 | if p.IsSetLogs() { |
| 1392 | if err := oprot.WriteFieldBegin("logs", thrift.LIST, 11); err != nil { |
| 1393 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:logs: ", p), err) |
| 1394 | } |
| 1395 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Logs)); err != nil { |
| 1396 | return thrift.PrependError("error writing list begin: ", err) |
| 1397 | } |
| 1398 | for _, v := range p.Logs { |
| 1399 | if err := v.Write(oprot); err != nil { |
| 1400 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 1401 | } |
| 1402 | } |
| 1403 | if err := oprot.WriteListEnd(); err != nil { |
| 1404 | return thrift.PrependError("error writing list end: ", err) |
| 1405 | } |
| 1406 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1407 | return thrift.PrependError(fmt.Sprintf("%T write field end error 11:logs: ", p), err) |
| 1408 | } |
| 1409 | } |
| 1410 | return err |
| 1411 | } |
| 1412 | |
| 1413 | func (p *Span) String() string { |
| 1414 | if p == nil { |
| 1415 | return "<nil>" |
| 1416 | } |
| 1417 | return fmt.Sprintf("Span(%+v)", *p) |
| 1418 | } |
| 1419 | |
| 1420 | // Attributes: |
| 1421 | // - ServiceName |
| 1422 | // - Tags |
| 1423 | type Process struct { |
| 1424 | ServiceName string `thrift:"serviceName,1,required" json:"serviceName"` |
| 1425 | Tags []*Tag `thrift:"tags,2" json:"tags,omitempty"` |
| 1426 | } |
| 1427 | |
| 1428 | func NewProcess() *Process { |
| 1429 | return &Process{} |
| 1430 | } |
| 1431 | |
| 1432 | func (p *Process) GetServiceName() string { |
| 1433 | return p.ServiceName |
| 1434 | } |
| 1435 | |
| 1436 | var Process_Tags_DEFAULT []*Tag |
| 1437 | |
| 1438 | func (p *Process) GetTags() []*Tag { |
| 1439 | return p.Tags |
| 1440 | } |
| 1441 | func (p *Process) IsSetTags() bool { |
| 1442 | return p.Tags != nil |
| 1443 | } |
| 1444 | |
| 1445 | func (p *Process) Read(iprot thrift.TProtocol) error { |
| 1446 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 1447 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 1448 | } |
| 1449 | |
| 1450 | var issetServiceName bool = false |
| 1451 | |
| 1452 | for { |
| 1453 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 1454 | if err != nil { |
| 1455 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 1456 | } |
| 1457 | if fieldTypeId == thrift.STOP { |
| 1458 | break |
| 1459 | } |
| 1460 | switch fieldId { |
| 1461 | case 1: |
| 1462 | if err := p.readField1(iprot); err != nil { |
| 1463 | return err |
| 1464 | } |
| 1465 | issetServiceName = true |
| 1466 | case 2: |
| 1467 | if err := p.readField2(iprot); err != nil { |
| 1468 | return err |
| 1469 | } |
| 1470 | default: |
| 1471 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 1472 | return err |
| 1473 | } |
| 1474 | } |
| 1475 | if err := iprot.ReadFieldEnd(); err != nil { |
| 1476 | return err |
| 1477 | } |
| 1478 | } |
| 1479 | if err := iprot.ReadStructEnd(); err != nil { |
| 1480 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 1481 | } |
| 1482 | if !issetServiceName { |
| 1483 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServiceName is not set")) |
| 1484 | } |
| 1485 | return nil |
| 1486 | } |
| 1487 | |
| 1488 | func (p *Process) readField1(iprot thrift.TProtocol) error { |
| 1489 | if v, err := iprot.ReadString(); err != nil { |
| 1490 | return thrift.PrependError("error reading field 1: ", err) |
| 1491 | } else { |
| 1492 | p.ServiceName = v |
| 1493 | } |
| 1494 | return nil |
| 1495 | } |
| 1496 | |
| 1497 | func (p *Process) readField2(iprot thrift.TProtocol) error { |
| 1498 | _, size, err := iprot.ReadListBegin() |
| 1499 | if err != nil { |
| 1500 | return thrift.PrependError("error reading list begin: ", err) |
| 1501 | } |
| 1502 | tSlice := make([]*Tag, 0, size) |
| 1503 | p.Tags = tSlice |
| 1504 | for i := 0; i < size; i++ { |
| 1505 | _elem4 := &Tag{} |
| 1506 | if err := _elem4.Read(iprot); err != nil { |
| 1507 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) |
| 1508 | } |
| 1509 | p.Tags = append(p.Tags, _elem4) |
| 1510 | } |
| 1511 | if err := iprot.ReadListEnd(); err != nil { |
| 1512 | return thrift.PrependError("error reading list end: ", err) |
| 1513 | } |
| 1514 | return nil |
| 1515 | } |
| 1516 | |
| 1517 | func (p *Process) Write(oprot thrift.TProtocol) error { |
| 1518 | if err := oprot.WriteStructBegin("Process"); err != nil { |
| 1519 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 1520 | } |
| 1521 | if err := p.writeField1(oprot); err != nil { |
| 1522 | return err |
| 1523 | } |
| 1524 | if err := p.writeField2(oprot); err != nil { |
| 1525 | return err |
| 1526 | } |
| 1527 | if err := oprot.WriteFieldStop(); err != nil { |
| 1528 | return thrift.PrependError("write field stop error: ", err) |
| 1529 | } |
| 1530 | if err := oprot.WriteStructEnd(); err != nil { |
| 1531 | return thrift.PrependError("write struct stop error: ", err) |
| 1532 | } |
| 1533 | return nil |
| 1534 | } |
| 1535 | |
| 1536 | func (p *Process) writeField1(oprot thrift.TProtocol) (err error) { |
| 1537 | if err := oprot.WriteFieldBegin("serviceName", thrift.STRING, 1); err != nil { |
| 1538 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:serviceName: ", p), err) |
| 1539 | } |
| 1540 | if err := oprot.WriteString(string(p.ServiceName)); err != nil { |
| 1541 | return thrift.PrependError(fmt.Sprintf("%T.serviceName (1) field write error: ", p), err) |
| 1542 | } |
| 1543 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1544 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:serviceName: ", p), err) |
| 1545 | } |
| 1546 | return err |
| 1547 | } |
| 1548 | |
| 1549 | func (p *Process) writeField2(oprot thrift.TProtocol) (err error) { |
| 1550 | if p.IsSetTags() { |
| 1551 | if err := oprot.WriteFieldBegin("tags", thrift.LIST, 2); err != nil { |
| 1552 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) |
| 1553 | } |
| 1554 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tags)); err != nil { |
| 1555 | return thrift.PrependError("error writing list begin: ", err) |
| 1556 | } |
| 1557 | for _, v := range p.Tags { |
| 1558 | if err := v.Write(oprot); err != nil { |
| 1559 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 1560 | } |
| 1561 | } |
| 1562 | if err := oprot.WriteListEnd(); err != nil { |
| 1563 | return thrift.PrependError("error writing list end: ", err) |
| 1564 | } |
| 1565 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1566 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) |
| 1567 | } |
| 1568 | } |
| 1569 | return err |
| 1570 | } |
| 1571 | |
| 1572 | func (p *Process) String() string { |
| 1573 | if p == nil { |
| 1574 | return "<nil>" |
| 1575 | } |
| 1576 | return fmt.Sprintf("Process(%+v)", *p) |
| 1577 | } |
| 1578 | |
| 1579 | // Attributes: |
| 1580 | // - FullQueueDroppedSpans |
| 1581 | // - TooLargeDroppedSpans |
| 1582 | // - FailedToEmitSpans |
| 1583 | type ClientStats struct { |
| 1584 | FullQueueDroppedSpans int64 `thrift:"fullQueueDroppedSpans,1,required" json:"fullQueueDroppedSpans"` |
| 1585 | TooLargeDroppedSpans int64 `thrift:"tooLargeDroppedSpans,2,required" json:"tooLargeDroppedSpans"` |
| 1586 | FailedToEmitSpans int64 `thrift:"failedToEmitSpans,3,required" json:"failedToEmitSpans"` |
| 1587 | } |
| 1588 | |
| 1589 | func NewClientStats() *ClientStats { |
| 1590 | return &ClientStats{} |
| 1591 | } |
| 1592 | |
| 1593 | func (p *ClientStats) GetFullQueueDroppedSpans() int64 { |
| 1594 | return p.FullQueueDroppedSpans |
| 1595 | } |
| 1596 | |
| 1597 | func (p *ClientStats) GetTooLargeDroppedSpans() int64 { |
| 1598 | return p.TooLargeDroppedSpans |
| 1599 | } |
| 1600 | |
| 1601 | func (p *ClientStats) GetFailedToEmitSpans() int64 { |
| 1602 | return p.FailedToEmitSpans |
| 1603 | } |
| 1604 | func (p *ClientStats) Read(iprot thrift.TProtocol) error { |
| 1605 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 1606 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 1607 | } |
| 1608 | |
| 1609 | var issetFullQueueDroppedSpans bool = false |
| 1610 | var issetTooLargeDroppedSpans bool = false |
| 1611 | var issetFailedToEmitSpans bool = false |
| 1612 | |
| 1613 | for { |
| 1614 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 1615 | if err != nil { |
| 1616 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 1617 | } |
| 1618 | if fieldTypeId == thrift.STOP { |
| 1619 | break |
| 1620 | } |
| 1621 | switch fieldId { |
| 1622 | case 1: |
| 1623 | if err := p.readField1(iprot); err != nil { |
| 1624 | return err |
| 1625 | } |
| 1626 | issetFullQueueDroppedSpans = true |
| 1627 | case 2: |
| 1628 | if err := p.readField2(iprot); err != nil { |
| 1629 | return err |
| 1630 | } |
| 1631 | issetTooLargeDroppedSpans = true |
| 1632 | case 3: |
| 1633 | if err := p.readField3(iprot); err != nil { |
| 1634 | return err |
| 1635 | } |
| 1636 | issetFailedToEmitSpans = true |
| 1637 | default: |
| 1638 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 1639 | return err |
| 1640 | } |
| 1641 | } |
| 1642 | if err := iprot.ReadFieldEnd(); err != nil { |
| 1643 | return err |
| 1644 | } |
| 1645 | } |
| 1646 | if err := iprot.ReadStructEnd(); err != nil { |
| 1647 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 1648 | } |
| 1649 | if !issetFullQueueDroppedSpans { |
| 1650 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FullQueueDroppedSpans is not set")) |
| 1651 | } |
| 1652 | if !issetTooLargeDroppedSpans { |
| 1653 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TooLargeDroppedSpans is not set")) |
| 1654 | } |
| 1655 | if !issetFailedToEmitSpans { |
| 1656 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedToEmitSpans is not set")) |
| 1657 | } |
| 1658 | return nil |
| 1659 | } |
| 1660 | |
| 1661 | func (p *ClientStats) readField1(iprot thrift.TProtocol) error { |
| 1662 | if v, err := iprot.ReadI64(); err != nil { |
| 1663 | return thrift.PrependError("error reading field 1: ", err) |
| 1664 | } else { |
| 1665 | p.FullQueueDroppedSpans = v |
| 1666 | } |
| 1667 | return nil |
| 1668 | } |
| 1669 | |
| 1670 | func (p *ClientStats) readField2(iprot thrift.TProtocol) error { |
| 1671 | if v, err := iprot.ReadI64(); err != nil { |
| 1672 | return thrift.PrependError("error reading field 2: ", err) |
| 1673 | } else { |
| 1674 | p.TooLargeDroppedSpans = v |
| 1675 | } |
| 1676 | return nil |
| 1677 | } |
| 1678 | |
| 1679 | func (p *ClientStats) readField3(iprot thrift.TProtocol) error { |
| 1680 | if v, err := iprot.ReadI64(); err != nil { |
| 1681 | return thrift.PrependError("error reading field 3: ", err) |
| 1682 | } else { |
| 1683 | p.FailedToEmitSpans = v |
| 1684 | } |
| 1685 | return nil |
| 1686 | } |
| 1687 | |
| 1688 | func (p *ClientStats) Write(oprot thrift.TProtocol) error { |
| 1689 | if err := oprot.WriteStructBegin("ClientStats"); err != nil { |
| 1690 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 1691 | } |
| 1692 | if err := p.writeField1(oprot); err != nil { |
| 1693 | return err |
| 1694 | } |
| 1695 | if err := p.writeField2(oprot); err != nil { |
| 1696 | return err |
| 1697 | } |
| 1698 | if err := p.writeField3(oprot); err != nil { |
| 1699 | return err |
| 1700 | } |
| 1701 | if err := oprot.WriteFieldStop(); err != nil { |
| 1702 | return thrift.PrependError("write field stop error: ", err) |
| 1703 | } |
| 1704 | if err := oprot.WriteStructEnd(); err != nil { |
| 1705 | return thrift.PrependError("write struct stop error: ", err) |
| 1706 | } |
| 1707 | return nil |
| 1708 | } |
| 1709 | |
| 1710 | func (p *ClientStats) writeField1(oprot thrift.TProtocol) (err error) { |
| 1711 | if err := oprot.WriteFieldBegin("fullQueueDroppedSpans", thrift.I64, 1); err != nil { |
| 1712 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fullQueueDroppedSpans: ", p), err) |
| 1713 | } |
| 1714 | if err := oprot.WriteI64(int64(p.FullQueueDroppedSpans)); err != nil { |
| 1715 | return thrift.PrependError(fmt.Sprintf("%T.fullQueueDroppedSpans (1) field write error: ", p), err) |
| 1716 | } |
| 1717 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1718 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fullQueueDroppedSpans: ", p), err) |
| 1719 | } |
| 1720 | return err |
| 1721 | } |
| 1722 | |
| 1723 | func (p *ClientStats) writeField2(oprot thrift.TProtocol) (err error) { |
| 1724 | if err := oprot.WriteFieldBegin("tooLargeDroppedSpans", thrift.I64, 2); err != nil { |
| 1725 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tooLargeDroppedSpans: ", p), err) |
| 1726 | } |
| 1727 | if err := oprot.WriteI64(int64(p.TooLargeDroppedSpans)); err != nil { |
| 1728 | return thrift.PrependError(fmt.Sprintf("%T.tooLargeDroppedSpans (2) field write error: ", p), err) |
| 1729 | } |
| 1730 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1731 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tooLargeDroppedSpans: ", p), err) |
| 1732 | } |
| 1733 | return err |
| 1734 | } |
| 1735 | |
| 1736 | func (p *ClientStats) writeField3(oprot thrift.TProtocol) (err error) { |
| 1737 | if err := oprot.WriteFieldBegin("failedToEmitSpans", thrift.I64, 3); err != nil { |
| 1738 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:failedToEmitSpans: ", p), err) |
| 1739 | } |
| 1740 | if err := oprot.WriteI64(int64(p.FailedToEmitSpans)); err != nil { |
| 1741 | return thrift.PrependError(fmt.Sprintf("%T.failedToEmitSpans (3) field write error: ", p), err) |
| 1742 | } |
| 1743 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1744 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:failedToEmitSpans: ", p), err) |
| 1745 | } |
| 1746 | return err |
| 1747 | } |
| 1748 | |
| 1749 | func (p *ClientStats) String() string { |
| 1750 | if p == nil { |
| 1751 | return "<nil>" |
| 1752 | } |
| 1753 | return fmt.Sprintf("ClientStats(%+v)", *p) |
| 1754 | } |
| 1755 | |
| 1756 | // Attributes: |
| 1757 | // - Process |
| 1758 | // - Spans |
| 1759 | // - SeqNo |
| 1760 | // - Stats |
| 1761 | type Batch struct { |
| 1762 | Process *Process `thrift:"process,1,required" json:"process"` |
| 1763 | Spans []*Span `thrift:"spans,2,required" json:"spans"` |
| 1764 | SeqNo *int64 `thrift:"seqNo,3" json:"seqNo,omitempty"` |
| 1765 | Stats *ClientStats `thrift:"stats,4" json:"stats,omitempty"` |
| 1766 | } |
| 1767 | |
| 1768 | func NewBatch() *Batch { |
| 1769 | return &Batch{} |
| 1770 | } |
| 1771 | |
| 1772 | var Batch_Process_DEFAULT *Process |
| 1773 | |
| 1774 | func (p *Batch) GetProcess() *Process { |
| 1775 | if !p.IsSetProcess() { |
| 1776 | return Batch_Process_DEFAULT |
| 1777 | } |
| 1778 | return p.Process |
| 1779 | } |
| 1780 | |
| 1781 | func (p *Batch) GetSpans() []*Span { |
| 1782 | return p.Spans |
| 1783 | } |
| 1784 | |
| 1785 | var Batch_SeqNo_DEFAULT int64 |
| 1786 | |
| 1787 | func (p *Batch) GetSeqNo() int64 { |
| 1788 | if !p.IsSetSeqNo() { |
| 1789 | return Batch_SeqNo_DEFAULT |
| 1790 | } |
| 1791 | return *p.SeqNo |
| 1792 | } |
| 1793 | |
| 1794 | var Batch_Stats_DEFAULT *ClientStats |
| 1795 | |
| 1796 | func (p *Batch) GetStats() *ClientStats { |
| 1797 | if !p.IsSetStats() { |
| 1798 | return Batch_Stats_DEFAULT |
| 1799 | } |
| 1800 | return p.Stats |
| 1801 | } |
| 1802 | func (p *Batch) IsSetProcess() bool { |
| 1803 | return p.Process != nil |
| 1804 | } |
| 1805 | |
| 1806 | func (p *Batch) IsSetSeqNo() bool { |
| 1807 | return p.SeqNo != nil |
| 1808 | } |
| 1809 | |
| 1810 | func (p *Batch) IsSetStats() bool { |
| 1811 | return p.Stats != nil |
| 1812 | } |
| 1813 | |
| 1814 | func (p *Batch) Read(iprot thrift.TProtocol) error { |
| 1815 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 1816 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 1817 | } |
| 1818 | |
| 1819 | var issetProcess bool = false |
| 1820 | var issetSpans bool = false |
| 1821 | |
| 1822 | for { |
| 1823 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 1824 | if err != nil { |
| 1825 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 1826 | } |
| 1827 | if fieldTypeId == thrift.STOP { |
| 1828 | break |
| 1829 | } |
| 1830 | switch fieldId { |
| 1831 | case 1: |
| 1832 | if err := p.readField1(iprot); err != nil { |
| 1833 | return err |
| 1834 | } |
| 1835 | issetProcess = true |
| 1836 | case 2: |
| 1837 | if err := p.readField2(iprot); err != nil { |
| 1838 | return err |
| 1839 | } |
| 1840 | issetSpans = true |
| 1841 | case 3: |
| 1842 | if err := p.readField3(iprot); err != nil { |
| 1843 | return err |
| 1844 | } |
| 1845 | case 4: |
| 1846 | if err := p.readField4(iprot); err != nil { |
| 1847 | return err |
| 1848 | } |
| 1849 | default: |
| 1850 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 1851 | return err |
| 1852 | } |
| 1853 | } |
| 1854 | if err := iprot.ReadFieldEnd(); err != nil { |
| 1855 | return err |
| 1856 | } |
| 1857 | } |
| 1858 | if err := iprot.ReadStructEnd(); err != nil { |
| 1859 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 1860 | } |
| 1861 | if !issetProcess { |
| 1862 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Process is not set")) |
| 1863 | } |
| 1864 | if !issetSpans { |
| 1865 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Spans is not set")) |
| 1866 | } |
| 1867 | return nil |
| 1868 | } |
| 1869 | |
| 1870 | func (p *Batch) readField1(iprot thrift.TProtocol) error { |
| 1871 | p.Process = &Process{} |
| 1872 | if err := p.Process.Read(iprot); err != nil { |
| 1873 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Process), err) |
| 1874 | } |
| 1875 | return nil |
| 1876 | } |
| 1877 | |
| 1878 | func (p *Batch) readField2(iprot thrift.TProtocol) error { |
| 1879 | _, size, err := iprot.ReadListBegin() |
| 1880 | if err != nil { |
| 1881 | return thrift.PrependError("error reading list begin: ", err) |
| 1882 | } |
| 1883 | tSlice := make([]*Span, 0, size) |
| 1884 | p.Spans = tSlice |
| 1885 | for i := 0; i < size; i++ { |
| 1886 | _elem5 := &Span{} |
| 1887 | if err := _elem5.Read(iprot); err != nil { |
| 1888 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) |
| 1889 | } |
| 1890 | p.Spans = append(p.Spans, _elem5) |
| 1891 | } |
| 1892 | if err := iprot.ReadListEnd(); err != nil { |
| 1893 | return thrift.PrependError("error reading list end: ", err) |
| 1894 | } |
| 1895 | return nil |
| 1896 | } |
| 1897 | |
| 1898 | func (p *Batch) readField3(iprot thrift.TProtocol) error { |
| 1899 | if v, err := iprot.ReadI64(); err != nil { |
| 1900 | return thrift.PrependError("error reading field 3: ", err) |
| 1901 | } else { |
| 1902 | p.SeqNo = &v |
| 1903 | } |
| 1904 | return nil |
| 1905 | } |
| 1906 | |
| 1907 | func (p *Batch) readField4(iprot thrift.TProtocol) error { |
| 1908 | p.Stats = &ClientStats{} |
| 1909 | if err := p.Stats.Read(iprot); err != nil { |
| 1910 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) |
| 1911 | } |
| 1912 | return nil |
| 1913 | } |
| 1914 | |
| 1915 | func (p *Batch) Write(oprot thrift.TProtocol) error { |
| 1916 | if err := oprot.WriteStructBegin("Batch"); err != nil { |
| 1917 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 1918 | } |
| 1919 | if err := p.writeField1(oprot); err != nil { |
| 1920 | return err |
| 1921 | } |
| 1922 | if err := p.writeField2(oprot); err != nil { |
| 1923 | return err |
| 1924 | } |
| 1925 | if err := p.writeField3(oprot); err != nil { |
| 1926 | return err |
| 1927 | } |
| 1928 | if err := p.writeField4(oprot); err != nil { |
| 1929 | return err |
| 1930 | } |
| 1931 | if err := oprot.WriteFieldStop(); err != nil { |
| 1932 | return thrift.PrependError("write field stop error: ", err) |
| 1933 | } |
| 1934 | if err := oprot.WriteStructEnd(); err != nil { |
| 1935 | return thrift.PrependError("write struct stop error: ", err) |
| 1936 | } |
| 1937 | return nil |
| 1938 | } |
| 1939 | |
| 1940 | func (p *Batch) writeField1(oprot thrift.TProtocol) (err error) { |
| 1941 | if err := oprot.WriteFieldBegin("process", thrift.STRUCT, 1); err != nil { |
| 1942 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:process: ", p), err) |
| 1943 | } |
| 1944 | if err := p.Process.Write(oprot); err != nil { |
| 1945 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Process), err) |
| 1946 | } |
| 1947 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1948 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:process: ", p), err) |
| 1949 | } |
| 1950 | return err |
| 1951 | } |
| 1952 | |
| 1953 | func (p *Batch) writeField2(oprot thrift.TProtocol) (err error) { |
| 1954 | if err := oprot.WriteFieldBegin("spans", thrift.LIST, 2); err != nil { |
| 1955 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:spans: ", p), err) |
| 1956 | } |
| 1957 | if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Spans)); err != nil { |
| 1958 | return thrift.PrependError("error writing list begin: ", err) |
| 1959 | } |
| 1960 | for _, v := range p.Spans { |
| 1961 | if err := v.Write(oprot); err != nil { |
| 1962 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 1963 | } |
| 1964 | } |
| 1965 | if err := oprot.WriteListEnd(); err != nil { |
| 1966 | return thrift.PrependError("error writing list end: ", err) |
| 1967 | } |
| 1968 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1969 | return thrift.PrependError(fmt.Sprintf("%T write field end error 2:spans: ", p), err) |
| 1970 | } |
| 1971 | return err |
| 1972 | } |
| 1973 | |
| 1974 | func (p *Batch) writeField3(oprot thrift.TProtocol) (err error) { |
| 1975 | if p.IsSetSeqNo() { |
| 1976 | if err := oprot.WriteFieldBegin("seqNo", thrift.I64, 3); err != nil { |
| 1977 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:seqNo: ", p), err) |
| 1978 | } |
| 1979 | if err := oprot.WriteI64(int64(*p.SeqNo)); err != nil { |
| 1980 | return thrift.PrependError(fmt.Sprintf("%T.seqNo (3) field write error: ", p), err) |
| 1981 | } |
| 1982 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1983 | return thrift.PrependError(fmt.Sprintf("%T write field end error 3:seqNo: ", p), err) |
| 1984 | } |
| 1985 | } |
| 1986 | return err |
| 1987 | } |
| 1988 | |
| 1989 | func (p *Batch) writeField4(oprot thrift.TProtocol) (err error) { |
| 1990 | if p.IsSetStats() { |
| 1991 | if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 4); err != nil { |
| 1992 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:stats: ", p), err) |
| 1993 | } |
| 1994 | if err := p.Stats.Write(oprot); err != nil { |
| 1995 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) |
| 1996 | } |
| 1997 | if err := oprot.WriteFieldEnd(); err != nil { |
| 1998 | return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stats: ", p), err) |
| 1999 | } |
| 2000 | } |
| 2001 | return err |
| 2002 | } |
| 2003 | |
| 2004 | func (p *Batch) String() string { |
| 2005 | if p == nil { |
| 2006 | return "<nil>" |
| 2007 | } |
| 2008 | return fmt.Sprintf("Batch(%+v)", *p) |
| 2009 | } |
| 2010 | |
| 2011 | // Attributes: |
| 2012 | // - Ok |
| 2013 | type BatchSubmitResponse struct { |
| 2014 | Ok bool `thrift:"ok,1,required" json:"ok"` |
| 2015 | } |
| 2016 | |
| 2017 | func NewBatchSubmitResponse() *BatchSubmitResponse { |
| 2018 | return &BatchSubmitResponse{} |
| 2019 | } |
| 2020 | |
| 2021 | func (p *BatchSubmitResponse) GetOk() bool { |
| 2022 | return p.Ok |
| 2023 | } |
| 2024 | func (p *BatchSubmitResponse) Read(iprot thrift.TProtocol) error { |
| 2025 | if _, err := iprot.ReadStructBegin(); err != nil { |
| 2026 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 2027 | } |
| 2028 | |
| 2029 | var issetOk bool = false |
| 2030 | |
| 2031 | for { |
| 2032 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() |
| 2033 | if err != nil { |
| 2034 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 2035 | } |
| 2036 | if fieldTypeId == thrift.STOP { |
| 2037 | break |
| 2038 | } |
| 2039 | switch fieldId { |
| 2040 | case 1: |
| 2041 | if err := p.readField1(iprot); err != nil { |
| 2042 | return err |
| 2043 | } |
| 2044 | issetOk = true |
| 2045 | default: |
| 2046 | if err := iprot.Skip(fieldTypeId); err != nil { |
| 2047 | return err |
| 2048 | } |
| 2049 | } |
| 2050 | if err := iprot.ReadFieldEnd(); err != nil { |
| 2051 | return err |
| 2052 | } |
| 2053 | } |
| 2054 | if err := iprot.ReadStructEnd(); err != nil { |
| 2055 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 2056 | } |
| 2057 | if !issetOk { |
| 2058 | return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Ok is not set")) |
| 2059 | } |
| 2060 | return nil |
| 2061 | } |
| 2062 | |
| 2063 | func (p *BatchSubmitResponse) readField1(iprot thrift.TProtocol) error { |
| 2064 | if v, err := iprot.ReadBool(); err != nil { |
| 2065 | return thrift.PrependError("error reading field 1: ", err) |
| 2066 | } else { |
| 2067 | p.Ok = v |
| 2068 | } |
| 2069 | return nil |
| 2070 | } |
| 2071 | |
| 2072 | func (p *BatchSubmitResponse) Write(oprot thrift.TProtocol) error { |
| 2073 | if err := oprot.WriteStructBegin("BatchSubmitResponse"); err != nil { |
| 2074 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) |
| 2075 | } |
| 2076 | if err := p.writeField1(oprot); err != nil { |
| 2077 | return err |
| 2078 | } |
| 2079 | if err := oprot.WriteFieldStop(); err != nil { |
| 2080 | return thrift.PrependError("write field stop error: ", err) |
| 2081 | } |
| 2082 | if err := oprot.WriteStructEnd(); err != nil { |
| 2083 | return thrift.PrependError("write struct stop error: ", err) |
| 2084 | } |
| 2085 | return nil |
| 2086 | } |
| 2087 | |
| 2088 | func (p *BatchSubmitResponse) writeField1(oprot thrift.TProtocol) (err error) { |
| 2089 | if err := oprot.WriteFieldBegin("ok", thrift.BOOL, 1); err != nil { |
| 2090 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ok: ", p), err) |
| 2091 | } |
| 2092 | if err := oprot.WriteBool(bool(p.Ok)); err != nil { |
| 2093 | return thrift.PrependError(fmt.Sprintf("%T.ok (1) field write error: ", p), err) |
| 2094 | } |
| 2095 | if err := oprot.WriteFieldEnd(); err != nil { |
| 2096 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ok: ", p), err) |
| 2097 | } |
| 2098 | return err |
| 2099 | } |
| 2100 | |
| 2101 | func (p *BatchSubmitResponse) String() string { |
| 2102 | if p == nil { |
| 2103 | return "<nil>" |
| 2104 | } |
| 2105 | return fmt.Sprintf("BatchSubmitResponse(%+v)", *p) |
| 2106 | } |