1
2
3
4 package vanity
5
6 import (
7 fmt "fmt"
8 github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
9 proto "github.com/gogo/protobuf/proto"
10 io "io"
11 math "math"
12 math_bits "math/bits"
13 reflect "reflect"
14 strings "strings"
15 )
16
17
18 var _ = proto.Marshal
19 var _ = fmt.Errorf
20 var _ = math.Inf
21
22
23
24
25
26 const _ = proto.GoGoProtoPackageIsVersion3
27
28 type A struct {
29 Strings string `protobuf:"bytes,1,opt,name=Strings" json:"Strings"`
30 Int int64 `protobuf:"varint,2,req,name=Int" json:"Int"`
31 }
32
33 func (m *A) Reset() { *m = A{} }
34 func (*A) ProtoMessage() {}
35 func (*A) Descriptor() ([]byte, []int) {
36 return fileDescriptor_d4f40d14cd1329d6, []int{0}
37 }
38 func (m *A) XXX_Unmarshal(b []byte) error {
39 return m.Unmarshal(b)
40 }
41 func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
42 if deterministic {
43 return xxx_messageInfo_A.Marshal(b, m, deterministic)
44 } else {
45 b = b[:cap(b)]
46 n, err := m.MarshalToSizedBuffer(b)
47 if err != nil {
48 return nil, err
49 }
50 return b[:n], nil
51 }
52 }
53 func (m *A) XXX_Merge(src proto.Message) {
54 xxx_messageInfo_A.Merge(m, src)
55 }
56 func (m *A) XXX_Size() int {
57 return m.Size()
58 }
59 func (m *A) XXX_DiscardUnknown() {
60 xxx_messageInfo_A.DiscardUnknown(m)
61 }
62
63 var xxx_messageInfo_A proto.InternalMessageInfo
64
65 func (m *A) GetStrings() string {
66 if m != nil {
67 return m.Strings
68 }
69 return ""
70 }
71
72 func (m *A) GetInt() int64 {
73 if m != nil {
74 return m.Int
75 }
76 return 0
77 }
78
79 func init() {
80 proto.RegisterType((*A)(nil), "vanity.A")
81 }
82
83 func init() { proto.RegisterFile("vanity.proto", fileDescriptor_d4f40d14cd1329d6) }
84
85 var fileDescriptor_d4f40d14cd1329d6 = []byte{
86
87 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x4b, 0xcc, 0xcb,
88 0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0xac, 0xb9, 0x18,
89 0x1d, 0x85, 0xe4, 0xb8, 0xd8, 0x83, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x8b, 0x25, 0x18, 0x15, 0x18,
90 0x35, 0x38, 0x9d, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0x09, 0x0a, 0x89, 0x71, 0x31, 0x7b,
91 0xe6, 0x95, 0x48, 0x30, 0x29, 0x30, 0x69, 0x30, 0x43, 0xe5, 0x40, 0x02, 0x4e, 0x26, 0x17, 0x1e,
92 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x15,
93 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6,
94 0x17, 0x8f, 0xe4, 0x18, 0x3e, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39,
95 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x00, 0x01, 0x00, 0x00, 0xff, 0xff, 0x20, 0x58, 0xc4, 0x53, 0x89,
96 0x00, 0x00, 0x00,
97 }
98
99 func (this *A) Equal(that interface{}) bool {
100 if that == nil {
101 return this == nil
102 }
103
104 that1, ok := that.(*A)
105 if !ok {
106 that2, ok := that.(A)
107 if ok {
108 that1 = &that2
109 } else {
110 return false
111 }
112 }
113 if that1 == nil {
114 return this == nil
115 } else if this == nil {
116 return false
117 }
118 if this.Strings != that1.Strings {
119 return false
120 }
121 if this.Int != that1.Int {
122 return false
123 }
124 return true
125 }
126 func (this *A) GoString() string {
127 if this == nil {
128 return "nil"
129 }
130 s := make([]string, 0, 6)
131 s = append(s, "&vanity.A{")
132 s = append(s, "Strings: "+fmt.Sprintf("%#v", this.Strings)+",\n")
133 s = append(s, "Int: "+fmt.Sprintf("%#v", this.Int)+",\n")
134 s = append(s, "}")
135 return strings.Join(s, "")
136 }
137 func valueToGoStringVanity(v interface{}, typ string) string {
138 rv := reflect.ValueOf(v)
139 if rv.IsNil() {
140 return "nil"
141 }
142 pv := reflect.Indirect(rv).Interface()
143 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
144 }
145 func (m *A) Marshal() (dAtA []byte, err error) {
146 size := m.Size()
147 dAtA = make([]byte, size)
148 n, err := m.MarshalToSizedBuffer(dAtA[:size])
149 if err != nil {
150 return nil, err
151 }
152 return dAtA[:n], nil
153 }
154
155 func (m *A) MarshalTo(dAtA []byte) (int, error) {
156 size := m.Size()
157 return m.MarshalToSizedBuffer(dAtA[:size])
158 }
159
160 func (m *A) MarshalToSizedBuffer(dAtA []byte) (int, error) {
161 i := len(dAtA)
162 _ = i
163 var l int
164 _ = l
165 i = encodeVarintVanity(dAtA, i, uint64(m.Int))
166 i--
167 dAtA[i] = 0x10
168 i -= len(m.Strings)
169 copy(dAtA[i:], m.Strings)
170 i = encodeVarintVanity(dAtA, i, uint64(len(m.Strings)))
171 i--
172 dAtA[i] = 0xa
173 return len(dAtA) - i, nil
174 }
175
176 func encodeVarintVanity(dAtA []byte, offset int, v uint64) int {
177 offset -= sovVanity(v)
178 base := offset
179 for v >= 1<<7 {
180 dAtA[offset] = uint8(v&0x7f | 0x80)
181 v >>= 7
182 offset++
183 }
184 dAtA[offset] = uint8(v)
185 return base
186 }
187 func (m *A) Size() (n int) {
188 if m == nil {
189 return 0
190 }
191 var l int
192 _ = l
193 l = len(m.Strings)
194 n += 1 + l + sovVanity(uint64(l))
195 n += 1 + sovVanity(uint64(m.Int))
196 return n
197 }
198
199 func sovVanity(x uint64) (n int) {
200 return (math_bits.Len64(x|1) + 6) / 7
201 }
202 func sozVanity(x uint64) (n int) {
203 return sovVanity(uint64((x << 1) ^ uint64((int64(x) >> 63))))
204 }
205 func (this *A) String() string {
206 if this == nil {
207 return "nil"
208 }
209 s := strings.Join([]string{`&A{`,
210 `Strings:` + fmt.Sprintf("%v", this.Strings) + `,`,
211 `Int:` + fmt.Sprintf("%v", this.Int) + `,`,
212 `}`,
213 }, "")
214 return s
215 }
216 func valueToStringVanity(v interface{}) string {
217 rv := reflect.ValueOf(v)
218 if rv.IsNil() {
219 return "nil"
220 }
221 pv := reflect.Indirect(rv).Interface()
222 return fmt.Sprintf("*%v", pv)
223 }
224 func (m *A) Unmarshal(dAtA []byte) error {
225 var hasFields [1]uint64
226 l := len(dAtA)
227 iNdEx := 0
228 for iNdEx < l {
229 preIndex := iNdEx
230 var wire uint64
231 for shift := uint(0); ; shift += 7 {
232 if shift >= 64 {
233 return ErrIntOverflowVanity
234 }
235 if iNdEx >= l {
236 return io.ErrUnexpectedEOF
237 }
238 b := dAtA[iNdEx]
239 iNdEx++
240 wire |= uint64(b&0x7F) << shift
241 if b < 0x80 {
242 break
243 }
244 }
245 fieldNum := int32(wire >> 3)
246 wireType := int(wire & 0x7)
247 if wireType == 4 {
248 return fmt.Errorf("proto: A: wiretype end group for non-group")
249 }
250 if fieldNum <= 0 {
251 return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire)
252 }
253 switch fieldNum {
254 case 1:
255 if wireType != 2 {
256 return fmt.Errorf("proto: wrong wireType = %d for field Strings", wireType)
257 }
258 var stringLen uint64
259 for shift := uint(0); ; shift += 7 {
260 if shift >= 64 {
261 return ErrIntOverflowVanity
262 }
263 if iNdEx >= l {
264 return io.ErrUnexpectedEOF
265 }
266 b := dAtA[iNdEx]
267 iNdEx++
268 stringLen |= uint64(b&0x7F) << shift
269 if b < 0x80 {
270 break
271 }
272 }
273 intStringLen := int(stringLen)
274 if intStringLen < 0 {
275 return ErrInvalidLengthVanity
276 }
277 postIndex := iNdEx + intStringLen
278 if postIndex < 0 {
279 return ErrInvalidLengthVanity
280 }
281 if postIndex > l {
282 return io.ErrUnexpectedEOF
283 }
284 m.Strings = string(dAtA[iNdEx:postIndex])
285 iNdEx = postIndex
286 case 2:
287 if wireType != 0 {
288 return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType)
289 }
290 m.Int = 0
291 for shift := uint(0); ; shift += 7 {
292 if shift >= 64 {
293 return ErrIntOverflowVanity
294 }
295 if iNdEx >= l {
296 return io.ErrUnexpectedEOF
297 }
298 b := dAtA[iNdEx]
299 iNdEx++
300 m.Int |= int64(b&0x7F) << shift
301 if b < 0x80 {
302 break
303 }
304 }
305 hasFields[0] |= uint64(0x00000001)
306 default:
307 iNdEx = preIndex
308 skippy, err := skipVanity(dAtA[iNdEx:])
309 if err != nil {
310 return err
311 }
312 if (skippy < 0) || (iNdEx+skippy) < 0 {
313 return ErrInvalidLengthVanity
314 }
315 if (iNdEx + skippy) > l {
316 return io.ErrUnexpectedEOF
317 }
318 iNdEx += skippy
319 }
320 }
321 if hasFields[0]&uint64(0x00000001) == 0 {
322 return github_com_gogo_protobuf_proto.NewRequiredNotSetError("Int")
323 }
324
325 if iNdEx > l {
326 return io.ErrUnexpectedEOF
327 }
328 return nil
329 }
330 func skipVanity(dAtA []byte) (n int, err error) {
331 l := len(dAtA)
332 iNdEx := 0
333 depth := 0
334 for iNdEx < l {
335 var wire uint64
336 for shift := uint(0); ; shift += 7 {
337 if shift >= 64 {
338 return 0, ErrIntOverflowVanity
339 }
340 if iNdEx >= l {
341 return 0, io.ErrUnexpectedEOF
342 }
343 b := dAtA[iNdEx]
344 iNdEx++
345 wire |= (uint64(b) & 0x7F) << shift
346 if b < 0x80 {
347 break
348 }
349 }
350 wireType := int(wire & 0x7)
351 switch wireType {
352 case 0:
353 for shift := uint(0); ; shift += 7 {
354 if shift >= 64 {
355 return 0, ErrIntOverflowVanity
356 }
357 if iNdEx >= l {
358 return 0, io.ErrUnexpectedEOF
359 }
360 iNdEx++
361 if dAtA[iNdEx-1] < 0x80 {
362 break
363 }
364 }
365 case 1:
366 iNdEx += 8
367 case 2:
368 var length int
369 for shift := uint(0); ; shift += 7 {
370 if shift >= 64 {
371 return 0, ErrIntOverflowVanity
372 }
373 if iNdEx >= l {
374 return 0, io.ErrUnexpectedEOF
375 }
376 b := dAtA[iNdEx]
377 iNdEx++
378 length |= (int(b) & 0x7F) << shift
379 if b < 0x80 {
380 break
381 }
382 }
383 if length < 0 {
384 return 0, ErrInvalidLengthVanity
385 }
386 iNdEx += length
387 case 3:
388 depth++
389 case 4:
390 if depth == 0 {
391 return 0, ErrUnexpectedEndOfGroupVanity
392 }
393 depth--
394 case 5:
395 iNdEx += 4
396 default:
397 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
398 }
399 if iNdEx < 0 {
400 return 0, ErrInvalidLengthVanity
401 }
402 if depth == 0 {
403 return iNdEx, nil
404 }
405 }
406 return 0, io.ErrUnexpectedEOF
407 }
408
409 var (
410 ErrInvalidLengthVanity = fmt.Errorf("proto: negative length found during unmarshaling")
411 ErrIntOverflowVanity = fmt.Errorf("proto: integer overflow")
412 ErrUnexpectedEndOfGroupVanity = fmt.Errorf("proto: unexpected end of group")
413 )
414
View as plain text