jaeger.go 86 KB

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