1
16
17
18
19
20 package intstr
21
22 import (
23 fmt "fmt"
24
25 io "io"
26 math "math"
27 math_bits "math/bits"
28
29 proto "github.com/gogo/protobuf/proto"
30 )
31
32
33 var _ = proto.Marshal
34 var _ = fmt.Errorf
35 var _ = math.Inf
36
37
38
39
40
41 const _ = proto.GoGoProtoPackageIsVersion3
42
43 func (m *IntOrString) Reset() { *m = IntOrString{} }
44 func (*IntOrString) ProtoMessage() {}
45 func (*IntOrString) Descriptor() ([]byte, []int) {
46 return fileDescriptor_771bacc35a5ec189, []int{0}
47 }
48 func (m *IntOrString) XXX_Unmarshal(b []byte) error {
49 return m.Unmarshal(b)
50 }
51 func (m *IntOrString) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
52 b = b[:cap(b)]
53 n, err := m.MarshalToSizedBuffer(b)
54 if err != nil {
55 return nil, err
56 }
57 return b[:n], nil
58 }
59 func (m *IntOrString) XXX_Merge(src proto.Message) {
60 xxx_messageInfo_IntOrString.Merge(m, src)
61 }
62 func (m *IntOrString) XXX_Size() int {
63 return m.Size()
64 }
65 func (m *IntOrString) XXX_DiscardUnknown() {
66 xxx_messageInfo_IntOrString.DiscardUnknown(m)
67 }
68
69 var xxx_messageInfo_IntOrString proto.InternalMessageInfo
70
71 func init() {
72 proto.RegisterType((*IntOrString)(nil), "k8s.io.apimachinery.pkg.util.intstr.IntOrString")
73 }
74
75 func init() {
76 proto.RegisterFile("k8s.io/apimachinery/pkg/util/intstr/generated.proto", fileDescriptor_771bacc35a5ec189)
77 }
78
79 var fileDescriptor_771bacc35a5ec189 = []byte{
80
81 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xce, 0xb6, 0x28, 0xd6,
82 0xcb, 0xcc, 0xd7, 0x4f, 0x2c, 0xc8, 0xcc, 0x4d, 0x4c, 0xce, 0xc8, 0xcc, 0x4b, 0x2d, 0xaa, 0xd4,
83 0x2f, 0xc8, 0x4e, 0xd7, 0x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x18, 0x9c, 0x3c, 0x4f, 0x3c, 0x94, 0x63,
95 0xb8, 0xf0, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72, 0x8c, 0x27, 0x1e, 0xc9,
96 0x31, 0x5e, 0x78, 0x24, 0xc7, 0x78, 0xe3, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e,
97 0xcb, 0x31, 0x44, 0x29, 0x13, 0x11, 0x84, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xa1, 0x0b,
98 0x1e, 0x68, 0x01, 0x00, 0x00,
99 }
100
101 func (m *IntOrString) Marshal() (dAtA []byte, err error) {
102 size := m.Size()
103 dAtA = make([]byte, size)
104 n, err := m.MarshalToSizedBuffer(dAtA[:size])
105 if err != nil {
106 return nil, err
107 }
108 return dAtA[:n], nil
109 }
110
111 func (m *IntOrString) MarshalTo(dAtA []byte) (int, error) {
112 size := m.Size()
113 return m.MarshalToSizedBuffer(dAtA[:size])
114 }
115
116 func (m *IntOrString) MarshalToSizedBuffer(dAtA []byte) (int, error) {
117 i := len(dAtA)
118 _ = i
119 var l int
120 _ = l
121 i -= len(m.StrVal)
122 copy(dAtA[i:], m.StrVal)
123 i = encodeVarintGenerated(dAtA, i, uint64(len(m.StrVal)))
124 i--
125 dAtA[i] = 0x1a
126 i = encodeVarintGenerated(dAtA, i, uint64(m.IntVal))
127 i--
128 dAtA[i] = 0x10
129 i = encodeVarintGenerated(dAtA, i, uint64(m.Type))
130 i--
131 dAtA[i] = 0x8
132 return len(dAtA) - i, nil
133 }
134
135 func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
136 offset -= sovGenerated(v)
137 base := offset
138 for v >= 1<<7 {
139 dAtA[offset] = uint8(v&0x7f | 0x80)
140 v >>= 7
141 offset++
142 }
143 dAtA[offset] = uint8(v)
144 return base
145 }
146 func (m *IntOrString) Size() (n int) {
147 if m == nil {
148 return 0
149 }
150 var l int
151 _ = l
152 n += 1 + sovGenerated(uint64(m.Type))
153 n += 1 + sovGenerated(uint64(m.IntVal))
154 l = len(m.StrVal)
155 n += 1 + l + sovGenerated(uint64(l))
156 return n
157 }
158
159 func sovGenerated(x uint64) (n int) {
160 return (math_bits.Len64(x|1) + 6) / 7
161 }
162 func sozGenerated(x uint64) (n int) {
163 return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
164 }
165 func (m *IntOrString) Unmarshal(dAtA []byte) error {
166 l := len(dAtA)
167 iNdEx := 0
168 for iNdEx < l {
169 preIndex := iNdEx
170 var wire uint64
171 for shift := uint(0); ; shift += 7 {
172 if shift >= 64 {
173 return ErrIntOverflowGenerated
174 }
175 if iNdEx >= l {
176 return io.ErrUnexpectedEOF
177 }
178 b := dAtA[iNdEx]
179 iNdEx++
180 wire |= uint64(b&0x7F) << shift
181 if b < 0x80 {
182 break
183 }
184 }
185 fieldNum := int32(wire >> 3)
186 wireType := int(wire & 0x7)
187 if wireType == 4 {
188 return fmt.Errorf("proto: IntOrString: wiretype end group for non-group")
189 }
190 if fieldNum <= 0 {
191 return fmt.Errorf("proto: IntOrString: illegal tag %d (wire type %d)", fieldNum, wire)
192 }
193 switch fieldNum {
194 case 1:
195 if wireType != 0 {
196 return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
197 }
198 m.Type = 0
199 for shift := uint(0); ; shift += 7 {
200 if shift >= 64 {
201 return ErrIntOverflowGenerated
202 }
203 if iNdEx >= l {
204 return io.ErrUnexpectedEOF
205 }
206 b := dAtA[iNdEx]
207 iNdEx++
208 m.Type |= Type(b&0x7F) << shift
209 if b < 0x80 {
210 break
211 }
212 }
213 case 2:
214 if wireType != 0 {
215 return fmt.Errorf("proto: wrong wireType = %d for field IntVal", wireType)
216 }
217 m.IntVal = 0
218 for shift := uint(0); ; shift += 7 {
219 if shift >= 64 {
220 return ErrIntOverflowGenerated
221 }
222 if iNdEx >= l {
223 return io.ErrUnexpectedEOF
224 }
225 b := dAtA[iNdEx]
226 iNdEx++
227 m.IntVal |= int32(b&0x7F) << shift
228 if b < 0x80 {
229 break
230 }
231 }
232 case 3:
233 if wireType != 2 {
234 return fmt.Errorf("proto: wrong wireType = %d for field StrVal", wireType)
235 }
236 var stringLen uint64
237 for shift := uint(0); ; shift += 7 {
238 if shift >= 64 {
239 return ErrIntOverflowGenerated
240 }
241 if iNdEx >= l {
242 return io.ErrUnexpectedEOF
243 }
244 b := dAtA[iNdEx]
245 iNdEx++
246 stringLen |= uint64(b&0x7F) << shift
247 if b < 0x80 {
248 break
249 }
250 }
251 intStringLen := int(stringLen)
252 if intStringLen < 0 {
253 return ErrInvalidLengthGenerated
254 }
255 postIndex := iNdEx + intStringLen
256 if postIndex < 0 {
257 return ErrInvalidLengthGenerated
258 }
259 if postIndex > l {
260 return io.ErrUnexpectedEOF
261 }
262 m.StrVal = string(dAtA[iNdEx:postIndex])
263 iNdEx = postIndex
264 default:
265 iNdEx = preIndex
266 skippy, err := skipGenerated(dAtA[iNdEx:])
267 if err != nil {
268 return err
269 }
270 if (skippy < 0) || (iNdEx+skippy) < 0 {
271 return ErrInvalidLengthGenerated
272 }
273 if (iNdEx + skippy) > l {
274 return io.ErrUnexpectedEOF
275 }
276 iNdEx += skippy
277 }
278 }
279
280 if iNdEx > l {
281 return io.ErrUnexpectedEOF
282 }
283 return nil
284 }
285 func skipGenerated(dAtA []byte) (n int, err error) {
286 l := len(dAtA)
287 iNdEx := 0
288 depth := 0
289 for iNdEx < l {
290 var wire uint64
291 for shift := uint(0); ; shift += 7 {
292 if shift >= 64 {
293 return 0, ErrIntOverflowGenerated
294 }
295 if iNdEx >= l {
296 return 0, io.ErrUnexpectedEOF
297 }
298 b := dAtA[iNdEx]
299 iNdEx++
300 wire |= (uint64(b) & 0x7F) << shift
301 if b < 0x80 {
302 break
303 }
304 }
305 wireType := int(wire & 0x7)
306 switch wireType {
307 case 0:
308 for shift := uint(0); ; shift += 7 {
309 if shift >= 64 {
310 return 0, ErrIntOverflowGenerated
311 }
312 if iNdEx >= l {
313 return 0, io.ErrUnexpectedEOF
314 }
315 iNdEx++
316 if dAtA[iNdEx-1] < 0x80 {
317 break
318 }
319 }
320 case 1:
321 iNdEx += 8
322 case 2:
323 var length int
324 for shift := uint(0); ; shift += 7 {
325 if shift >= 64 {
326 return 0, ErrIntOverflowGenerated
327 }
328 if iNdEx >= l {
329 return 0, io.ErrUnexpectedEOF
330 }
331 b := dAtA[iNdEx]
332 iNdEx++
333 length |= (int(b) & 0x7F) << shift
334 if b < 0x80 {
335 break
336 }
337 }
338 if length < 0 {
339 return 0, ErrInvalidLengthGenerated
340 }
341 iNdEx += length
342 case 3:
343 depth++
344 case 4:
345 if depth == 0 {
346 return 0, ErrUnexpectedEndOfGroupGenerated
347 }
348 depth--
349 case 5:
350 iNdEx += 4
351 default:
352 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
353 }
354 if iNdEx < 0 {
355 return 0, ErrInvalidLengthGenerated
356 }
357 if depth == 0 {
358 return iNdEx, nil
359 }
360 }
361 return 0, io.ErrUnexpectedEOF
362 }
363
364 var (
365 ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
366 ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
367 ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
368 )
369
View as plain text