0 | |
// Autogenerated by Thrift Compiler (1.0.0-dev)
|
1 | |
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
0 |
// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
|
2 | 1 |
|
3 | 2 |
package addsvc
|
4 | 3 |
|
5 | 4 |
import (
|
6 | 5 |
"bytes"
|
7 | 6 |
"context"
|
8 | |
"reflect"
|
9 | 7 |
"fmt"
|
10 | 8 |
"github.com/apache/thrift/lib/go/thrift"
|
|
9 |
"time"
|
11 | 10 |
)
|
12 | 11 |
|
13 | 12 |
// (needed to ensure safety because of naive import list construction.)
|
14 | 13 |
var _ = thrift.ZERO
|
15 | 14 |
var _ = fmt.Printf
|
16 | 15 |
var _ = context.Background
|
17 | |
var _ = reflect.DeepEqual
|
|
16 |
var _ = time.Now
|
18 | 17 |
var _ = bytes.Equal
|
19 | 18 |
|
20 | 19 |
// Attributes:
|
21 | 20 |
// - Value
|
22 | 21 |
// - Err
|
23 | 22 |
type SumReply struct {
|
24 | |
Value int64 `thrift:"value,1" db:"value" json:"value"`
|
25 | |
Err string `thrift:"err,2" db:"err" json:"err"`
|
|
23 |
Value int64 `thrift:"value,1" db:"value" json:"value"`
|
|
24 |
Err string `thrift:"err,2" db:"err" json:"err"`
|
26 | 25 |
}
|
27 | 26 |
|
28 | 27 |
func NewSumReply() *SumReply {
|
29 | |
return &SumReply{}
|
30 | |
}
|
31 | |
|
|
28 |
return &SumReply{}
|
|
29 |
}
|
32 | 30 |
|
33 | 31 |
func (p *SumReply) GetValue() int64 {
|
34 | |
return p.Value
|
|
32 |
return p.Value
|
35 | 33 |
}
|
36 | 34 |
|
37 | 35 |
func (p *SumReply) GetErr() string {
|
38 | |
return p.Err
|
39 | |
}
|
40 | |
func (p *SumReply) Read(iprot thrift.TProtocol) error {
|
41 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
42 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
43 | |
}
|
44 | |
|
45 | |
|
46 | |
for {
|
47 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
48 | |
if err != nil {
|
49 | |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
50 | |
}
|
51 | |
if fieldTypeId == thrift.STOP { break; }
|
52 | |
switch fieldId {
|
53 | |
case 1:
|
54 | |
if fieldTypeId == thrift.I64 {
|
55 | |
if err := p.ReadField1(iprot); err != nil {
|
56 | |
return err
|
57 | |
}
|
58 | |
} else {
|
59 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
60 | |
return err
|
61 | |
}
|
62 | |
}
|
63 | |
case 2:
|
64 | |
if fieldTypeId == thrift.STRING {
|
65 | |
if err := p.ReadField2(iprot); err != nil {
|
66 | |
return err
|
67 | |
}
|
68 | |
} else {
|
69 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
70 | |
return err
|
71 | |
}
|
72 | |
}
|
73 | |
default:
|
74 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
75 | |
return err
|
76 | |
}
|
77 | |
}
|
78 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
79 | |
return err
|
80 | |
}
|
81 | |
}
|
82 | |
if err := iprot.ReadStructEnd(); err != nil {
|
83 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
84 | |
}
|
85 | |
return nil
|
86 | |
}
|
87 | |
|
88 | |
func (p *SumReply) ReadField1(iprot thrift.TProtocol) error {
|
89 | |
if v, err := iprot.ReadI64(); err != nil {
|
90 | |
return thrift.PrependError("error reading field 1: ", err)
|
91 | |
} else {
|
92 | |
p.Value = v
|
93 | |
}
|
94 | |
return nil
|
95 | |
}
|
96 | |
|
97 | |
func (p *SumReply) ReadField2(iprot thrift.TProtocol) error {
|
98 | |
if v, err := iprot.ReadString(); err != nil {
|
99 | |
return thrift.PrependError("error reading field 2: ", err)
|
100 | |
} else {
|
101 | |
p.Err = v
|
102 | |
}
|
103 | |
return nil
|
104 | |
}
|
105 | |
|
106 | |
func (p *SumReply) Write(oprot thrift.TProtocol) error {
|
107 | |
if err := oprot.WriteStructBegin("SumReply"); err != nil {
|
108 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
109 | |
if p != nil {
|
110 | |
if err := p.writeField1(oprot); err != nil { return err }
|
111 | |
if err := p.writeField2(oprot); err != nil { return err }
|
112 | |
}
|
113 | |
if err := oprot.WriteFieldStop(); err != nil {
|
114 | |
return thrift.PrependError("write field stop error: ", err) }
|
115 | |
if err := oprot.WriteStructEnd(); err != nil {
|
116 | |
return thrift.PrependError("write struct stop error: ", err) }
|
117 | |
return nil
|
118 | |
}
|
119 | |
|
120 | |
func (p *SumReply) writeField1(oprot thrift.TProtocol) (err error) {
|
121 | |
if err := oprot.WriteFieldBegin("value", thrift.I64, 1); err != nil {
|
122 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
|
123 | |
if err := oprot.WriteI64(int64(p.Value)); err != nil {
|
124 | |
return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
|
125 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
126 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
|
127 | |
return err
|
128 | |
}
|
129 | |
|
130 | |
func (p *SumReply) writeField2(oprot thrift.TProtocol) (err error) {
|
131 | |
if err := oprot.WriteFieldBegin("err", thrift.STRING, 2); err != nil {
|
132 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err) }
|
133 | |
if err := oprot.WriteString(string(p.Err)); err != nil {
|
134 | |
return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err) }
|
135 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
136 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err) }
|
137 | |
return err
|
|
36 |
return p.Err
|
|
37 |
}
|
|
38 |
func (p *SumReply) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
39 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
40 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
41 |
}
|
|
42 |
|
|
43 |
for {
|
|
44 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
45 |
if err != nil {
|
|
46 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
47 |
}
|
|
48 |
if fieldTypeId == thrift.STOP {
|
|
49 |
break
|
|
50 |
}
|
|
51 |
switch fieldId {
|
|
52 |
case 1:
|
|
53 |
if fieldTypeId == thrift.I64 {
|
|
54 |
if err := p.ReadField1(ctx, iprot); err != nil {
|
|
55 |
return err
|
|
56 |
}
|
|
57 |
} else {
|
|
58 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
59 |
return err
|
|
60 |
}
|
|
61 |
}
|
|
62 |
case 2:
|
|
63 |
if fieldTypeId == thrift.STRING {
|
|
64 |
if err := p.ReadField2(ctx, iprot); err != nil {
|
|
65 |
return err
|
|
66 |
}
|
|
67 |
} else {
|
|
68 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
69 |
return err
|
|
70 |
}
|
|
71 |
}
|
|
72 |
default:
|
|
73 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
74 |
return err
|
|
75 |
}
|
|
76 |
}
|
|
77 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
78 |
return err
|
|
79 |
}
|
|
80 |
}
|
|
81 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
82 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
83 |
}
|
|
84 |
return nil
|
|
85 |
}
|
|
86 |
|
|
87 |
func (p *SumReply) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
|
|
88 |
if v, err := iprot.ReadI64(ctx); err != nil {
|
|
89 |
return thrift.PrependError("error reading field 1: ", err)
|
|
90 |
} else {
|
|
91 |
p.Value = v
|
|
92 |
}
|
|
93 |
return nil
|
|
94 |
}
|
|
95 |
|
|
96 |
func (p *SumReply) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
|
|
97 |
if v, err := iprot.ReadString(ctx); err != nil {
|
|
98 |
return thrift.PrependError("error reading field 2: ", err)
|
|
99 |
} else {
|
|
100 |
p.Err = v
|
|
101 |
}
|
|
102 |
return nil
|
|
103 |
}
|
|
104 |
|
|
105 |
func (p *SumReply) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
106 |
if err := oprot.WriteStructBegin(ctx, "SumReply"); err != nil {
|
|
107 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
108 |
}
|
|
109 |
if p != nil {
|
|
110 |
if err := p.writeField1(ctx, oprot); err != nil {
|
|
111 |
return err
|
|
112 |
}
|
|
113 |
if err := p.writeField2(ctx, oprot); err != nil {
|
|
114 |
return err
|
|
115 |
}
|
|
116 |
}
|
|
117 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
118 |
return thrift.PrependError("write field stop error: ", err)
|
|
119 |
}
|
|
120 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
121 |
return thrift.PrependError("write struct stop error: ", err)
|
|
122 |
}
|
|
123 |
return nil
|
|
124 |
}
|
|
125 |
|
|
126 |
func (p *SumReply) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
127 |
if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil {
|
|
128 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
|
|
129 |
}
|
|
130 |
if err := oprot.WriteI64(ctx, int64(p.Value)); err != nil {
|
|
131 |
return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err)
|
|
132 |
}
|
|
133 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
134 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
|
|
135 |
}
|
|
136 |
return err
|
|
137 |
}
|
|
138 |
|
|
139 |
func (p *SumReply) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
140 |
if err := oprot.WriteFieldBegin(ctx, "err", thrift.STRING, 2); err != nil {
|
|
141 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err)
|
|
142 |
}
|
|
143 |
if err := oprot.WriteString(ctx, string(p.Err)); err != nil {
|
|
144 |
return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err)
|
|
145 |
}
|
|
146 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
147 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err)
|
|
148 |
}
|
|
149 |
return err
|
|
150 |
}
|
|
151 |
|
|
152 |
func (p *SumReply) Equals(other *SumReply) bool {
|
|
153 |
if p == other {
|
|
154 |
return true
|
|
155 |
} else if p == nil || other == nil {
|
|
156 |
return false
|
|
157 |
}
|
|
158 |
if p.Value != other.Value {
|
|
159 |
return false
|
|
160 |
}
|
|
161 |
if p.Err != other.Err {
|
|
162 |
return false
|
|
163 |
}
|
|
164 |
return true
|
138 | 165 |
}
|
139 | 166 |
|
140 | 167 |
func (p *SumReply) String() string {
|
141 | |
if p == nil {
|
142 | |
return "<nil>"
|
143 | |
}
|
144 | |
return fmt.Sprintf("SumReply(%+v)", *p)
|
|
168 |
if p == nil {
|
|
169 |
return "<nil>"
|
|
170 |
}
|
|
171 |
return fmt.Sprintf("SumReply(%+v)", *p)
|
145 | 172 |
}
|
146 | 173 |
|
147 | 174 |
// Attributes:
|
148 | 175 |
// - Value
|
149 | 176 |
// - Err
|
150 | 177 |
type ConcatReply struct {
|
151 | |
Value string `thrift:"value,1" db:"value" json:"value"`
|
152 | |
Err string `thrift:"err,2" db:"err" json:"err"`
|
|
178 |
Value string `thrift:"value,1" db:"value" json:"value"`
|
|
179 |
Err string `thrift:"err,2" db:"err" json:"err"`
|
153 | 180 |
}
|
154 | 181 |
|
155 | 182 |
func NewConcatReply() *ConcatReply {
|
156 | |
return &ConcatReply{}
|
157 | |
}
|
158 | |
|
|
183 |
return &ConcatReply{}
|
|
184 |
}
|
159 | 185 |
|
160 | 186 |
func (p *ConcatReply) GetValue() string {
|
161 | |
return p.Value
|
|
187 |
return p.Value
|
162 | 188 |
}
|
163 | 189 |
|
164 | 190 |
func (p *ConcatReply) GetErr() string {
|
165 | |
return p.Err
|
166 | |
}
|
167 | |
func (p *ConcatReply) Read(iprot thrift.TProtocol) error {
|
168 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
169 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
170 | |
}
|
171 | |
|
172 | |
|
173 | |
for {
|
174 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
175 | |
if err != nil {
|
176 | |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
177 | |
}
|
178 | |
if fieldTypeId == thrift.STOP { break; }
|
179 | |
switch fieldId {
|
180 | |
case 1:
|
181 | |
if fieldTypeId == thrift.STRING {
|
182 | |
if err := p.ReadField1(iprot); err != nil {
|
183 | |
return err
|
184 | |
}
|
185 | |
} else {
|
186 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
187 | |
return err
|
188 | |
}
|
189 | |
}
|
190 | |
case 2:
|
191 | |
if fieldTypeId == thrift.STRING {
|
192 | |
if err := p.ReadField2(iprot); err != nil {
|
193 | |
return err
|
194 | |
}
|
195 | |
} else {
|
196 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
197 | |
return err
|
198 | |
}
|
199 | |
}
|
200 | |
default:
|
201 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
202 | |
return err
|
203 | |
}
|
204 | |
}
|
205 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
206 | |
return err
|
207 | |
}
|
208 | |
}
|
209 | |
if err := iprot.ReadStructEnd(); err != nil {
|
210 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
211 | |
}
|
212 | |
return nil
|
213 | |
}
|
214 | |
|
215 | |
func (p *ConcatReply) ReadField1(iprot thrift.TProtocol) error {
|
216 | |
if v, err := iprot.ReadString(); err != nil {
|
217 | |
return thrift.PrependError("error reading field 1: ", err)
|
218 | |
} else {
|
219 | |
p.Value = v
|
220 | |
}
|
221 | |
return nil
|
222 | |
}
|
223 | |
|
224 | |
func (p *ConcatReply) ReadField2(iprot thrift.TProtocol) error {
|
225 | |
if v, err := iprot.ReadString(); err != nil {
|
226 | |
return thrift.PrependError("error reading field 2: ", err)
|
227 | |
} else {
|
228 | |
p.Err = v
|
229 | |
}
|
230 | |
return nil
|
231 | |
}
|
232 | |
|
233 | |
func (p *ConcatReply) Write(oprot thrift.TProtocol) error {
|
234 | |
if err := oprot.WriteStructBegin("ConcatReply"); err != nil {
|
235 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
236 | |
if p != nil {
|
237 | |
if err := p.writeField1(oprot); err != nil { return err }
|
238 | |
if err := p.writeField2(oprot); err != nil { return err }
|
239 | |
}
|
240 | |
if err := oprot.WriteFieldStop(); err != nil {
|
241 | |
return thrift.PrependError("write field stop error: ", err) }
|
242 | |
if err := oprot.WriteStructEnd(); err != nil {
|
243 | |
return thrift.PrependError("write struct stop error: ", err) }
|
244 | |
return nil
|
245 | |
}
|
246 | |
|
247 | |
func (p *ConcatReply) writeField1(oprot thrift.TProtocol) (err error) {
|
248 | |
if err := oprot.WriteFieldBegin("value", thrift.STRING, 1); err != nil {
|
249 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) }
|
250 | |
if err := oprot.WriteString(string(p.Value)); err != nil {
|
251 | |
return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) }
|
252 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
253 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err) }
|
254 | |
return err
|
255 | |
}
|
256 | |
|
257 | |
func (p *ConcatReply) writeField2(oprot thrift.TProtocol) (err error) {
|
258 | |
if err := oprot.WriteFieldBegin("err", thrift.STRING, 2); err != nil {
|
259 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err) }
|
260 | |
if err := oprot.WriteString(string(p.Err)); err != nil {
|
261 | |
return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err) }
|
262 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
263 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err) }
|
264 | |
return err
|
|
191 |
return p.Err
|
|
192 |
}
|
|
193 |
func (p *ConcatReply) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
194 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
195 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
196 |
}
|
|
197 |
|
|
198 |
for {
|
|
199 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
200 |
if err != nil {
|
|
201 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
202 |
}
|
|
203 |
if fieldTypeId == thrift.STOP {
|
|
204 |
break
|
|
205 |
}
|
|
206 |
switch fieldId {
|
|
207 |
case 1:
|
|
208 |
if fieldTypeId == thrift.STRING {
|
|
209 |
if err := p.ReadField1(ctx, iprot); err != nil {
|
|
210 |
return err
|
|
211 |
}
|
|
212 |
} else {
|
|
213 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
214 |
return err
|
|
215 |
}
|
|
216 |
}
|
|
217 |
case 2:
|
|
218 |
if fieldTypeId == thrift.STRING {
|
|
219 |
if err := p.ReadField2(ctx, iprot); err != nil {
|
|
220 |
return err
|
|
221 |
}
|
|
222 |
} else {
|
|
223 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
224 |
return err
|
|
225 |
}
|
|
226 |
}
|
|
227 |
default:
|
|
228 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
229 |
return err
|
|
230 |
}
|
|
231 |
}
|
|
232 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
233 |
return err
|
|
234 |
}
|
|
235 |
}
|
|
236 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
237 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
238 |
}
|
|
239 |
return nil
|
|
240 |
}
|
|
241 |
|
|
242 |
func (p *ConcatReply) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
|
|
243 |
if v, err := iprot.ReadString(ctx); err != nil {
|
|
244 |
return thrift.PrependError("error reading field 1: ", err)
|
|
245 |
} else {
|
|
246 |
p.Value = v
|
|
247 |
}
|
|
248 |
return nil
|
|
249 |
}
|
|
250 |
|
|
251 |
func (p *ConcatReply) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
|
|
252 |
if v, err := iprot.ReadString(ctx); err != nil {
|
|
253 |
return thrift.PrependError("error reading field 2: ", err)
|
|
254 |
} else {
|
|
255 |
p.Err = v
|
|
256 |
}
|
|
257 |
return nil
|
|
258 |
}
|
|
259 |
|
|
260 |
func (p *ConcatReply) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
261 |
if err := oprot.WriteStructBegin(ctx, "ConcatReply"); err != nil {
|
|
262 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
263 |
}
|
|
264 |
if p != nil {
|
|
265 |
if err := p.writeField1(ctx, oprot); err != nil {
|
|
266 |
return err
|
|
267 |
}
|
|
268 |
if err := p.writeField2(ctx, oprot); err != nil {
|
|
269 |
return err
|
|
270 |
}
|
|
271 |
}
|
|
272 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
273 |
return thrift.PrependError("write field stop error: ", err)
|
|
274 |
}
|
|
275 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
276 |
return thrift.PrependError("write struct stop error: ", err)
|
|
277 |
}
|
|
278 |
return nil
|
|
279 |
}
|
|
280 |
|
|
281 |
func (p *ConcatReply) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
282 |
if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil {
|
|
283 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
|
|
284 |
}
|
|
285 |
if err := oprot.WriteString(ctx, string(p.Value)); err != nil {
|
|
286 |
return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err)
|
|
287 |
}
|
|
288 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
289 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
|
|
290 |
}
|
|
291 |
return err
|
|
292 |
}
|
|
293 |
|
|
294 |
func (p *ConcatReply) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
295 |
if err := oprot.WriteFieldBegin(ctx, "err", thrift.STRING, 2); err != nil {
|
|
296 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:err: ", p), err)
|
|
297 |
}
|
|
298 |
if err := oprot.WriteString(ctx, string(p.Err)); err != nil {
|
|
299 |
return thrift.PrependError(fmt.Sprintf("%T.err (2) field write error: ", p), err)
|
|
300 |
}
|
|
301 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
302 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:err: ", p), err)
|
|
303 |
}
|
|
304 |
return err
|
|
305 |
}
|
|
306 |
|
|
307 |
func (p *ConcatReply) Equals(other *ConcatReply) bool {
|
|
308 |
if p == other {
|
|
309 |
return true
|
|
310 |
} else if p == nil || other == nil {
|
|
311 |
return false
|
|
312 |
}
|
|
313 |
if p.Value != other.Value {
|
|
314 |
return false
|
|
315 |
}
|
|
316 |
if p.Err != other.Err {
|
|
317 |
return false
|
|
318 |
}
|
|
319 |
return true
|
265 | 320 |
}
|
266 | 321 |
|
267 | 322 |
func (p *ConcatReply) String() string {
|
268 | |
if p == nil {
|
269 | |
return "<nil>"
|
270 | |
}
|
271 | |
return fmt.Sprintf("ConcatReply(%+v)", *p)
|
|
323 |
if p == nil {
|
|
324 |
return "<nil>"
|
|
325 |
}
|
|
326 |
return fmt.Sprintf("ConcatReply(%+v)", *p)
|
272 | 327 |
}
|
273 | 328 |
|
274 | 329 |
type AddService interface {
|
275 | |
// Parameters:
|
276 | |
// - A
|
277 | |
// - B
|
278 | |
Sum(ctx context.Context, a int64, b int64) (r *SumReply, err error)
|
279 | |
// Parameters:
|
280 | |
// - A
|
281 | |
// - B
|
282 | |
Concat(ctx context.Context, a string, b string) (r *ConcatReply, err error)
|
|
330 |
// Parameters:
|
|
331 |
// - A
|
|
332 |
// - B
|
|
333 |
Sum(ctx context.Context, a int64, b int64) (_r *SumReply, _err error)
|
|
334 |
// Parameters:
|
|
335 |
// - A
|
|
336 |
// - B
|
|
337 |
Concat(ctx context.Context, a string, b string) (_r *ConcatReply, _err error)
|
283 | 338 |
}
|
284 | 339 |
|
285 | 340 |
type AddServiceClient struct {
|
286 | |
c thrift.TClient
|
|
341 |
c thrift.TClient
|
|
342 |
meta thrift.ResponseMeta
|
287 | 343 |
}
|
288 | 344 |
|
289 | 345 |
func NewAddServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *AddServiceClient {
|
290 | |
return &AddServiceClient{
|
291 | |
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
292 | |
}
|
|
346 |
return &AddServiceClient{
|
|
347 |
c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
|
|
348 |
}
|
293 | 349 |
}
|
294 | 350 |
|
295 | 351 |
func NewAddServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *AddServiceClient {
|
296 | |
return &AddServiceClient{
|
297 | |
c: thrift.NewTStandardClient(iprot, oprot),
|
298 | |
}
|
|
352 |
return &AddServiceClient{
|
|
353 |
c: thrift.NewTStandardClient(iprot, oprot),
|
|
354 |
}
|
299 | 355 |
}
|
300 | 356 |
|
301 | 357 |
func NewAddServiceClient(c thrift.TClient) *AddServiceClient {
|
302 | |
return &AddServiceClient{
|
303 | |
c: c,
|
304 | |
}
|
|
358 |
return &AddServiceClient{
|
|
359 |
c: c,
|
|
360 |
}
|
305 | 361 |
}
|
306 | 362 |
|
307 | 363 |
func (p *AddServiceClient) Client_() thrift.TClient {
|
308 | |
return p.c
|
309 | |
}
|
|
364 |
return p.c
|
|
365 |
}
|
|
366 |
|
|
367 |
func (p *AddServiceClient) LastResponseMeta_() thrift.ResponseMeta {
|
|
368 |
return p.meta
|
|
369 |
}
|
|
370 |
|
|
371 |
func (p *AddServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) {
|
|
372 |
p.meta = meta
|
|
373 |
}
|
|
374 |
|
310 | 375 |
// Parameters:
|
311 | 376 |
// - A
|
312 | 377 |
// - B
|
313 | |
func (p *AddServiceClient) Sum(ctx context.Context, a int64, b int64) (r *SumReply, err error) {
|
314 | |
var _args0 AddServiceSumArgs
|
315 | |
_args0.A = a
|
316 | |
_args0.B = b
|
317 | |
var _result1 AddServiceSumResult
|
318 | |
if err = p.Client_().Call(ctx, "Sum", &_args0, &_result1); err != nil {
|
319 | |
return
|
320 | |
}
|
321 | |
return _result1.GetSuccess(), nil
|
|
378 |
func (p *AddServiceClient) Sum(ctx context.Context, a int64, b int64) (_r *SumReply, _err error) {
|
|
379 |
var _args0 AddServiceSumArgs
|
|
380 |
_args0.A = a
|
|
381 |
_args0.B = b
|
|
382 |
var _result2 AddServiceSumResult
|
|
383 |
var _meta1 thrift.ResponseMeta
|
|
384 |
_meta1, _err = p.Client_().Call(ctx, "Sum", &_args0, &_result2)
|
|
385 |
p.SetLastResponseMeta_(_meta1)
|
|
386 |
if _err != nil {
|
|
387 |
return
|
|
388 |
}
|
|
389 |
return _result2.GetSuccess(), nil
|
322 | 390 |
}
|
323 | 391 |
|
324 | 392 |
// Parameters:
|
325 | 393 |
// - A
|
326 | 394 |
// - B
|
327 | |
func (p *AddServiceClient) Concat(ctx context.Context, a string, b string) (r *ConcatReply, err error) {
|
328 | |
var _args2 AddServiceConcatArgs
|
329 | |
_args2.A = a
|
330 | |
_args2.B = b
|
331 | |
var _result3 AddServiceConcatResult
|
332 | |
if err = p.Client_().Call(ctx, "Concat", &_args2, &_result3); err != nil {
|
333 | |
return
|
334 | |
}
|
335 | |
return _result3.GetSuccess(), nil
|
|
395 |
func (p *AddServiceClient) Concat(ctx context.Context, a string, b string) (_r *ConcatReply, _err error) {
|
|
396 |
var _args3 AddServiceConcatArgs
|
|
397 |
_args3.A = a
|
|
398 |
_args3.B = b
|
|
399 |
var _result5 AddServiceConcatResult
|
|
400 |
var _meta4 thrift.ResponseMeta
|
|
401 |
_meta4, _err = p.Client_().Call(ctx, "Concat", &_args3, &_result5)
|
|
402 |
p.SetLastResponseMeta_(_meta4)
|
|
403 |
if _err != nil {
|
|
404 |
return
|
|
405 |
}
|
|
406 |
return _result5.GetSuccess(), nil
|
336 | 407 |
}
|
337 | 408 |
|
338 | 409 |
type AddServiceProcessor struct {
|
339 | |
processorMap map[string]thrift.TProcessorFunction
|
340 | |
handler AddService
|
|
410 |
processorMap map[string]thrift.TProcessorFunction
|
|
411 |
handler AddService
|
341 | 412 |
}
|
342 | 413 |
|
343 | 414 |
func (p *AddServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
|
344 | |
p.processorMap[key] = processor
|
|
415 |
p.processorMap[key] = processor
|
345 | 416 |
}
|
346 | 417 |
|
347 | 418 |
func (p *AddServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
|
348 | |
processor, ok = p.processorMap[key]
|
349 | |
return processor, ok
|
|
419 |
processor, ok = p.processorMap[key]
|
|
420 |
return processor, ok
|
350 | 421 |
}
|
351 | 422 |
|
352 | 423 |
func (p *AddServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
|
353 | |
return p.processorMap
|
|
424 |
return p.processorMap
|
354 | 425 |
}
|
355 | 426 |
|
356 | 427 |
func NewAddServiceProcessor(handler AddService) *AddServiceProcessor {
|
357 | 428 |
|
358 | |
self4 := &AddServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)}
|
359 | |
self4.processorMap["Sum"] = &addServiceProcessorSum{handler:handler}
|
360 | |
self4.processorMap["Concat"] = &addServiceProcessorConcat{handler:handler}
|
361 | |
return self4
|
|
429 |
self6 := &AddServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
|
|
430 |
self6.processorMap["Sum"] = &addServiceProcessorSum{handler: handler}
|
|
431 |
self6.processorMap["Concat"] = &addServiceProcessorConcat{handler: handler}
|
|
432 |
return self6
|
362 | 433 |
}
|
363 | 434 |
|
364 | 435 |
func (p *AddServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
365 | |
name, _, seqId, err := iprot.ReadMessageBegin()
|
366 | |
if err != nil { return false, err }
|
367 | |
if processor, ok := p.GetProcessorFunction(name); ok {
|
368 | |
return processor.Process(ctx, seqId, iprot, oprot)
|
369 | |
}
|
370 | |
iprot.Skip(thrift.STRUCT)
|
371 | |
iprot.ReadMessageEnd()
|
372 | |
x5 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name)
|
373 | |
oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
|
374 | |
x5.Write(oprot)
|
375 | |
oprot.WriteMessageEnd()
|
376 | |
oprot.Flush(ctx)
|
377 | |
return false, x5
|
|
436 |
name, _, seqId, err2 := iprot.ReadMessageBegin(ctx)
|
|
437 |
if err2 != nil {
|
|
438 |
return false, thrift.WrapTException(err2)
|
|
439 |
}
|
|
440 |
if processor, ok := p.GetProcessorFunction(name); ok {
|
|
441 |
return processor.Process(ctx, seqId, iprot, oprot)
|
|
442 |
}
|
|
443 |
iprot.Skip(ctx, thrift.STRUCT)
|
|
444 |
iprot.ReadMessageEnd(ctx)
|
|
445 |
x7 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
|
|
446 |
oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId)
|
|
447 |
x7.Write(ctx, oprot)
|
|
448 |
oprot.WriteMessageEnd(ctx)
|
|
449 |
oprot.Flush(ctx)
|
|
450 |
return false, x7
|
378 | 451 |
|
379 | 452 |
}
|
380 | 453 |
|
381 | 454 |
type addServiceProcessorSum struct {
|
382 | |
handler AddService
|
|
455 |
handler AddService
|
383 | 456 |
}
|
384 | 457 |
|
385 | 458 |
func (p *addServiceProcessorSum) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
386 | |
args := AddServiceSumArgs{}
|
387 | |
if err = args.Read(iprot); err != nil {
|
388 | |
iprot.ReadMessageEnd()
|
389 | |
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
390 | |
oprot.WriteMessageBegin("Sum", thrift.EXCEPTION, seqId)
|
391 | |
x.Write(oprot)
|
392 | |
oprot.WriteMessageEnd()
|
393 | |
oprot.Flush(ctx)
|
394 | |
return false, err
|
395 | |
}
|
396 | |
|
397 | |
iprot.ReadMessageEnd()
|
398 | |
result := AddServiceSumResult{}
|
399 | |
var retval *SumReply
|
400 | |
var err2 error
|
401 | |
if retval, err2 = p.handler.Sum(ctx, args.A, args.B); err2 != nil {
|
402 | |
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Sum: " + err2.Error())
|
403 | |
oprot.WriteMessageBegin("Sum", thrift.EXCEPTION, seqId)
|
404 | |
x.Write(oprot)
|
405 | |
oprot.WriteMessageEnd()
|
406 | |
oprot.Flush(ctx)
|
407 | |
return true, err2
|
408 | |
} else {
|
409 | |
result.Success = retval
|
410 | |
}
|
411 | |
if err2 = oprot.WriteMessageBegin("Sum", thrift.REPLY, seqId); err2 != nil {
|
412 | |
err = err2
|
413 | |
}
|
414 | |
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
415 | |
err = err2
|
416 | |
}
|
417 | |
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
418 | |
err = err2
|
419 | |
}
|
420 | |
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
421 | |
err = err2
|
422 | |
}
|
423 | |
if err != nil {
|
424 | |
return
|
425 | |
}
|
426 | |
return true, err
|
|
459 |
args := AddServiceSumArgs{}
|
|
460 |
var err2 error
|
|
461 |
if err2 = args.Read(ctx, iprot); err2 != nil {
|
|
462 |
iprot.ReadMessageEnd(ctx)
|
|
463 |
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
|
|
464 |
oprot.WriteMessageBegin(ctx, "Sum", thrift.EXCEPTION, seqId)
|
|
465 |
x.Write(ctx, oprot)
|
|
466 |
oprot.WriteMessageEnd(ctx)
|
|
467 |
oprot.Flush(ctx)
|
|
468 |
return false, thrift.WrapTException(err2)
|
|
469 |
}
|
|
470 |
iprot.ReadMessageEnd(ctx)
|
|
471 |
|
|
472 |
tickerCancel := func() {}
|
|
473 |
// Start a goroutine to do server side connectivity check.
|
|
474 |
if thrift.ServerConnectivityCheckInterval > 0 {
|
|
475 |
var cancel context.CancelFunc
|
|
476 |
ctx, cancel = context.WithCancel(ctx)
|
|
477 |
defer cancel()
|
|
478 |
var tickerCtx context.Context
|
|
479 |
tickerCtx, tickerCancel = context.WithCancel(context.Background())
|
|
480 |
defer tickerCancel()
|
|
481 |
go func(ctx context.Context, cancel context.CancelFunc) {
|
|
482 |
ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
|
|
483 |
defer ticker.Stop()
|
|
484 |
for {
|
|
485 |
select {
|
|
486 |
case <-ctx.Done():
|
|
487 |
return
|
|
488 |
case <-ticker.C:
|
|
489 |
if !iprot.Transport().IsOpen() {
|
|
490 |
cancel()
|
|
491 |
return
|
|
492 |
}
|
|
493 |
}
|
|
494 |
}
|
|
495 |
}(tickerCtx, cancel)
|
|
496 |
}
|
|
497 |
|
|
498 |
result := AddServiceSumResult{}
|
|
499 |
var retval *SumReply
|
|
500 |
if retval, err2 = p.handler.Sum(ctx, args.A, args.B); err2 != nil {
|
|
501 |
tickerCancel()
|
|
502 |
if err2 == thrift.ErrAbandonRequest {
|
|
503 |
return false, thrift.WrapTException(err2)
|
|
504 |
}
|
|
505 |
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Sum: "+err2.Error())
|
|
506 |
oprot.WriteMessageBegin(ctx, "Sum", thrift.EXCEPTION, seqId)
|
|
507 |
x.Write(ctx, oprot)
|
|
508 |
oprot.WriteMessageEnd(ctx)
|
|
509 |
oprot.Flush(ctx)
|
|
510 |
return true, thrift.WrapTException(err2)
|
|
511 |
} else {
|
|
512 |
result.Success = retval
|
|
513 |
}
|
|
514 |
tickerCancel()
|
|
515 |
if err2 = oprot.WriteMessageBegin(ctx, "Sum", thrift.REPLY, seqId); err2 != nil {
|
|
516 |
err = thrift.WrapTException(err2)
|
|
517 |
}
|
|
518 |
if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
|
|
519 |
err = thrift.WrapTException(err2)
|
|
520 |
}
|
|
521 |
if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
|
|
522 |
err = thrift.WrapTException(err2)
|
|
523 |
}
|
|
524 |
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
525 |
err = thrift.WrapTException(err2)
|
|
526 |
}
|
|
527 |
if err != nil {
|
|
528 |
return
|
|
529 |
}
|
|
530 |
return true, err
|
427 | 531 |
}
|
428 | 532 |
|
429 | 533 |
type addServiceProcessorConcat struct {
|
430 | |
handler AddService
|
|
534 |
handler AddService
|
431 | 535 |
}
|
432 | 536 |
|
433 | 537 |
func (p *addServiceProcessorConcat) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
|
434 | |
args := AddServiceConcatArgs{}
|
435 | |
if err = args.Read(iprot); err != nil {
|
436 | |
iprot.ReadMessageEnd()
|
437 | |
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
|
438 | |
oprot.WriteMessageBegin("Concat", thrift.EXCEPTION, seqId)
|
439 | |
x.Write(oprot)
|
440 | |
oprot.WriteMessageEnd()
|
441 | |
oprot.Flush(ctx)
|
442 | |
return false, err
|
443 | |
}
|
444 | |
|
445 | |
iprot.ReadMessageEnd()
|
446 | |
result := AddServiceConcatResult{}
|
447 | |
var retval *ConcatReply
|
448 | |
var err2 error
|
449 | |
if retval, err2 = p.handler.Concat(ctx, args.A, args.B); err2 != nil {
|
450 | |
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Concat: " + err2.Error())
|
451 | |
oprot.WriteMessageBegin("Concat", thrift.EXCEPTION, seqId)
|
452 | |
x.Write(oprot)
|
453 | |
oprot.WriteMessageEnd()
|
454 | |
oprot.Flush(ctx)
|
455 | |
return true, err2
|
456 | |
} else {
|
457 | |
result.Success = retval
|
458 | |
}
|
459 | |
if err2 = oprot.WriteMessageBegin("Concat", thrift.REPLY, seqId); err2 != nil {
|
460 | |
err = err2
|
461 | |
}
|
462 | |
if err2 = result.Write(oprot); err == nil && err2 != nil {
|
463 | |
err = err2
|
464 | |
}
|
465 | |
if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
|
466 | |
err = err2
|
467 | |
}
|
468 | |
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
469 | |
err = err2
|
470 | |
}
|
471 | |
if err != nil {
|
472 | |
return
|
473 | |
}
|
474 | |
return true, err
|
475 | |
}
|
476 | |
|
|
538 |
args := AddServiceConcatArgs{}
|
|
539 |
var err2 error
|
|
540 |
if err2 = args.Read(ctx, iprot); err2 != nil {
|
|
541 |
iprot.ReadMessageEnd(ctx)
|
|
542 |
x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error())
|
|
543 |
oprot.WriteMessageBegin(ctx, "Concat", thrift.EXCEPTION, seqId)
|
|
544 |
x.Write(ctx, oprot)
|
|
545 |
oprot.WriteMessageEnd(ctx)
|
|
546 |
oprot.Flush(ctx)
|
|
547 |
return false, thrift.WrapTException(err2)
|
|
548 |
}
|
|
549 |
iprot.ReadMessageEnd(ctx)
|
|
550 |
|
|
551 |
tickerCancel := func() {}
|
|
552 |
// Start a goroutine to do server side connectivity check.
|
|
553 |
if thrift.ServerConnectivityCheckInterval > 0 {
|
|
554 |
var cancel context.CancelFunc
|
|
555 |
ctx, cancel = context.WithCancel(ctx)
|
|
556 |
defer cancel()
|
|
557 |
var tickerCtx context.Context
|
|
558 |
tickerCtx, tickerCancel = context.WithCancel(context.Background())
|
|
559 |
defer tickerCancel()
|
|
560 |
go func(ctx context.Context, cancel context.CancelFunc) {
|
|
561 |
ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
|
|
562 |
defer ticker.Stop()
|
|
563 |
for {
|
|
564 |
select {
|
|
565 |
case <-ctx.Done():
|
|
566 |
return
|
|
567 |
case <-ticker.C:
|
|
568 |
if !iprot.Transport().IsOpen() {
|
|
569 |
cancel()
|
|
570 |
return
|
|
571 |
}
|
|
572 |
}
|
|
573 |
}
|
|
574 |
}(tickerCtx, cancel)
|
|
575 |
}
|
|
576 |
|
|
577 |
result := AddServiceConcatResult{}
|
|
578 |
var retval *ConcatReply
|
|
579 |
if retval, err2 = p.handler.Concat(ctx, args.A, args.B); err2 != nil {
|
|
580 |
tickerCancel()
|
|
581 |
if err2 == thrift.ErrAbandonRequest {
|
|
582 |
return false, thrift.WrapTException(err2)
|
|
583 |
}
|
|
584 |
x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing Concat: "+err2.Error())
|
|
585 |
oprot.WriteMessageBegin(ctx, "Concat", thrift.EXCEPTION, seqId)
|
|
586 |
x.Write(ctx, oprot)
|
|
587 |
oprot.WriteMessageEnd(ctx)
|
|
588 |
oprot.Flush(ctx)
|
|
589 |
return true, thrift.WrapTException(err2)
|
|
590 |
} else {
|
|
591 |
result.Success = retval
|
|
592 |
}
|
|
593 |
tickerCancel()
|
|
594 |
if err2 = oprot.WriteMessageBegin(ctx, "Concat", thrift.REPLY, seqId); err2 != nil {
|
|
595 |
err = thrift.WrapTException(err2)
|
|
596 |
}
|
|
597 |
if err2 = result.Write(ctx, oprot); err == nil && err2 != nil {
|
|
598 |
err = thrift.WrapTException(err2)
|
|
599 |
}
|
|
600 |
if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil {
|
|
601 |
err = thrift.WrapTException(err2)
|
|
602 |
}
|
|
603 |
if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
|
|
604 |
err = thrift.WrapTException(err2)
|
|
605 |
}
|
|
606 |
if err != nil {
|
|
607 |
return
|
|
608 |
}
|
|
609 |
return true, err
|
|
610 |
}
|
477 | 611 |
|
478 | 612 |
// HELPER FUNCTIONS AND STRUCTURES
|
479 | 613 |
|
|
481 | 615 |
// - A
|
482 | 616 |
// - B
|
483 | 617 |
type AddServiceSumArgs struct {
|
484 | |
A int64 `thrift:"a,1" db:"a" json:"a"`
|
485 | |
B int64 `thrift:"b,2" db:"b" json:"b"`
|
|
618 |
A int64 `thrift:"a,1" db:"a" json:"a"`
|
|
619 |
B int64 `thrift:"b,2" db:"b" json:"b"`
|
486 | 620 |
}
|
487 | 621 |
|
488 | 622 |
func NewAddServiceSumArgs() *AddServiceSumArgs {
|
489 | |
return &AddServiceSumArgs{}
|
490 | |
}
|
491 | |
|
|
623 |
return &AddServiceSumArgs{}
|
|
624 |
}
|
492 | 625 |
|
493 | 626 |
func (p *AddServiceSumArgs) GetA() int64 {
|
494 | |
return p.A
|
|
627 |
return p.A
|
495 | 628 |
}
|
496 | 629 |
|
497 | 630 |
func (p *AddServiceSumArgs) GetB() int64 {
|
498 | |
return p.B
|
499 | |
}
|
500 | |
func (p *AddServiceSumArgs) Read(iprot thrift.TProtocol) error {
|
501 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
502 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
503 | |
}
|
504 | |
|
505 | |
|
506 | |
for {
|
507 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
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(iprot); err != nil {
|
516 | |
return err
|
517 | |
}
|
518 | |
} else {
|
519 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
520 | |
return err
|
521 | |
}
|
522 | |
}
|
523 | |
case 2:
|
524 | |
if fieldTypeId == thrift.I64 {
|
525 | |
if err := p.ReadField2(iprot); err != nil {
|
526 | |
return err
|
527 | |
}
|
528 | |
} else {
|
529 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
530 | |
return err
|
531 | |
}
|
532 | |
}
|
533 | |
default:
|
534 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
535 | |
return err
|
536 | |
}
|
537 | |
}
|
538 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
539 | |
return err
|
540 | |
}
|
541 | |
}
|
542 | |
if err := iprot.ReadStructEnd(); err != nil {
|
543 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
544 | |
}
|
545 | |
return nil
|
546 | |
}
|
547 | |
|
548 | |
func (p *AddServiceSumArgs) ReadField1(iprot thrift.TProtocol) error {
|
549 | |
if v, err := iprot.ReadI64(); err != nil {
|
550 | |
return thrift.PrependError("error reading field 1: ", err)
|
551 | |
} else {
|
552 | |
p.A = v
|
553 | |
}
|
554 | |
return nil
|
555 | |
}
|
556 | |
|
557 | |
func (p *AddServiceSumArgs) ReadField2(iprot thrift.TProtocol) error {
|
558 | |
if v, err := iprot.ReadI64(); err != nil {
|
559 | |
return thrift.PrependError("error reading field 2: ", err)
|
560 | |
} else {
|
561 | |
p.B = v
|
562 | |
}
|
563 | |
return nil
|
564 | |
}
|
565 | |
|
566 | |
func (p *AddServiceSumArgs) Write(oprot thrift.TProtocol) error {
|
567 | |
if err := oprot.WriteStructBegin("Sum_args"); err != nil {
|
568 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
569 | |
if p != nil {
|
570 | |
if err := p.writeField1(oprot); err != nil { return err }
|
571 | |
if err := p.writeField2(oprot); err != nil { return err }
|
572 | |
}
|
573 | |
if err := oprot.WriteFieldStop(); err != nil {
|
574 | |
return thrift.PrependError("write field stop error: ", err) }
|
575 | |
if err := oprot.WriteStructEnd(); err != nil {
|
576 | |
return thrift.PrependError("write struct stop error: ", err) }
|
577 | |
return nil
|
578 | |
}
|
579 | |
|
580 | |
func (p *AddServiceSumArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
581 | |
if err := oprot.WriteFieldBegin("a", thrift.I64, 1); err != nil {
|
582 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err) }
|
583 | |
if err := oprot.WriteI64(int64(p.A)); err != nil {
|
584 | |
return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err) }
|
585 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
586 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err) }
|
587 | |
return err
|
588 | |
}
|
589 | |
|
590 | |
func (p *AddServiceSumArgs) writeField2(oprot thrift.TProtocol) (err error) {
|
591 | |
if err := oprot.WriteFieldBegin("b", thrift.I64, 2); err != nil {
|
592 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err) }
|
593 | |
if err := oprot.WriteI64(int64(p.B)); err != nil {
|
594 | |
return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err) }
|
595 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
596 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err) }
|
597 | |
return err
|
|
631 |
return p.B
|
|
632 |
}
|
|
633 |
func (p *AddServiceSumArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
634 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
635 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
636 |
}
|
|
637 |
|
|
638 |
for {
|
|
639 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
640 |
if err != nil {
|
|
641 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
642 |
}
|
|
643 |
if fieldTypeId == thrift.STOP {
|
|
644 |
break
|
|
645 |
}
|
|
646 |
switch fieldId {
|
|
647 |
case 1:
|
|
648 |
if fieldTypeId == thrift.I64 {
|
|
649 |
if err := p.ReadField1(ctx, iprot); err != nil {
|
|
650 |
return err
|
|
651 |
}
|
|
652 |
} else {
|
|
653 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
654 |
return err
|
|
655 |
}
|
|
656 |
}
|
|
657 |
case 2:
|
|
658 |
if fieldTypeId == thrift.I64 {
|
|
659 |
if err := p.ReadField2(ctx, iprot); err != nil {
|
|
660 |
return err
|
|
661 |
}
|
|
662 |
} else {
|
|
663 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
664 |
return err
|
|
665 |
}
|
|
666 |
}
|
|
667 |
default:
|
|
668 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
669 |
return err
|
|
670 |
}
|
|
671 |
}
|
|
672 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
673 |
return err
|
|
674 |
}
|
|
675 |
}
|
|
676 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
677 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
678 |
}
|
|
679 |
return nil
|
|
680 |
}
|
|
681 |
|
|
682 |
func (p *AddServiceSumArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
|
|
683 |
if v, err := iprot.ReadI64(ctx); err != nil {
|
|
684 |
return thrift.PrependError("error reading field 1: ", err)
|
|
685 |
} else {
|
|
686 |
p.A = v
|
|
687 |
}
|
|
688 |
return nil
|
|
689 |
}
|
|
690 |
|
|
691 |
func (p *AddServiceSumArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
|
|
692 |
if v, err := iprot.ReadI64(ctx); err != nil {
|
|
693 |
return thrift.PrependError("error reading field 2: ", err)
|
|
694 |
} else {
|
|
695 |
p.B = v
|
|
696 |
}
|
|
697 |
return nil
|
|
698 |
}
|
|
699 |
|
|
700 |
func (p *AddServiceSumArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
701 |
if err := oprot.WriteStructBegin(ctx, "Sum_args"); err != nil {
|
|
702 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
703 |
}
|
|
704 |
if p != nil {
|
|
705 |
if err := p.writeField1(ctx, oprot); err != nil {
|
|
706 |
return err
|
|
707 |
}
|
|
708 |
if err := p.writeField2(ctx, oprot); err != nil {
|
|
709 |
return err
|
|
710 |
}
|
|
711 |
}
|
|
712 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
713 |
return thrift.PrependError("write field stop error: ", err)
|
|
714 |
}
|
|
715 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
716 |
return thrift.PrependError("write struct stop error: ", err)
|
|
717 |
}
|
|
718 |
return nil
|
|
719 |
}
|
|
720 |
|
|
721 |
func (p *AddServiceSumArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
722 |
if err := oprot.WriteFieldBegin(ctx, "a", thrift.I64, 1); err != nil {
|
|
723 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err)
|
|
724 |
}
|
|
725 |
if err := oprot.WriteI64(ctx, int64(p.A)); err != nil {
|
|
726 |
return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err)
|
|
727 |
}
|
|
728 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
729 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err)
|
|
730 |
}
|
|
731 |
return err
|
|
732 |
}
|
|
733 |
|
|
734 |
func (p *AddServiceSumArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
735 |
if err := oprot.WriteFieldBegin(ctx, "b", thrift.I64, 2); err != nil {
|
|
736 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err)
|
|
737 |
}
|
|
738 |
if err := oprot.WriteI64(ctx, int64(p.B)); err != nil {
|
|
739 |
return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err)
|
|
740 |
}
|
|
741 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
742 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err)
|
|
743 |
}
|
|
744 |
return err
|
598 | 745 |
}
|
599 | 746 |
|
600 | 747 |
func (p *AddServiceSumArgs) String() string {
|
601 | |
if p == nil {
|
602 | |
return "<nil>"
|
603 | |
}
|
604 | |
return fmt.Sprintf("AddServiceSumArgs(%+v)", *p)
|
|
748 |
if p == nil {
|
|
749 |
return "<nil>"
|
|
750 |
}
|
|
751 |
return fmt.Sprintf("AddServiceSumArgs(%+v)", *p)
|
605 | 752 |
}
|
606 | 753 |
|
607 | 754 |
// Attributes:
|
608 | 755 |
// - Success
|
609 | 756 |
type AddServiceSumResult struct {
|
610 | |
Success *SumReply `thrift:"success,0" db:"success" json:"success,omitempty"`
|
|
757 |
Success *SumReply `thrift:"success,0" db:"success" json:"success,omitempty"`
|
611 | 758 |
}
|
612 | 759 |
|
613 | 760 |
func NewAddServiceSumResult() *AddServiceSumResult {
|
614 | |
return &AddServiceSumResult{}
|
|
761 |
return &AddServiceSumResult{}
|
615 | 762 |
}
|
616 | 763 |
|
617 | 764 |
var AddServiceSumResult_Success_DEFAULT *SumReply
|
|
765 |
|
618 | 766 |
func (p *AddServiceSumResult) GetSuccess() *SumReply {
|
619 | |
if !p.IsSetSuccess() {
|
620 | |
return AddServiceSumResult_Success_DEFAULT
|
621 | |
}
|
622 | |
return p.Success
|
|
767 |
if !p.IsSetSuccess() {
|
|
768 |
return AddServiceSumResult_Success_DEFAULT
|
|
769 |
}
|
|
770 |
return p.Success
|
623 | 771 |
}
|
624 | 772 |
func (p *AddServiceSumResult) IsSetSuccess() bool {
|
625 | |
return p.Success != nil
|
626 | |
}
|
627 | |
|
628 | |
func (p *AddServiceSumResult) Read(iprot thrift.TProtocol) error {
|
629 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
630 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
631 | |
}
|
632 | |
|
633 | |
|
634 | |
for {
|
635 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
636 | |
if err != nil {
|
637 | |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
638 | |
}
|
639 | |
if fieldTypeId == thrift.STOP { break; }
|
640 | |
switch fieldId {
|
641 | |
case 0:
|
642 | |
if fieldTypeId == thrift.STRUCT {
|
643 | |
if err := p.ReadField0(iprot); err != nil {
|
644 | |
return err
|
645 | |
}
|
646 | |
} else {
|
647 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
648 | |
return err
|
649 | |
}
|
650 | |
}
|
651 | |
default:
|
652 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
653 | |
return err
|
654 | |
}
|
655 | |
}
|
656 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
657 | |
return err
|
658 | |
}
|
659 | |
}
|
660 | |
if err := iprot.ReadStructEnd(); err != nil {
|
661 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
662 | |
}
|
663 | |
return nil
|
664 | |
}
|
665 | |
|
666 | |
func (p *AddServiceSumResult) ReadField0(iprot thrift.TProtocol) error {
|
667 | |
p.Success = &SumReply{}
|
668 | |
if err := p.Success.Read(iprot); err != nil {
|
669 | |
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
|
670 | |
}
|
671 | |
return nil
|
672 | |
}
|
673 | |
|
674 | |
func (p *AddServiceSumResult) Write(oprot thrift.TProtocol) error {
|
675 | |
if err := oprot.WriteStructBegin("Sum_result"); err != nil {
|
676 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
677 | |
if p != nil {
|
678 | |
if err := p.writeField0(oprot); err != nil { return err }
|
679 | |
}
|
680 | |
if err := oprot.WriteFieldStop(); err != nil {
|
681 | |
return thrift.PrependError("write field stop error: ", err) }
|
682 | |
if err := oprot.WriteStructEnd(); err != nil {
|
683 | |
return thrift.PrependError("write struct stop error: ", err) }
|
684 | |
return nil
|
685 | |
}
|
686 | |
|
687 | |
func (p *AddServiceSumResult) writeField0(oprot thrift.TProtocol) (err error) {
|
688 | |
if p.IsSetSuccess() {
|
689 | |
if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
690 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
|
691 | |
if err := p.Success.Write(oprot); err != nil {
|
692 | |
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
|
693 | |
}
|
694 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
695 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
|
696 | |
}
|
697 | |
return err
|
|
773 |
return p.Success != nil
|
|
774 |
}
|
|
775 |
|
|
776 |
func (p *AddServiceSumResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
777 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
778 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
779 |
}
|
|
780 |
|
|
781 |
for {
|
|
782 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
783 |
if err != nil {
|
|
784 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
785 |
}
|
|
786 |
if fieldTypeId == thrift.STOP {
|
|
787 |
break
|
|
788 |
}
|
|
789 |
switch fieldId {
|
|
790 |
case 0:
|
|
791 |
if fieldTypeId == thrift.STRUCT {
|
|
792 |
if err := p.ReadField0(ctx, iprot); err != nil {
|
|
793 |
return err
|
|
794 |
}
|
|
795 |
} else {
|
|
796 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
797 |
return err
|
|
798 |
}
|
|
799 |
}
|
|
800 |
default:
|
|
801 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
802 |
return err
|
|
803 |
}
|
|
804 |
}
|
|
805 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
806 |
return err
|
|
807 |
}
|
|
808 |
}
|
|
809 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
810 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
811 |
}
|
|
812 |
return nil
|
|
813 |
}
|
|
814 |
|
|
815 |
func (p *AddServiceSumResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
|
|
816 |
p.Success = &SumReply{}
|
|
817 |
if err := p.Success.Read(ctx, iprot); err != nil {
|
|
818 |
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
|
|
819 |
}
|
|
820 |
return nil
|
|
821 |
}
|
|
822 |
|
|
823 |
func (p *AddServiceSumResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
824 |
if err := oprot.WriteStructBegin(ctx, "Sum_result"); err != nil {
|
|
825 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
826 |
}
|
|
827 |
if p != nil {
|
|
828 |
if err := p.writeField0(ctx, oprot); err != nil {
|
|
829 |
return err
|
|
830 |
}
|
|
831 |
}
|
|
832 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
833 |
return thrift.PrependError("write field stop error: ", err)
|
|
834 |
}
|
|
835 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
836 |
return thrift.PrependError("write struct stop error: ", err)
|
|
837 |
}
|
|
838 |
return nil
|
|
839 |
}
|
|
840 |
|
|
841 |
func (p *AddServiceSumResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
842 |
if p.IsSetSuccess() {
|
|
843 |
if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
|
|
844 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
|
|
845 |
}
|
|
846 |
if err := p.Success.Write(ctx, oprot); err != nil {
|
|
847 |
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
|
|
848 |
}
|
|
849 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
850 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
|
|
851 |
}
|
|
852 |
}
|
|
853 |
return err
|
698 | 854 |
}
|
699 | 855 |
|
700 | 856 |
func (p *AddServiceSumResult) String() string {
|
701 | |
if p == nil {
|
702 | |
return "<nil>"
|
703 | |
}
|
704 | |
return fmt.Sprintf("AddServiceSumResult(%+v)", *p)
|
|
857 |
if p == nil {
|
|
858 |
return "<nil>"
|
|
859 |
}
|
|
860 |
return fmt.Sprintf("AddServiceSumResult(%+v)", *p)
|
705 | 861 |
}
|
706 | 862 |
|
707 | 863 |
// Attributes:
|
708 | 864 |
// - A
|
709 | 865 |
// - B
|
710 | 866 |
type AddServiceConcatArgs struct {
|
711 | |
A string `thrift:"a,1" db:"a" json:"a"`
|
712 | |
B string `thrift:"b,2" db:"b" json:"b"`
|
|
867 |
A string `thrift:"a,1" db:"a" json:"a"`
|
|
868 |
B string `thrift:"b,2" db:"b" json:"b"`
|
713 | 869 |
}
|
714 | 870 |
|
715 | 871 |
func NewAddServiceConcatArgs() *AddServiceConcatArgs {
|
716 | |
return &AddServiceConcatArgs{}
|
717 | |
}
|
718 | |
|
|
872 |
return &AddServiceConcatArgs{}
|
|
873 |
}
|
719 | 874 |
|
720 | 875 |
func (p *AddServiceConcatArgs) GetA() string {
|
721 | |
return p.A
|
|
876 |
return p.A
|
722 | 877 |
}
|
723 | 878 |
|
724 | 879 |
func (p *AddServiceConcatArgs) GetB() string {
|
725 | |
return p.B
|
726 | |
}
|
727 | |
func (p *AddServiceConcatArgs) Read(iprot thrift.TProtocol) error {
|
728 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
729 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
730 | |
}
|
731 | |
|
732 | |
|
733 | |
for {
|
734 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
735 | |
if err != nil {
|
736 | |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
737 | |
}
|
738 | |
if fieldTypeId == thrift.STOP { break; }
|
739 | |
switch fieldId {
|
740 | |
case 1:
|
741 | |
if fieldTypeId == thrift.STRING {
|
742 | |
if err := p.ReadField1(iprot); err != nil {
|
743 | |
return err
|
744 | |
}
|
745 | |
} else {
|
746 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
747 | |
return err
|
748 | |
}
|
749 | |
}
|
750 | |
case 2:
|
751 | |
if fieldTypeId == thrift.STRING {
|
752 | |
if err := p.ReadField2(iprot); err != nil {
|
753 | |
return err
|
754 | |
}
|
755 | |
} else {
|
756 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
757 | |
return err
|
758 | |
}
|
759 | |
}
|
760 | |
default:
|
761 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
762 | |
return err
|
763 | |
}
|
764 | |
}
|
765 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
766 | |
return err
|
767 | |
}
|
768 | |
}
|
769 | |
if err := iprot.ReadStructEnd(); err != nil {
|
770 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
771 | |
}
|
772 | |
return nil
|
773 | |
}
|
774 | |
|
775 | |
func (p *AddServiceConcatArgs) ReadField1(iprot thrift.TProtocol) error {
|
776 | |
if v, err := iprot.ReadString(); err != nil {
|
777 | |
return thrift.PrependError("error reading field 1: ", err)
|
778 | |
} else {
|
779 | |
p.A = v
|
780 | |
}
|
781 | |
return nil
|
782 | |
}
|
783 | |
|
784 | |
func (p *AddServiceConcatArgs) ReadField2(iprot thrift.TProtocol) error {
|
785 | |
if v, err := iprot.ReadString(); err != nil {
|
786 | |
return thrift.PrependError("error reading field 2: ", err)
|
787 | |
} else {
|
788 | |
p.B = v
|
789 | |
}
|
790 | |
return nil
|
791 | |
}
|
792 | |
|
793 | |
func (p *AddServiceConcatArgs) Write(oprot thrift.TProtocol) error {
|
794 | |
if err := oprot.WriteStructBegin("Concat_args"); err != nil {
|
795 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
796 | |
if p != nil {
|
797 | |
if err := p.writeField1(oprot); err != nil { return err }
|
798 | |
if err := p.writeField2(oprot); err != nil { return err }
|
799 | |
}
|
800 | |
if err := oprot.WriteFieldStop(); err != nil {
|
801 | |
return thrift.PrependError("write field stop error: ", err) }
|
802 | |
if err := oprot.WriteStructEnd(); err != nil {
|
803 | |
return thrift.PrependError("write struct stop error: ", err) }
|
804 | |
return nil
|
805 | |
}
|
806 | |
|
807 | |
func (p *AddServiceConcatArgs) writeField1(oprot thrift.TProtocol) (err error) {
|
808 | |
if err := oprot.WriteFieldBegin("a", thrift.STRING, 1); err != nil {
|
809 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err) }
|
810 | |
if err := oprot.WriteString(string(p.A)); err != nil {
|
811 | |
return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err) }
|
812 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
813 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err) }
|
814 | |
return err
|
815 | |
}
|
816 | |
|
817 | |
func (p *AddServiceConcatArgs) writeField2(oprot thrift.TProtocol) (err error) {
|
818 | |
if err := oprot.WriteFieldBegin("b", thrift.STRING, 2); err != nil {
|
819 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err) }
|
820 | |
if err := oprot.WriteString(string(p.B)); err != nil {
|
821 | |
return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err) }
|
822 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
823 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err) }
|
824 | |
return err
|
|
880 |
return p.B
|
|
881 |
}
|
|
882 |
func (p *AddServiceConcatArgs) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
883 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
884 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
885 |
}
|
|
886 |
|
|
887 |
for {
|
|
888 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
889 |
if err != nil {
|
|
890 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
891 |
}
|
|
892 |
if fieldTypeId == thrift.STOP {
|
|
893 |
break
|
|
894 |
}
|
|
895 |
switch fieldId {
|
|
896 |
case 1:
|
|
897 |
if fieldTypeId == thrift.STRING {
|
|
898 |
if err := p.ReadField1(ctx, iprot); err != nil {
|
|
899 |
return err
|
|
900 |
}
|
|
901 |
} else {
|
|
902 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
903 |
return err
|
|
904 |
}
|
|
905 |
}
|
|
906 |
case 2:
|
|
907 |
if fieldTypeId == thrift.STRING {
|
|
908 |
if err := p.ReadField2(ctx, iprot); err != nil {
|
|
909 |
return err
|
|
910 |
}
|
|
911 |
} else {
|
|
912 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
913 |
return err
|
|
914 |
}
|
|
915 |
}
|
|
916 |
default:
|
|
917 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
918 |
return err
|
|
919 |
}
|
|
920 |
}
|
|
921 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
922 |
return err
|
|
923 |
}
|
|
924 |
}
|
|
925 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
926 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
927 |
}
|
|
928 |
return nil
|
|
929 |
}
|
|
930 |
|
|
931 |
func (p *AddServiceConcatArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
|
|
932 |
if v, err := iprot.ReadString(ctx); err != nil {
|
|
933 |
return thrift.PrependError("error reading field 1: ", err)
|
|
934 |
} else {
|
|
935 |
p.A = v
|
|
936 |
}
|
|
937 |
return nil
|
|
938 |
}
|
|
939 |
|
|
940 |
func (p *AddServiceConcatArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
|
|
941 |
if v, err := iprot.ReadString(ctx); err != nil {
|
|
942 |
return thrift.PrependError("error reading field 2: ", err)
|
|
943 |
} else {
|
|
944 |
p.B = v
|
|
945 |
}
|
|
946 |
return nil
|
|
947 |
}
|
|
948 |
|
|
949 |
func (p *AddServiceConcatArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
950 |
if err := oprot.WriteStructBegin(ctx, "Concat_args"); err != nil {
|
|
951 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
952 |
}
|
|
953 |
if p != nil {
|
|
954 |
if err := p.writeField1(ctx, oprot); err != nil {
|
|
955 |
return err
|
|
956 |
}
|
|
957 |
if err := p.writeField2(ctx, oprot); err != nil {
|
|
958 |
return err
|
|
959 |
}
|
|
960 |
}
|
|
961 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
962 |
return thrift.PrependError("write field stop error: ", err)
|
|
963 |
}
|
|
964 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
965 |
return thrift.PrependError("write struct stop error: ", err)
|
|
966 |
}
|
|
967 |
return nil
|
|
968 |
}
|
|
969 |
|
|
970 |
func (p *AddServiceConcatArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
971 |
if err := oprot.WriteFieldBegin(ctx, "a", thrift.STRING, 1); err != nil {
|
|
972 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:a: ", p), err)
|
|
973 |
}
|
|
974 |
if err := oprot.WriteString(ctx, string(p.A)); err != nil {
|
|
975 |
return thrift.PrependError(fmt.Sprintf("%T.a (1) field write error: ", p), err)
|
|
976 |
}
|
|
977 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
978 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:a: ", p), err)
|
|
979 |
}
|
|
980 |
return err
|
|
981 |
}
|
|
982 |
|
|
983 |
func (p *AddServiceConcatArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
984 |
if err := oprot.WriteFieldBegin(ctx, "b", thrift.STRING, 2); err != nil {
|
|
985 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:b: ", p), err)
|
|
986 |
}
|
|
987 |
if err := oprot.WriteString(ctx, string(p.B)); err != nil {
|
|
988 |
return thrift.PrependError(fmt.Sprintf("%T.b (2) field write error: ", p), err)
|
|
989 |
}
|
|
990 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
991 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:b: ", p), err)
|
|
992 |
}
|
|
993 |
return err
|
825 | 994 |
}
|
826 | 995 |
|
827 | 996 |
func (p *AddServiceConcatArgs) String() string {
|
828 | |
if p == nil {
|
829 | |
return "<nil>"
|
830 | |
}
|
831 | |
return fmt.Sprintf("AddServiceConcatArgs(%+v)", *p)
|
|
997 |
if p == nil {
|
|
998 |
return "<nil>"
|
|
999 |
}
|
|
1000 |
return fmt.Sprintf("AddServiceConcatArgs(%+v)", *p)
|
832 | 1001 |
}
|
833 | 1002 |
|
834 | 1003 |
// Attributes:
|
835 | 1004 |
// - Success
|
836 | 1005 |
type AddServiceConcatResult struct {
|
837 | |
Success *ConcatReply `thrift:"success,0" db:"success" json:"success,omitempty"`
|
|
1006 |
Success *ConcatReply `thrift:"success,0" db:"success" json:"success,omitempty"`
|
838 | 1007 |
}
|
839 | 1008 |
|
840 | 1009 |
func NewAddServiceConcatResult() *AddServiceConcatResult {
|
841 | |
return &AddServiceConcatResult{}
|
|
1010 |
return &AddServiceConcatResult{}
|
842 | 1011 |
}
|
843 | 1012 |
|
844 | 1013 |
var AddServiceConcatResult_Success_DEFAULT *ConcatReply
|
|
1014 |
|
845 | 1015 |
func (p *AddServiceConcatResult) GetSuccess() *ConcatReply {
|
846 | |
if !p.IsSetSuccess() {
|
847 | |
return AddServiceConcatResult_Success_DEFAULT
|
848 | |
}
|
849 | |
return p.Success
|
|
1016 |
if !p.IsSetSuccess() {
|
|
1017 |
return AddServiceConcatResult_Success_DEFAULT
|
|
1018 |
}
|
|
1019 |
return p.Success
|
850 | 1020 |
}
|
851 | 1021 |
func (p *AddServiceConcatResult) IsSetSuccess() bool {
|
852 | |
return p.Success != nil
|
853 | |
}
|
854 | |
|
855 | |
func (p *AddServiceConcatResult) Read(iprot thrift.TProtocol) error {
|
856 | |
if _, err := iprot.ReadStructBegin(); err != nil {
|
857 | |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
858 | |
}
|
859 | |
|
860 | |
|
861 | |
for {
|
862 | |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
|
863 | |
if err != nil {
|
864 | |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
865 | |
}
|
866 | |
if fieldTypeId == thrift.STOP { break; }
|
867 | |
switch fieldId {
|
868 | |
case 0:
|
869 | |
if fieldTypeId == thrift.STRUCT {
|
870 | |
if err := p.ReadField0(iprot); err != nil {
|
871 | |
return err
|
872 | |
}
|
873 | |
} else {
|
874 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
875 | |
return err
|
876 | |
}
|
877 | |
}
|
878 | |
default:
|
879 | |
if err := iprot.Skip(fieldTypeId); err != nil {
|
880 | |
return err
|
881 | |
}
|
882 | |
}
|
883 | |
if err := iprot.ReadFieldEnd(); err != nil {
|
884 | |
return err
|
885 | |
}
|
886 | |
}
|
887 | |
if err := iprot.ReadStructEnd(); err != nil {
|
888 | |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
889 | |
}
|
890 | |
return nil
|
891 | |
}
|
892 | |
|
893 | |
func (p *AddServiceConcatResult) ReadField0(iprot thrift.TProtocol) error {
|
894 | |
p.Success = &ConcatReply{}
|
895 | |
if err := p.Success.Read(iprot); err != nil {
|
896 | |
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
|
897 | |
}
|
898 | |
return nil
|
899 | |
}
|
900 | |
|
901 | |
func (p *AddServiceConcatResult) Write(oprot thrift.TProtocol) error {
|
902 | |
if err := oprot.WriteStructBegin("Concat_result"); err != nil {
|
903 | |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
|
904 | |
if p != nil {
|
905 | |
if err := p.writeField0(oprot); err != nil { return err }
|
906 | |
}
|
907 | |
if err := oprot.WriteFieldStop(); err != nil {
|
908 | |
return thrift.PrependError("write field stop error: ", err) }
|
909 | |
if err := oprot.WriteStructEnd(); err != nil {
|
910 | |
return thrift.PrependError("write struct stop error: ", err) }
|
911 | |
return nil
|
912 | |
}
|
913 | |
|
914 | |
func (p *AddServiceConcatResult) writeField0(oprot thrift.TProtocol) (err error) {
|
915 | |
if p.IsSetSuccess() {
|
916 | |
if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
|
917 | |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
|
918 | |
if err := p.Success.Write(oprot); err != nil {
|
919 | |
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
|
920 | |
}
|
921 | |
if err := oprot.WriteFieldEnd(); err != nil {
|
922 | |
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
|
923 | |
}
|
924 | |
return err
|
|
1022 |
return p.Success != nil
|
|
1023 |
}
|
|
1024 |
|
|
1025 |
func (p *AddServiceConcatResult) Read(ctx context.Context, iprot thrift.TProtocol) error {
|
|
1026 |
if _, err := iprot.ReadStructBegin(ctx); err != nil {
|
|
1027 |
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
|
|
1028 |
}
|
|
1029 |
|
|
1030 |
for {
|
|
1031 |
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
|
|
1032 |
if err != nil {
|
|
1033 |
return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
|
|
1034 |
}
|
|
1035 |
if fieldTypeId == thrift.STOP {
|
|
1036 |
break
|
|
1037 |
}
|
|
1038 |
switch fieldId {
|
|
1039 |
case 0:
|
|
1040 |
if fieldTypeId == thrift.STRUCT {
|
|
1041 |
if err := p.ReadField0(ctx, iprot); err != nil {
|
|
1042 |
return err
|
|
1043 |
}
|
|
1044 |
} else {
|
|
1045 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
1046 |
return err
|
|
1047 |
}
|
|
1048 |
}
|
|
1049 |
default:
|
|
1050 |
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
|
|
1051 |
return err
|
|
1052 |
}
|
|
1053 |
}
|
|
1054 |
if err := iprot.ReadFieldEnd(ctx); err != nil {
|
|
1055 |
return err
|
|
1056 |
}
|
|
1057 |
}
|
|
1058 |
if err := iprot.ReadStructEnd(ctx); err != nil {
|
|
1059 |
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
|
|
1060 |
}
|
|
1061 |
return nil
|
|
1062 |
}
|
|
1063 |
|
|
1064 |
func (p *AddServiceConcatResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error {
|
|
1065 |
p.Success = &ConcatReply{}
|
|
1066 |
if err := p.Success.Read(ctx, iprot); err != nil {
|
|
1067 |
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
|
|
1068 |
}
|
|
1069 |
return nil
|
|
1070 |
}
|
|
1071 |
|
|
1072 |
func (p *AddServiceConcatResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
|
|
1073 |
if err := oprot.WriteStructBegin(ctx, "Concat_result"); err != nil {
|
|
1074 |
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
|
|
1075 |
}
|
|
1076 |
if p != nil {
|
|
1077 |
if err := p.writeField0(ctx, oprot); err != nil {
|
|
1078 |
return err
|
|
1079 |
}
|
|
1080 |
}
|
|
1081 |
if err := oprot.WriteFieldStop(ctx); err != nil {
|
|
1082 |
return thrift.PrependError("write field stop error: ", err)
|
|
1083 |
}
|
|
1084 |
if err := oprot.WriteStructEnd(ctx); err != nil {
|
|
1085 |
return thrift.PrependError("write struct stop error: ", err)
|
|
1086 |
}
|
|
1087 |
return nil
|
|
1088 |
}
|
|
1089 |
|
|
1090 |
func (p *AddServiceConcatResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
|
|
1091 |
if p.IsSetSuccess() {
|
|
1092 |
if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
|
|
1093 |
return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
|
|
1094 |
}
|
|
1095 |
if err := p.Success.Write(ctx, oprot); err != nil {
|
|
1096 |
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
|
|
1097 |
}
|
|
1098 |
if err := oprot.WriteFieldEnd(ctx); err != nil {
|
|
1099 |
return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
|
|
1100 |
}
|
|
1101 |
}
|
|
1102 |
return err
|
925 | 1103 |
}
|
926 | 1104 |
|
927 | 1105 |
func (p *AddServiceConcatResult) String() string {
|
928 | |
if p == nil {
|
929 | |
return "<nil>"
|
930 | |
}
|
931 | |
return fmt.Sprintf("AddServiceConcatResult(%+v)", *p)
|
932 | |
}
|
933 | |
|
934 | |
|
|
1106 |
if p == nil {
|
|
1107 |
return "<nil>"
|
|
1108 |
}
|
|
1109 |
return fmt.Sprintf("AddServiceConcatResult(%+v)", *p)
|
|
1110 |
}
|