khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 1 | // Code generated by Thrift Compiler (0.14.1). DO NOT EDIT. |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 2 | |
| 3 | package agent |
| 4 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 5 | import( |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 6 | "bytes" |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 7 | "context" |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 8 | "fmt" |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 9 | "time" |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 10 | "github.com/uber/jaeger-client-go/thrift" |
| 11 | "github.com/uber/jaeger-client-go/thrift-gen/jaeger" |
| 12 | "github.com/uber/jaeger-client-go/thrift-gen/zipkincore" |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 13 | |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 14 | ) |
| 15 | |
| 16 | // (needed to ensure safety because of naive import list construction.) |
| 17 | var _ = thrift.ZERO |
| 18 | var _ = fmt.Printf |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 19 | var _ = context.Background |
| 20 | var _ = time.Now |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 21 | var _ = bytes.Equal |
| 22 | |
| 23 | var _ = jaeger.GoUnusedProtection__ |
| 24 | var _ = zipkincore.GoUnusedProtection__ |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 25 | type Agent interface { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 26 | // Parameters: |
| 27 | // - Spans |
| 28 | EmitZipkinBatch(ctx context.Context, spans []*zipkincore.Span) (_err error) |
| 29 | // Parameters: |
| 30 | // - Batch |
| 31 | EmitBatch(ctx context.Context, batch *jaeger.Batch) (_err error) |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | type AgentClient struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 35 | c thrift.TClient |
| 36 | meta thrift.ResponseMeta |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | func NewAgentClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AgentClient { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 40 | return &AgentClient{ |
| 41 | c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), |
| 42 | } |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | func NewAgentClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AgentClient { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 46 | return &AgentClient{ |
| 47 | c: thrift.NewTStandardClient(iprot, oprot), |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func NewAgentClient(c thrift.TClient) *AgentClient { |
| 52 | return &AgentClient{ |
| 53 | c: c, |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func (p *AgentClient) Client_() thrift.TClient { |
| 58 | return p.c |
| 59 | } |
| 60 | |
| 61 | func (p *AgentClient) LastResponseMeta_() thrift.ResponseMeta { |
| 62 | return p.meta |
| 63 | } |
| 64 | |
| 65 | func (p *AgentClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { |
| 66 | p.meta = meta |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | // Parameters: |
| 70 | // - Spans |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 71 | func (p *AgentClient) EmitZipkinBatch(ctx context.Context, spans []*zipkincore.Span) (_err error) { |
| 72 | var _args0 AgentEmitZipkinBatchArgs |
| 73 | _args0.Spans = spans |
| 74 | p.SetLastResponseMeta_(thrift.ResponseMeta{}) |
| 75 | if _, err := p.Client_().Call(ctx, "emitZipkinBatch", &_args0, nil); err != nil { |
| 76 | return err |
| 77 | } |
| 78 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | // Parameters: |
| 82 | // - Batch |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 83 | func (p *AgentClient) EmitBatch(ctx context.Context, batch *jaeger.Batch) (_err error) { |
| 84 | var _args1 AgentEmitBatchArgs |
| 85 | _args1.Batch = batch |
| 86 | p.SetLastResponseMeta_(thrift.ResponseMeta{}) |
| 87 | if _, err := p.Client_().Call(ctx, "emitBatch", &_args1, nil); err != nil { |
| 88 | return err |
| 89 | } |
| 90 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | type AgentProcessor struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 94 | processorMap map[string]thrift.TProcessorFunction |
| 95 | handler Agent |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | func (p *AgentProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 99 | p.processorMap[key] = processor |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 100 | } |
| 101 | |
| 102 | func (p *AgentProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 103 | processor, ok = p.processorMap[key] |
| 104 | return processor, ok |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | func (p *AgentProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 108 | return p.processorMap |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | func NewAgentProcessor(handler Agent) *AgentProcessor { |
| 112 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 113 | self2 := &AgentProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} |
| 114 | self2.processorMap["emitZipkinBatch"] = &agentProcessorEmitZipkinBatch{handler:handler} |
| 115 | self2.processorMap["emitBatch"] = &agentProcessorEmitBatch{handler:handler} |
| 116 | return self2 |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 117 | } |
| 118 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 119 | func (p *AgentProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 120 | name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) |
| 121 | if err2 != nil { return false, thrift.WrapTException(err2) } |
| 122 | if processor, ok := p.GetProcessorFunction(name); ok { |
| 123 | return processor.Process(ctx, seqId, iprot, oprot) |
| 124 | } |
| 125 | iprot.Skip(ctx, thrift.STRUCT) |
| 126 | iprot.ReadMessageEnd(ctx) |
| 127 | x3 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) |
| 128 | oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) |
| 129 | x3.Write(ctx, oprot) |
| 130 | oprot.WriteMessageEnd(ctx) |
| 131 | oprot.Flush(ctx) |
| 132 | return false, x3 |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 133 | |
| 134 | } |
| 135 | |
| 136 | type agentProcessorEmitZipkinBatch struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 137 | handler Agent |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 138 | } |
| 139 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 140 | func (p *agentProcessorEmitZipkinBatch) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 141 | args := AgentEmitZipkinBatchArgs{} |
| 142 | var err2 error |
| 143 | if err2 = args.Read(ctx, iprot); err2 != nil { |
| 144 | iprot.ReadMessageEnd(ctx) |
| 145 | return false, thrift.WrapTException(err2) |
| 146 | } |
| 147 | iprot.ReadMessageEnd(ctx) |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 148 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 149 | tickerCancel := func() {} |
| 150 | _ = tickerCancel |
| 151 | |
| 152 | if err2 = p.handler.EmitZipkinBatch(ctx, args.Spans); err2 != nil { |
| 153 | tickerCancel() |
| 154 | return true, thrift.WrapTException(err2) |
| 155 | } |
| 156 | tickerCancel() |
| 157 | return true, nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | type agentProcessorEmitBatch struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 161 | handler Agent |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 162 | } |
| 163 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 164 | func (p *agentProcessorEmitBatch) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { |
| 165 | args := AgentEmitBatchArgs{} |
| 166 | var err2 error |
| 167 | if err2 = args.Read(ctx, iprot); err2 != nil { |
| 168 | iprot.ReadMessageEnd(ctx) |
| 169 | return false, thrift.WrapTException(err2) |
| 170 | } |
| 171 | iprot.ReadMessageEnd(ctx) |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 172 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 173 | tickerCancel := func() {} |
| 174 | _ = tickerCancel |
| 175 | |
| 176 | if err2 = p.handler.EmitBatch(ctx, args.Batch); err2 != nil { |
| 177 | tickerCancel() |
| 178 | return true, thrift.WrapTException(err2) |
| 179 | } |
| 180 | tickerCancel() |
| 181 | return true, nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 182 | } |
| 183 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 184 | |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 185 | // HELPER FUNCTIONS AND STRUCTURES |
| 186 | |
| 187 | // Attributes: |
| 188 | // - Spans |
| 189 | type AgentEmitZipkinBatchArgs struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 190 | Spans []*zipkincore.Span `thrift:"spans,1" db:"spans" json:"spans"` |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 191 | } |
| 192 | |
| 193 | func NewAgentEmitZipkinBatchArgs() *AgentEmitZipkinBatchArgs { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 194 | return &AgentEmitZipkinBatchArgs{} |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 195 | } |
| 196 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 197 | |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 198 | func (p *AgentEmitZipkinBatchArgs) GetSpans() []*zipkincore.Span { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 199 | return p.Spans |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 200 | } |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 201 | func (p *AgentEmitZipkinBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { |
| 202 | if _, err := iprot.ReadStructBegin(ctx); err != nil { |
| 203 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 204 | } |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 205 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 206 | |
| 207 | for { |
| 208 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) |
| 209 | if err != nil { |
| 210 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 211 | } |
| 212 | if fieldTypeId == thrift.STOP { break; } |
| 213 | switch fieldId { |
| 214 | case 1: |
| 215 | if fieldTypeId == thrift.LIST { |
| 216 | if err := p.ReadField1(ctx, iprot); err != nil { |
| 217 | return err |
| 218 | } |
| 219 | } else { |
| 220 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 221 | return err |
| 222 | } |
| 223 | } |
| 224 | default: |
| 225 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 226 | return err |
| 227 | } |
| 228 | } |
| 229 | if err := iprot.ReadFieldEnd(ctx); err != nil { |
| 230 | return err |
| 231 | } |
| 232 | } |
| 233 | if err := iprot.ReadStructEnd(ctx); err != nil { |
| 234 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 235 | } |
| 236 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 237 | } |
| 238 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 239 | func (p *AgentEmitZipkinBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { |
| 240 | _, size, err := iprot.ReadListBegin(ctx) |
| 241 | if err != nil { |
| 242 | return thrift.PrependError("error reading list begin: ", err) |
| 243 | } |
| 244 | tSlice := make([]*zipkincore.Span, 0, size) |
| 245 | p.Spans = tSlice |
| 246 | for i := 0; i < size; i ++ { |
| 247 | _elem4 := &zipkincore.Span{} |
| 248 | if err := _elem4.Read(ctx, iprot); err != nil { |
| 249 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) |
| 250 | } |
| 251 | p.Spans = append(p.Spans, _elem4) |
| 252 | } |
| 253 | if err := iprot.ReadListEnd(ctx); err != nil { |
| 254 | return thrift.PrependError("error reading list end: ", err) |
| 255 | } |
| 256 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 257 | } |
| 258 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 259 | func (p *AgentEmitZipkinBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { |
| 260 | if err := oprot.WriteStructBegin(ctx, "emitZipkinBatch_args"); err != nil { |
| 261 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } |
| 262 | if p != nil { |
| 263 | if err := p.writeField1(ctx, oprot); err != nil { return err } |
| 264 | } |
| 265 | if err := oprot.WriteFieldStop(ctx); err != nil { |
| 266 | return thrift.PrependError("write field stop error: ", err) } |
| 267 | if err := oprot.WriteStructEnd(ctx); err != nil { |
| 268 | return thrift.PrependError("write struct stop error: ", err) } |
| 269 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 270 | } |
| 271 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 272 | func (p *AgentEmitZipkinBatchArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { |
| 273 | if err := oprot.WriteFieldBegin(ctx, "spans", thrift.LIST, 1); err != nil { |
| 274 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spans: ", p), err) } |
| 275 | if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spans)); err != nil { |
| 276 | return thrift.PrependError("error writing list begin: ", err) |
| 277 | } |
| 278 | for _, v := range p.Spans { |
| 279 | if err := v.Write(ctx, oprot); err != nil { |
| 280 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) |
| 281 | } |
| 282 | } |
| 283 | if err := oprot.WriteListEnd(ctx); err != nil { |
| 284 | return thrift.PrependError("error writing list end: ", err) |
| 285 | } |
| 286 | if err := oprot.WriteFieldEnd(ctx); err != nil { |
| 287 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spans: ", p), err) } |
| 288 | return err |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 289 | } |
| 290 | |
| 291 | func (p *AgentEmitZipkinBatchArgs) String() string { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 292 | if p == nil { |
| 293 | return "<nil>" |
| 294 | } |
| 295 | return fmt.Sprintf("AgentEmitZipkinBatchArgs(%+v)", *p) |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | // Attributes: |
| 299 | // - Batch |
| 300 | type AgentEmitBatchArgs struct { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 301 | Batch *jaeger.Batch `thrift:"batch,1" db:"batch" json:"batch"` |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | func NewAgentEmitBatchArgs() *AgentEmitBatchArgs { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 305 | return &AgentEmitBatchArgs{} |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | var AgentEmitBatchArgs_Batch_DEFAULT *jaeger.Batch |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 309 | func (p *AgentEmitBatchArgs) GetBatch() *jaeger.Batch { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 310 | if !p.IsSetBatch() { |
| 311 | return AgentEmitBatchArgs_Batch_DEFAULT |
| 312 | } |
| 313 | return p.Batch |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 314 | } |
| 315 | func (p *AgentEmitBatchArgs) IsSetBatch() bool { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 316 | return p.Batch != nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 317 | } |
| 318 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 319 | func (p *AgentEmitBatchArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { |
| 320 | if _, err := iprot.ReadStructBegin(ctx); err != nil { |
| 321 | return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) |
| 322 | } |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 323 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 324 | |
| 325 | for { |
| 326 | _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) |
| 327 | if err != nil { |
| 328 | return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) |
| 329 | } |
| 330 | if fieldTypeId == thrift.STOP { break; } |
| 331 | switch fieldId { |
| 332 | case 1: |
| 333 | if fieldTypeId == thrift.STRUCT { |
| 334 | if err := p.ReadField1(ctx, iprot); err != nil { |
| 335 | return err |
| 336 | } |
| 337 | } else { |
| 338 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 339 | return err |
| 340 | } |
| 341 | } |
| 342 | default: |
| 343 | if err := iprot.Skip(ctx, fieldTypeId); err != nil { |
| 344 | return err |
| 345 | } |
| 346 | } |
| 347 | if err := iprot.ReadFieldEnd(ctx); err != nil { |
| 348 | return err |
| 349 | } |
| 350 | } |
| 351 | if err := iprot.ReadStructEnd(ctx); err != nil { |
| 352 | return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) |
| 353 | } |
| 354 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 355 | } |
| 356 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 357 | func (p *AgentEmitBatchArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { |
| 358 | p.Batch = &jaeger.Batch{} |
| 359 | if err := p.Batch.Read(ctx, iprot); err != nil { |
| 360 | return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Batch), err) |
| 361 | } |
| 362 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 363 | } |
| 364 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 365 | func (p *AgentEmitBatchArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { |
| 366 | if err := oprot.WriteStructBegin(ctx, "emitBatch_args"); err != nil { |
| 367 | return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } |
| 368 | if p != nil { |
| 369 | if err := p.writeField1(ctx, oprot); err != nil { return err } |
| 370 | } |
| 371 | if err := oprot.WriteFieldStop(ctx); err != nil { |
| 372 | return thrift.PrependError("write field stop error: ", err) } |
| 373 | if err := oprot.WriteStructEnd(ctx); err != nil { |
| 374 | return thrift.PrependError("write struct stop error: ", err) } |
| 375 | return nil |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 376 | } |
| 377 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 378 | func (p *AgentEmitBatchArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { |
| 379 | if err := oprot.WriteFieldBegin(ctx, "batch", thrift.STRUCT, 1); err != nil { |
| 380 | return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:batch: ", p), err) } |
| 381 | if err := p.Batch.Write(ctx, oprot); err != nil { |
| 382 | return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Batch), err) |
| 383 | } |
| 384 | if err := oprot.WriteFieldEnd(ctx); err != nil { |
| 385 | return thrift.PrependError(fmt.Sprintf("%T write field end error 1:batch: ", p), err) } |
| 386 | return err |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | func (p *AgentEmitBatchArgs) String() string { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 390 | if p == nil { |
| 391 | return "<nil>" |
| 392 | } |
| 393 | return fmt.Sprintf("AgentEmitBatchArgs(%+v)", *p) |
Girish Gowdra | 631ef3d | 2020-06-15 10:45:52 -0700 | [diff] [blame] | 394 | } |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame^] | 395 | |
| 396 | |