1
2
3
4 package vanity
5
6 import (
7 fmt "fmt"
8 proto "github.com/gogo/protobuf/proto"
9 io "io"
10 math "math"
11 math_bits "math/bits"
12 )
13
14
15 var _ = proto.Marshal
16 var _ = fmt.Errorf
17 var _ = math.Inf
18
19
20
21
22
23 const _ = proto.GoGoProtoPackageIsVersion3
24
25 type Aproto3 struct {
26 B string `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"`
27 }
28
29 func (m *Aproto3) Reset() { *m = Aproto3{} }
30 func (m *Aproto3) String() string { return proto.CompactTextString(m) }
31 func (*Aproto3) ProtoMessage() {}
32 func (*Aproto3) Descriptor() ([]byte, []int) {
33 return fileDescriptor_4fee6d65e34a64b6, []int{0}
34 }
35 func (m *Aproto3) XXX_Unmarshal(b []byte) error {
36 return m.Unmarshal(b)
37 }
38 func (m *Aproto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
39 if deterministic {
40 return xxx_messageInfo_Aproto3.Marshal(b, m, deterministic)
41 } else {
42 b = b[:cap(b)]
43 n, err := m.MarshalToSizedBuffer(b)
44 if err != nil {
45 return nil, err
46 }
47 return b[:n], nil
48 }
49 }
50 func (m *Aproto3) XXX_Merge(src proto.Message) {
51 xxx_messageInfo_Aproto3.Merge(m, src)
52 }
53 func (m *Aproto3) XXX_Size() int {
54 return m.Size()
55 }
56 func (m *Aproto3) XXX_DiscardUnknown() {
57 xxx_messageInfo_Aproto3.DiscardUnknown(m)
58 }
59
60 var xxx_messageInfo_Aproto3 proto.InternalMessageInfo
61
62 func (m *Aproto3) GetB() string {
63 if m != nil {
64 return m.B
65 }
66 return ""
67 }
68
69 func init() {
70 proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3")
71 }
72
73 func init() { proto.RegisterFile("proto3.proto", fileDescriptor_4fee6d65e34a64b6) }
74
75 var fileDescriptor_4fee6d65e34a64b6 = []byte{
76
77 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f,
78 0xc9, 0x37, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x65, 0x89, 0x79, 0x99, 0x25, 0x95, 0x4a, 0xe2, 0x5c,
79 0xec, 0x8e, 0x10, 0x09, 0x21, 0x1e, 0x2e, 0x46, 0x27, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
80 0x46, 0x27, 0x27, 0x89, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
81 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x48, 0x62, 0x83,
82 0xa8, 0x07, 0x04, 0x00, 0x00, 0xff, 0xff, 0x73, 0xb1, 0xdb, 0xd2, 0x51, 0x00, 0x00, 0x00,
83 }
84
85 func (m *Aproto3) Marshal() (dAtA []byte, err error) {
86 size := m.Size()
87 dAtA = make([]byte, size)
88 n, err := m.MarshalToSizedBuffer(dAtA[:size])
89 if err != nil {
90 return nil, err
91 }
92 return dAtA[:n], nil
93 }
94
95 func (m *Aproto3) MarshalTo(dAtA []byte) (int, error) {
96 size := m.Size()
97 return m.MarshalToSizedBuffer(dAtA[:size])
98 }
99
100 func (m *Aproto3) MarshalToSizedBuffer(dAtA []byte) (int, error) {
101 i := len(dAtA)
102 _ = i
103 var l int
104 _ = l
105 if len(m.B) > 0 {
106 i -= len(m.B)
107 copy(dAtA[i:], m.B)
108 i = encodeVarintProto3(dAtA, i, uint64(len(m.B)))
109 i--
110 dAtA[i] = 0xa
111 }
112 return len(dAtA) - i, nil
113 }
114
115 func encodeVarintProto3(dAtA []byte, offset int, v uint64) int {
116 offset -= sovProto3(v)
117 base := offset
118 for v >= 1<<7 {
119 dAtA[offset] = uint8(v&0x7f | 0x80)
120 v >>= 7
121 offset++
122 }
123 dAtA[offset] = uint8(v)
124 return base
125 }
126 func (m *Aproto3) Size() (n int) {
127 if m == nil {
128 return 0
129 }
130 var l int
131 _ = l
132 l = len(m.B)
133 if l > 0 {
134 n += 1 + l + sovProto3(uint64(l))
135 }
136 return n
137 }
138
139 func sovProto3(x uint64) (n int) {
140 return (math_bits.Len64(x|1) + 6) / 7
141 }
142 func sozProto3(x uint64) (n int) {
143 return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63))))
144 }
145 func (m *Aproto3) Unmarshal(dAtA []byte) error {
146 l := len(dAtA)
147 iNdEx := 0
148 for iNdEx < l {
149 preIndex := iNdEx
150 var wire uint64
151 for shift := uint(0); ; shift += 7 {
152 if shift >= 64 {
153 return ErrIntOverflowProto3
154 }
155 if iNdEx >= l {
156 return io.ErrUnexpectedEOF
157 }
158 b := dAtA[iNdEx]
159 iNdEx++
160 wire |= uint64(b&0x7F) << shift
161 if b < 0x80 {
162 break
163 }
164 }
165 fieldNum := int32(wire >> 3)
166 wireType := int(wire & 0x7)
167 if wireType == 4 {
168 return fmt.Errorf("proto: Aproto3: wiretype end group for non-group")
169 }
170 if fieldNum <= 0 {
171 return fmt.Errorf("proto: Aproto3: illegal tag %d (wire type %d)", fieldNum, wire)
172 }
173 switch fieldNum {
174 case 1:
175 if wireType != 2 {
176 return fmt.Errorf("proto: wrong wireType = %d for field B", wireType)
177 }
178 var stringLen uint64
179 for shift := uint(0); ; shift += 7 {
180 if shift >= 64 {
181 return ErrIntOverflowProto3
182 }
183 if iNdEx >= l {
184 return io.ErrUnexpectedEOF
185 }
186 b := dAtA[iNdEx]
187 iNdEx++
188 stringLen |= uint64(b&0x7F) << shift
189 if b < 0x80 {
190 break
191 }
192 }
193 intStringLen := int(stringLen)
194 if intStringLen < 0 {
195 return ErrInvalidLengthProto3
196 }
197 postIndex := iNdEx + intStringLen
198 if postIndex < 0 {
199 return ErrInvalidLengthProto3
200 }
201 if postIndex > l {
202 return io.ErrUnexpectedEOF
203 }
204 m.B = string(dAtA[iNdEx:postIndex])
205 iNdEx = postIndex
206 default:
207 iNdEx = preIndex
208 skippy, err := skipProto3(dAtA[iNdEx:])
209 if err != nil {
210 return err
211 }
212 if (skippy < 0) || (iNdEx+skippy) < 0 {
213 return ErrInvalidLengthProto3
214 }
215 if (iNdEx + skippy) > l {
216 return io.ErrUnexpectedEOF
217 }
218 iNdEx += skippy
219 }
220 }
221
222 if iNdEx > l {
223 return io.ErrUnexpectedEOF
224 }
225 return nil
226 }
227 func skipProto3(dAtA []byte) (n int, err error) {
228 l := len(dAtA)
229 iNdEx := 0
230 depth := 0
231 for iNdEx < l {
232 var wire uint64
233 for shift := uint(0); ; shift += 7 {
234 if shift >= 64 {
235 return 0, ErrIntOverflowProto3
236 }
237 if iNdEx >= l {
238 return 0, io.ErrUnexpectedEOF
239 }
240 b := dAtA[iNdEx]
241 iNdEx++
242 wire |= (uint64(b) & 0x7F) << shift
243 if b < 0x80 {
244 break
245 }
246 }
247 wireType := int(wire & 0x7)
248 switch wireType {
249 case 0:
250 for shift := uint(0); ; shift += 7 {
251 if shift >= 64 {
252 return 0, ErrIntOverflowProto3
253 }
254 if iNdEx >= l {
255 return 0, io.ErrUnexpectedEOF
256 }
257 iNdEx++
258 if dAtA[iNdEx-1] < 0x80 {
259 break
260 }
261 }
262 case 1:
263 iNdEx += 8
264 case 2:
265 var length int
266 for shift := uint(0); ; shift += 7 {
267 if shift >= 64 {
268 return 0, ErrIntOverflowProto3
269 }
270 if iNdEx >= l {
271 return 0, io.ErrUnexpectedEOF
272 }
273 b := dAtA[iNdEx]
274 iNdEx++
275 length |= (int(b) & 0x7F) << shift
276 if b < 0x80 {
277 break
278 }
279 }
280 if length < 0 {
281 return 0, ErrInvalidLengthProto3
282 }
283 iNdEx += length
284 case 3:
285 depth++
286 case 4:
287 if depth == 0 {
288 return 0, ErrUnexpectedEndOfGroupProto3
289 }
290 depth--
291 case 5:
292 iNdEx += 4
293 default:
294 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
295 }
296 if iNdEx < 0 {
297 return 0, ErrInvalidLengthProto3
298 }
299 if depth == 0 {
300 return iNdEx, nil
301 }
302 }
303 return 0, io.ErrUnexpectedEOF
304 }
305
306 var (
307 ErrInvalidLengthProto3 = fmt.Errorf("proto: negative length found during unmarshaling")
308 ErrIntOverflowProto3 = fmt.Errorf("proto: integer overflow")
309 ErrUnexpectedEndOfGroupProto3 = fmt.Errorf("proto: unexpected end of group")
310 )
311
View as plain text