1 // Autogenerated by Thrift Compiler (1.0.0-dev)
2 // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
11 "github.com/apache/thrift/lib/go/thrift"
14 // (needed to ensure safety because of naive import list construction.)
17 var _ = context.Background
18 var _ = reflect.DeepEqual
24 type SumReply struct {
25 Value int64 `thrift:"value,1" db:"value" json:"value"`
26 Err string `thrift:"err,2" db:"err" json:"err"`
29 func NewSumReply() *SumReply {
34 func (p *SumReply) GetValue() int64 {
38 func (p *SumReply) GetErr() string {
41 func (p *SumReply) Read(iprot thrift.TProtocol) error {
42 if _, err := iprot.ReadStructBegin(); err != nil {
43 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
48 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
50 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
52 if fieldTypeId == thrift.STOP { break; }
55 if fieldTypeId == thrift.I64 {
56 if err := p.ReadField1(iprot); err != nil {
60 if err := iprot.Skip(fieldTypeId); err != nil {
65 if fieldTypeId == thrift.STRING {
66 if err := p.ReadField2(iprot); err != nil {
70 if err := iprot.Skip(fieldTypeId); err != nil {
75 if err := iprot.Skip(fieldTypeId); err != nil {
79 if err := iprot.ReadFieldEnd(); err != nil {
83 if err := iprot.ReadStructEnd(); err != nil {
84 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
89 func (p *SumReply) ReadField1(iprot thrift.TProtocol) error {
90 if v, err := iprot.ReadI64(); err != nil {
91 return thrift.PrependError("error reading field 1: ", err)
98 func (p *SumReply) ReadField2(iprot thrift.TProtocol) error {
99 if v, err := iprot.ReadString(); err != nil {
100 return thrift.PrependError("error reading field 2: ", err)
107 func (p *SumReply) Write(oprot thrift.TProtocol) error {
108 if err := oprot.WriteStructBegin("SumReply"); err != nil {
109 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
111 if err := p.writeField1(oprot); err != nil { return err }
112 if err := p.writeField2(oprot); err != nil { return err }
114 if err := oprot.WriteFieldStop(); err != nil {
115 return thrift.PrependError("write field stop error: ", err) }
116 if err := oprot.WriteStructEnd(); err != nil {
117 return thrift.PrependError("write struct stop error: ", err) }
121 func (p *SumReply) writeField1(oprot thrift.TProtocol) (err error) {
122 if err := oprot.WriteFieldBegin("value", thrift.I64, 1); err != nil {
123 return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
124 if err := oprot.WriteI64(int64(p.Value)); err != nil {
125 return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
126 if err := oprot.WriteFieldEnd(); err != nil {
127 return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
131 func (p *SumReply) writeField2(oprot thrift.TProtocol) (err error) {
132 if err := oprot.WriteFieldBegin("err", thrift.STRING, 2); err != nil {
133 return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err) }
134 if err := oprot.WriteString(string(p.Err)); err != nil {
135 return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err) }
136 if err := oprot.WriteFieldEnd(); err != nil {
137 return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err) }
141 func (p *SumReply) String() string {
145 return fmt.Sprintf("SumReply(%+v)", *p)
151 type ConcatReply struct {
152 Value string `thrift:"value,1" db:"value" json:"value"`
153 Err string `thrift:"err,2" db:"err" json:"err"`
156 func NewConcatReply() *ConcatReply {
157 return &ConcatReply{}
161 func (p *ConcatReply) GetValue() string {
165 func (p *ConcatReply) GetErr() string {
168 func (p *ConcatReply) Read(iprot thrift.TProtocol) error {
169 if _, err := iprot.ReadStructBegin(); err != nil {
170 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
175 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
177 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
179 if fieldTypeId == thrift.STOP { break; }
182 if fieldTypeId == thrift.STRING {
183 if err := p.ReadField1(iprot); err != nil {
187 if err := iprot.Skip(fieldTypeId); err != nil {
192 if fieldTypeId == thrift.STRING {
193 if err := p.ReadField2(iprot); err != nil {
197 if err := iprot.Skip(fieldTypeId); err != nil {
202 if err := iprot.Skip(fieldTypeId); err != nil {
206 if err := iprot.ReadFieldEnd(); err != nil {
210 if err := iprot.ReadStructEnd(); err != nil {
211 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
216 func (p *ConcatReply) ReadField1(iprot thrift.TProtocol) error {
217 if v, err := iprot.ReadString(); err != nil {
218 return thrift.PrependError("error reading field 1: ", err)
225 func (p *ConcatReply) ReadField2(iprot thrift.TProtocol) error {
226 if v, err := iprot.ReadString(); err != nil {
227 return thrift.PrependError("error reading field 2: ", err)
234 func (p *ConcatReply) Write(oprot thrift.TProtocol) error {
235 if err := oprot.WriteStructBegin("ConcatReply"); err != nil {
236 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
238 if err := p.writeField1(oprot); err != nil { return err }
239 if err := p.writeField2(oprot); err != nil { return err }
241 if err := oprot.WriteFieldStop(); err != nil {
242 return thrift.PrependError("write field stop error: ", err) }
243 if err := oprot.WriteStructEnd(); err != nil {
244 return thrift.PrependError("write struct stop error: ", err) }
248 func (p *ConcatReply) writeField1(oprot thrift.TProtocol) (err error) {
249 if err := oprot.WriteFieldBegin("value", thrift.STRING, 1); err != nil {
250 return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
251 if err := oprot.WriteString(string(p.Value)); err != nil {
252 return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
253 if err := oprot.WriteFieldEnd(); err != nil {
254 return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
258 func (p *ConcatReply) writeField2(oprot thrift.TProtocol) (err error) {
259 if err := oprot.WriteFieldBegin("err", thrift.STRING, 2); err != nil {
260 return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err) }
261 if err := oprot.WriteString(string(p.Err)); err != nil {
262 return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err) }
263 if err := oprot.WriteFieldEnd(); err != nil {
264 return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err) }
268 func (p *ConcatReply) String() string {
272 return fmt.Sprintf("ConcatReply(%+v)", *p)
275 type AddService interface {
279 Sum(ctx context.Context, a int64, b int64) (r *SumReply, err error)
283 Concat(ctx context.Context, a string, b string) (r *ConcatReply, err error)
286 type AddServiceClient struct {
287 Transport thrift.TTransport
288 ProtocolFactory thrift.TProtocolFactory
289 InputProtocol thrift.TProtocol
290 OutputProtocol thrift.TProtocol
294 func NewAddServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AddServiceClient {
295 return &AddServiceClient{Transport: t,
297 InputProtocol: f.GetProtocol(t),
298 OutputProtocol: f.GetProtocol(t),
303 func NewAddServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AddServiceClient {
304 return &AddServiceClient{Transport: t,
305 ProtocolFactory: nil,
306 InputProtocol: iprot,
307 OutputProtocol: oprot,
315 func (p *AddServiceClient) Sum(ctx context.Context, a int64, b int64) (r *SumReply, err error) {
316 if err = p.sendSum(a, b); err != nil { return }
320 func (p *AddServiceClient) sendSum(a int64, b int64)(err error) {
321 oprot := p.OutputProtocol
323 oprot = p.ProtocolFactory.GetProtocol(p.Transport)
324 p.OutputProtocol = oprot
327 if err = oprot.WriteMessageBegin("Sum", thrift.CALL, p.SeqId); err != nil {
330 args := AddServiceSumArgs{
334 if err = args.Write(oprot); err != nil {
337 if err = oprot.WriteMessageEnd(); err != nil {
344 func (p *AddServiceClient) recvSum() (value *SumReply, err error) {
345 iprot := p.InputProtocol
347 iprot = p.ProtocolFactory.GetProtocol(p.Transport)
348 p.InputProtocol = iprot
350 method, mTypeId, seqId, err := iprot.ReadMessageBegin()
355 err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "Sum failed: wrong method name")
358 if p.SeqId != seqId {
359 err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "Sum failed: out of sequence response")
362 if mTypeId == thrift.EXCEPTION {
363 error0 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
365 error1, err = error0.Read(iprot)
369 if err = iprot.ReadMessageEnd(); err != nil {
375 if mTypeId != thrift.REPLY {
376 err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "Sum failed: invalid message type")
379 result := AddServiceSumResult{}
380 if err = result.Read(iprot); err != nil {
383 if err = iprot.ReadMessageEnd(); err != nil {
386 value = result.GetSuccess()
393 func (p *AddServiceClient) Concat(ctx context.Context, a string, b string) (r *ConcatReply, err error) {
394 if err = p.sendConcat(a, b); err != nil { return }
395 return p.recvConcat()
398 func (p *AddServiceClient) sendConcat(a string, b string)(err error) {
399 oprot := p.OutputProtocol
401 oprot = p.ProtocolFactory.GetProtocol(p.Transport)
402 p.OutputProtocol = oprot
405 if err = oprot.WriteMessageBegin("Concat", thrift.CALL, p.SeqId); err != nil {
408 args := AddServiceConcatArgs{
412 if err = args.Write(oprot); err != nil {
415 if err = oprot.WriteMessageEnd(); err != nil {
422 func (p *AddServiceClient) recvConcat() (value *ConcatReply, err error) {
423 iprot := p.InputProtocol
425 iprot = p.ProtocolFactory.GetProtocol(p.Transport)
426 p.InputProtocol = iprot
428 method, mTypeId, seqId, err := iprot.ReadMessageBegin()
432 if method != "Concat" {
433 err = thrift.NewTApplicationException(thrift.WRONG_METHOD_NAME, "Concat failed: wrong method name")
436 if p.SeqId != seqId {
437 err = thrift.NewTApplicationException(thrift.BAD_SEQUENCE_ID, "Concat failed: out of sequence response")
440 if mTypeId == thrift.EXCEPTION {
441 error2 := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "Unknown Exception")
443 error3, err = error2.Read(iprot)
447 if err = iprot.ReadMessageEnd(); err != nil {
453 if mTypeId != thrift.REPLY {
454 err = thrift.NewTApplicationException(thrift.INVALID_MESSAGE_TYPE_EXCEPTION, "Concat failed: invalid message type")
457 result := AddServiceConcatResult{}
458 if err = result.Read(iprot); err != nil {
461 if err = iprot.ReadMessageEnd(); err != nil {
464 value = result.GetSuccess()
469 type AddServiceProcessor struct {
470 processorMap map[string]thrift.TProcessorFunction
474 func (p *AddServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
475 p.processorMap[key] = processor
478 func (p *AddServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
479 processor, ok = p.processorMap[key]
483 func (p *AddServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
484 return p.processorMap
487 func NewAddServiceProcessor(handler AddService) *AddServiceProcessor {
489 self4 := &AddServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
490 self4.processorMap["Sum"] = &addServiceProcessorSum{handler:handler}
491 self4.processorMap["Concat"] = &addServiceProcessorConcat{handler:handler}
495 func (p *AddServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
496 name, _, seqId, err := iprot.ReadMessageBegin()
497 if err != nil { return false, err }
498 if processor, ok := p.GetProcessorFunction(name); ok {
499 return processor.Process(ctx, seqId, iprot, oprot)
501 iprot.Skip(thrift.STRUCT)
502 iprot.ReadMessageEnd()
503 x5 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
504 oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
506 oprot.WriteMessageEnd()
512 type addServiceProcessorSum struct {
516 func (p *addServiceProcessorSum) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
517 args := AddServiceSumArgs{}
518 if err = args.Read(iprot); err != nil {
519 iprot.ReadMessageEnd()
520 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
521 oprot.WriteMessageBegin("Sum", thrift.EXCEPTION, seqId)
523 oprot.WriteMessageEnd()
528 iprot.ReadMessageEnd()
529 result := AddServiceSumResult{}
532 if retval, err2 = p.handler.Sum(ctx, args.A, args.B); err2 != nil {
533 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Sum: " + err2.Error())
534 oprot.WriteMessageBegin("Sum", thrift.EXCEPTION, seqId)
536 oprot.WriteMessageEnd()
540 result.Success = retval
542 if err2 = oprot.WriteMessageBegin("Sum", thrift.REPLY, seqId); err2 != nil {
545 if err2 = result.Write(oprot); err == nil && err2 != nil {
548 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
551 if err2 = oprot.Flush(); err == nil && err2 != nil {
560 type addServiceProcessorConcat struct {
564 func (p *addServiceProcessorConcat) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
565 args := AddServiceConcatArgs{}
566 if err = args.Read(iprot); err != nil {
567 iprot.ReadMessageEnd()
568 x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
569 oprot.WriteMessageBegin("Concat", thrift.EXCEPTION, seqId)
571 oprot.WriteMessageEnd()
576 iprot.ReadMessageEnd()
577 result := AddServiceConcatResult{}
578 var retval *ConcatReply
580 if retval, err2 = p.handler.Concat(ctx, args.A, args.B); err2 != nil {
581 x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Concat: " + err2.Error())
582 oprot.WriteMessageBegin("Concat", thrift.EXCEPTION, seqId)
584 oprot.WriteMessageEnd()
588 result.Success = retval
590 if err2 = oprot.WriteMessageBegin("Concat", thrift.REPLY, seqId); err2 != nil {
593 if err2 = result.Write(oprot); err == nil && err2 != nil {
596 if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
599 if err2 = oprot.Flush(); err == nil && err2 != nil {
609 // HELPER FUNCTIONS AND STRUCTURES
614 type AddServiceSumArgs struct {
615 A int64 `thrift:"a,1" db:"a" json:"a"`
616 B int64 `thrift:"b,2" db:"b" json:"b"`
619 func NewAddServiceSumArgs() *AddServiceSumArgs {
620 return &AddServiceSumArgs{}
624 func (p *AddServiceSumArgs) GetA() int64 {
628 func (p *AddServiceSumArgs) GetB() int64 {
631 func (p *AddServiceSumArgs) Read(iprot thrift.TProtocol) error {
632 if _, err := iprot.ReadStructBegin(); err != nil {
633 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
638 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
640 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
642 if fieldTypeId == thrift.STOP { break; }
645 if fieldTypeId == thrift.I64 {
646 if err := p.ReadField1(iprot); err != nil {
650 if err := iprot.Skip(fieldTypeId); err != nil {
655 if fieldTypeId == thrift.I64 {
656 if err := p.ReadField2(iprot); err != nil {
660 if err := iprot.Skip(fieldTypeId); err != nil {
665 if err := iprot.Skip(fieldTypeId); err != nil {
669 if err := iprot.ReadFieldEnd(); err != nil {
673 if err := iprot.ReadStructEnd(); err != nil {
674 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
679 func (p *AddServiceSumArgs) ReadField1(iprot thrift.TProtocol) error {
680 if v, err := iprot.ReadI64(); err != nil {
681 return thrift.PrependError("error reading field 1: ", err)
688 func (p *AddServiceSumArgs) ReadField2(iprot thrift.TProtocol) error {
689 if v, err := iprot.ReadI64(); err != nil {
690 return thrift.PrependError("error reading field 2: ", err)
697 func (p *AddServiceSumArgs) Write(oprot thrift.TProtocol) error {
698 if err := oprot.WriteStructBegin("Sum_args"); err != nil {
699 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
701 if err := p.writeField1(oprot); err != nil { return err }
702 if err := p.writeField2(oprot); err != nil { return err }
704 if err := oprot.WriteFieldStop(); err != nil {
705 return thrift.PrependError("write field stop error: ", err) }
706 if err := oprot.WriteStructEnd(); err != nil {
707 return thrift.PrependError("write struct stop error: ", err) }
711 func (p *AddServiceSumArgs) writeField1(oprot thrift.TProtocol) (err error) {
712 if err := oprot.WriteFieldBegin("a", thrift.I64, 1); err != nil {
713 return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err) }
714 if err := oprot.WriteI64(int64(p.A)); err != nil {
715 return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err) }
716 if err := oprot.WriteFieldEnd(); err != nil {
717 return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err) }
721 func (p *AddServiceSumArgs) writeField2(oprot thrift.TProtocol) (err error) {
722 if err := oprot.WriteFieldBegin("b", thrift.I64, 2); err != nil {
723 return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err) }
724 if err := oprot.WriteI64(int64(p.B)); err != nil {
725 return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err) }
726 if err := oprot.WriteFieldEnd(); err != nil {
727 return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err) }
731 func (p *AddServiceSumArgs) String() string {
735 return fmt.Sprintf("AddServiceSumArgs(%+v)", *p)
740 type AddServiceSumResult struct {
741 Success *SumReply `thrift:"success,0" db:"success" json:"success,omitempty"`
744 func NewAddServiceSumResult() *AddServiceSumResult {
745 return &AddServiceSumResult{}
748 var AddServiceSumResult_Success_DEFAULT *SumReply
749 func (p *AddServiceSumResult) GetSuccess() *SumReply {
750 if !p.IsSetSuccess() {
751 return AddServiceSumResult_Success_DEFAULT
755 func (p *AddServiceSumResult) IsSetSuccess() bool {
756 return p.Success != nil
759 func (p *AddServiceSumResult) Read(iprot thrift.TProtocol) error {
760 if _, err := iprot.ReadStructBegin(); err != nil {
761 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
766 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
768 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
770 if fieldTypeId == thrift.STOP { break; }
773 if fieldTypeId == thrift.STRUCT {
774 if err := p.ReadField0(iprot); err != nil {
778 if err := iprot.Skip(fieldTypeId); err != nil {
783 if err := iprot.Skip(fieldTypeId); err != nil {
787 if err := iprot.ReadFieldEnd(); err != nil {
791 if err := iprot.ReadStructEnd(); err != nil {
792 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
797 func (p *AddServiceSumResult) ReadField0(iprot thrift.TProtocol) error {
798 p.Success = &SumReply{}
799 if err := p.Success.Read(iprot); err != nil {
800 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
805 func (p *AddServiceSumResult) Write(oprot thrift.TProtocol) error {
806 if err := oprot.WriteStructBegin("Sum_result"); err != nil {
807 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
809 if err := p.writeField0(oprot); err != nil { return err }
811 if err := oprot.WriteFieldStop(); err != nil {
812 return thrift.PrependError("write field stop error: ", err) }
813 if err := oprot.WriteStructEnd(); err != nil {
814 return thrift.PrependError("write struct stop error: ", err) }
818 func (p *AddServiceSumResult) writeField0(oprot thrift.TProtocol) (err error) {
819 if p.IsSetSuccess() {
820 if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
821 return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
822 if err := p.Success.Write(oprot); err != nil {
823 return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
825 if err := oprot.WriteFieldEnd(); err != nil {
826 return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
831 func (p *AddServiceSumResult) String() string {
835 return fmt.Sprintf("AddServiceSumResult(%+v)", *p)
841 type AddServiceConcatArgs struct {
842 A string `thrift:"a,1" db:"a" json:"a"`
843 B string `thrift:"b,2" db:"b" json:"b"`
846 func NewAddServiceConcatArgs() *AddServiceConcatArgs {
847 return &AddServiceConcatArgs{}
851 func (p *AddServiceConcatArgs) GetA() string {
855 func (p *AddServiceConcatArgs) GetB() string {
858 func (p *AddServiceConcatArgs) Read(iprot thrift.TProtocol) error {
859 if _, err := iprot.ReadStructBegin(); err != nil {
860 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
865 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
867 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
869 if fieldTypeId == thrift.STOP { break; }
872 if fieldTypeId == thrift.STRING {
873 if err := p.ReadField1(iprot); err != nil {
877 if err := iprot.Skip(fieldTypeId); err != nil {
882 if fieldTypeId == thrift.STRING {
883 if err := p.ReadField2(iprot); err != nil {
887 if err := iprot.Skip(fieldTypeId); err != nil {
892 if err := iprot.Skip(fieldTypeId); err != nil {
896 if err := iprot.ReadFieldEnd(); err != nil {
900 if err := iprot.ReadStructEnd(); err != nil {
901 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
906 func (p *AddServiceConcatArgs) ReadField1(iprot thrift.TProtocol) error {
907 if v, err := iprot.ReadString(); err != nil {
908 return thrift.PrependError("error reading field 1: ", err)
915 func (p *AddServiceConcatArgs) ReadField2(iprot thrift.TProtocol) error {
916 if v, err := iprot.ReadString(); err != nil {
917 return thrift.PrependError("error reading field 2: ", err)
924 func (p *AddServiceConcatArgs) Write(oprot thrift.TProtocol) error {
925 if err := oprot.WriteStructBegin("Concat_args"); err != nil {
926 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
928 if err := p.writeField1(oprot); err != nil { return err }
929 if err := p.writeField2(oprot); err != nil { return err }
931 if err := oprot.WriteFieldStop(); err != nil {
932 return thrift.PrependError("write field stop error: ", err) }
933 if err := oprot.WriteStructEnd(); err != nil {
934 return thrift.PrependError("write struct stop error: ", err) }
938 func (p *AddServiceConcatArgs) writeField1(oprot thrift.TProtocol) (err error) {
939 if err := oprot.WriteFieldBegin("a", thrift.STRING, 1); err != nil {
940 return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err) }
941 if err := oprot.WriteString(string(p.A)); err != nil {
942 return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err) }
943 if err := oprot.WriteFieldEnd(); err != nil {
944 return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err) }
948 func (p *AddServiceConcatArgs) writeField2(oprot thrift.TProtocol) (err error) {
949 if err := oprot.WriteFieldBegin("b", thrift.STRING, 2); err != nil {
950 return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err) }
951 if err := oprot.WriteString(string(p.B)); err != nil {
952 return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err) }
953 if err := oprot.WriteFieldEnd(); err != nil {
954 return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err) }
958 func (p *AddServiceConcatArgs) String() string {
962 return fmt.Sprintf("AddServiceConcatArgs(%+v)", *p)
967 type AddServiceConcatResult struct {
968 Success *ConcatReply `thrift:"success,0" db:"success" json:"success,omitempty"`
971 func NewAddServiceConcatResult() *AddServiceConcatResult {
972 return &AddServiceConcatResult{}
975 var AddServiceConcatResult_Success_DEFAULT *ConcatReply
976 func (p *AddServiceConcatResult) GetSuccess() *ConcatReply {
977 if !p.IsSetSuccess() {
978 return AddServiceConcatResult_Success_DEFAULT
982 func (p *AddServiceConcatResult) IsSetSuccess() bool {
983 return p.Success != nil
986 func (p *AddServiceConcatResult) Read(iprot thrift.TProtocol) error {
987 if _, err := iprot.ReadStructBegin(); err != nil {
988 return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
993 _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
995 return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
997 if fieldTypeId == thrift.STOP { break; }
1000 if fieldTypeId == thrift.STRUCT {
1001 if err := p.ReadField0(iprot); err != nil {
1005 if err := iprot.Skip(fieldTypeId); err != nil {
1010 if err := iprot.Skip(fieldTypeId); err != nil {
1014 if err := iprot.ReadFieldEnd(); err != nil {
1018 if err := iprot.ReadStructEnd(); err != nil {
1019 return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
1024 func (p *AddServiceConcatResult) ReadField0(iprot thrift.TProtocol) error {
1025 p.Success = &ConcatReply{}
1026 if err := p.Success.Read(iprot); err != nil {
1027 return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
1032 func (p *AddServiceConcatResult) Write(oprot thrift.TProtocol) error {
1033 if err := oprot.WriteStructBegin("Concat_result"); err != nil {
1034 return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
1036 if err := p.writeField0(oprot); err != nil { return err }
1038 if err := oprot.WriteFieldStop(); err != nil {
1039 return thrift.PrependError("write field stop error: ", err) }
1040 if err := oprot.WriteStructEnd(); err != nil {
1041 return thrift.PrependError("write struct stop error: ", err) }
1045 func (p *AddServiceConcatResult) writeField0(oprot thrift.TProtocol) (err error) {
1046 if p.IsSetSuccess() {
1047 if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
1048 return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
1049 if err := p.Success.Write(oprot); err != nil {
1050 return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
1052 if err := oprot.WriteFieldEnd(); err != nil {
1053 return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
1058 func (p *AddServiceConcatResult) String() string {
1062 return fmt.Sprintf("AddServiceConcatResult(%+v)", *p)