github.com/aclisp/heapster@v0.19.2-0.20160613100040-51756f899a96/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/resource/generated.pb.go (about) 1 /* 2 Copyright 2016 The Kubernetes Authors All rights reserved. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by protoc-gen-gogo. 18 // source: k8s.io/kubernetes/pkg/api/resource/generated.proto 19 // DO NOT EDIT! 20 21 /* 22 Package resource is a generated protocol buffer package. 23 24 It is generated from these files: 25 k8s.io/kubernetes/pkg/api/resource/generated.proto 26 27 It has these top-level messages: 28 Quantity 29 QuantityProto 30 */ 31 package resource 32 33 import proto "github.com/gogo/protobuf/proto" 34 import fmt "fmt" 35 import math "math" 36 37 import io "io" 38 39 // Reference imports to suppress errors if they are not otherwise used. 40 var _ = proto.Marshal 41 var _ = fmt.Errorf 42 var _ = math.Inf 43 44 func (m *Quantity) Reset() { *m = Quantity{} } 45 func (*Quantity) ProtoMessage() {} 46 47 func (m *QuantityProto) Reset() { *m = QuantityProto{} } 48 func (m *QuantityProto) String() string { return proto.CompactTextString(m) } 49 func (*QuantityProto) ProtoMessage() {} 50 51 func init() { 52 proto.RegisterType((*Quantity)(nil), "k8s.io.kubernetes.pkg.api.resource.Quantity") 53 proto.RegisterType((*QuantityProto)(nil), "k8s.io.kubernetes.pkg.api.resource.QuantityProto") 54 } 55 func (m *QuantityProto) Marshal() (data []byte, err error) { 56 size := m.Size() 57 data = make([]byte, size) 58 n, err := m.MarshalTo(data) 59 if err != nil { 60 return nil, err 61 } 62 return data[:n], nil 63 } 64 65 func (m *QuantityProto) MarshalTo(data []byte) (int, error) { 66 var i int 67 _ = i 68 var l int 69 _ = l 70 data[i] = 0xa 71 i++ 72 i = encodeVarintGenerated(data, i, uint64(len(m.Format))) 73 i += copy(data[i:], m.Format) 74 data[i] = 0x10 75 i++ 76 i = encodeVarintGenerated(data, i, uint64(m.Scale)) 77 if m.Bigint != nil { 78 data[i] = 0x1a 79 i++ 80 i = encodeVarintGenerated(data, i, uint64(len(m.Bigint))) 81 i += copy(data[i:], m.Bigint) 82 } 83 return i, nil 84 } 85 86 func encodeFixed64Generated(data []byte, offset int, v uint64) int { 87 data[offset] = uint8(v) 88 data[offset+1] = uint8(v >> 8) 89 data[offset+2] = uint8(v >> 16) 90 data[offset+3] = uint8(v >> 24) 91 data[offset+4] = uint8(v >> 32) 92 data[offset+5] = uint8(v >> 40) 93 data[offset+6] = uint8(v >> 48) 94 data[offset+7] = uint8(v >> 56) 95 return offset + 8 96 } 97 func encodeFixed32Generated(data []byte, offset int, v uint32) int { 98 data[offset] = uint8(v) 99 data[offset+1] = uint8(v >> 8) 100 data[offset+2] = uint8(v >> 16) 101 data[offset+3] = uint8(v >> 24) 102 return offset + 4 103 } 104 func encodeVarintGenerated(data []byte, offset int, v uint64) int { 105 for v >= 1<<7 { 106 data[offset] = uint8(v&0x7f | 0x80) 107 v >>= 7 108 offset++ 109 } 110 data[offset] = uint8(v) 111 return offset + 1 112 } 113 func (m *QuantityProto) Size() (n int) { 114 var l int 115 _ = l 116 l = len(m.Format) 117 n += 1 + l + sovGenerated(uint64(l)) 118 n += 1 + sovGenerated(uint64(m.Scale)) 119 if m.Bigint != nil { 120 l = len(m.Bigint) 121 n += 1 + l + sovGenerated(uint64(l)) 122 } 123 return n 124 } 125 126 func sovGenerated(x uint64) (n int) { 127 for { 128 n++ 129 x >>= 7 130 if x == 0 { 131 break 132 } 133 } 134 return n 135 } 136 func sozGenerated(x uint64) (n int) { 137 return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 138 } 139 func (m *QuantityProto) Unmarshal(data []byte) error { 140 l := len(data) 141 iNdEx := 0 142 for iNdEx < l { 143 preIndex := iNdEx 144 var wire uint64 145 for shift := uint(0); ; shift += 7 { 146 if shift >= 64 { 147 return ErrIntOverflowGenerated 148 } 149 if iNdEx >= l { 150 return io.ErrUnexpectedEOF 151 } 152 b := data[iNdEx] 153 iNdEx++ 154 wire |= (uint64(b) & 0x7F) << shift 155 if b < 0x80 { 156 break 157 } 158 } 159 fieldNum := int32(wire >> 3) 160 wireType := int(wire & 0x7) 161 if wireType == 4 { 162 return fmt.Errorf("proto: QuantityProto: wiretype end group for non-group") 163 } 164 if fieldNum <= 0 { 165 return fmt.Errorf("proto: QuantityProto: illegal tag %d (wire type %d)", fieldNum, wire) 166 } 167 switch fieldNum { 168 case 1: 169 if wireType != 2 { 170 return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) 171 } 172 var stringLen uint64 173 for shift := uint(0); ; shift += 7 { 174 if shift >= 64 { 175 return ErrIntOverflowGenerated 176 } 177 if iNdEx >= l { 178 return io.ErrUnexpectedEOF 179 } 180 b := data[iNdEx] 181 iNdEx++ 182 stringLen |= (uint64(b) & 0x7F) << shift 183 if b < 0x80 { 184 break 185 } 186 } 187 intStringLen := int(stringLen) 188 if intStringLen < 0 { 189 return ErrInvalidLengthGenerated 190 } 191 postIndex := iNdEx + intStringLen 192 if postIndex > l { 193 return io.ErrUnexpectedEOF 194 } 195 m.Format = Format(data[iNdEx:postIndex]) 196 iNdEx = postIndex 197 case 2: 198 if wireType != 0 { 199 return fmt.Errorf("proto: wrong wireType = %d for field Scale", wireType) 200 } 201 m.Scale = 0 202 for shift := uint(0); ; shift += 7 { 203 if shift >= 64 { 204 return ErrIntOverflowGenerated 205 } 206 if iNdEx >= l { 207 return io.ErrUnexpectedEOF 208 } 209 b := data[iNdEx] 210 iNdEx++ 211 m.Scale |= (int32(b) & 0x7F) << shift 212 if b < 0x80 { 213 break 214 } 215 } 216 case 3: 217 if wireType != 2 { 218 return fmt.Errorf("proto: wrong wireType = %d for field Bigint", wireType) 219 } 220 var byteLen int 221 for shift := uint(0); ; shift += 7 { 222 if shift >= 64 { 223 return ErrIntOverflowGenerated 224 } 225 if iNdEx >= l { 226 return io.ErrUnexpectedEOF 227 } 228 b := data[iNdEx] 229 iNdEx++ 230 byteLen |= (int(b) & 0x7F) << shift 231 if b < 0x80 { 232 break 233 } 234 } 235 if byteLen < 0 { 236 return ErrInvalidLengthGenerated 237 } 238 postIndex := iNdEx + byteLen 239 if postIndex > l { 240 return io.ErrUnexpectedEOF 241 } 242 m.Bigint = append(m.Bigint[:0], data[iNdEx:postIndex]...) 243 if m.Bigint == nil { 244 m.Bigint = []byte{} 245 } 246 iNdEx = postIndex 247 default: 248 iNdEx = preIndex 249 skippy, err := skipGenerated(data[iNdEx:]) 250 if err != nil { 251 return err 252 } 253 if skippy < 0 { 254 return ErrInvalidLengthGenerated 255 } 256 if (iNdEx + skippy) > l { 257 return io.ErrUnexpectedEOF 258 } 259 iNdEx += skippy 260 } 261 } 262 263 if iNdEx > l { 264 return io.ErrUnexpectedEOF 265 } 266 return nil 267 } 268 func skipGenerated(data []byte) (n int, err error) { 269 l := len(data) 270 iNdEx := 0 271 for iNdEx < l { 272 var wire uint64 273 for shift := uint(0); ; shift += 7 { 274 if shift >= 64 { 275 return 0, ErrIntOverflowGenerated 276 } 277 if iNdEx >= l { 278 return 0, io.ErrUnexpectedEOF 279 } 280 b := data[iNdEx] 281 iNdEx++ 282 wire |= (uint64(b) & 0x7F) << shift 283 if b < 0x80 { 284 break 285 } 286 } 287 wireType := int(wire & 0x7) 288 switch wireType { 289 case 0: 290 for shift := uint(0); ; shift += 7 { 291 if shift >= 64 { 292 return 0, ErrIntOverflowGenerated 293 } 294 if iNdEx >= l { 295 return 0, io.ErrUnexpectedEOF 296 } 297 iNdEx++ 298 if data[iNdEx-1] < 0x80 { 299 break 300 } 301 } 302 return iNdEx, nil 303 case 1: 304 iNdEx += 8 305 return iNdEx, nil 306 case 2: 307 var length int 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 b := data[iNdEx] 316 iNdEx++ 317 length |= (int(b) & 0x7F) << shift 318 if b < 0x80 { 319 break 320 } 321 } 322 iNdEx += length 323 if length < 0 { 324 return 0, ErrInvalidLengthGenerated 325 } 326 return iNdEx, nil 327 case 3: 328 for { 329 var innerWire uint64 330 var start int = iNdEx 331 for shift := uint(0); ; shift += 7 { 332 if shift >= 64 { 333 return 0, ErrIntOverflowGenerated 334 } 335 if iNdEx >= l { 336 return 0, io.ErrUnexpectedEOF 337 } 338 b := data[iNdEx] 339 iNdEx++ 340 innerWire |= (uint64(b) & 0x7F) << shift 341 if b < 0x80 { 342 break 343 } 344 } 345 innerWireType := int(innerWire & 0x7) 346 if innerWireType == 4 { 347 break 348 } 349 next, err := skipGenerated(data[start:]) 350 if err != nil { 351 return 0, err 352 } 353 iNdEx = start + next 354 } 355 return iNdEx, nil 356 case 4: 357 return iNdEx, nil 358 case 5: 359 iNdEx += 4 360 return iNdEx, nil 361 default: 362 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 363 } 364 } 365 panic("unreachable") 366 } 367 368 var ( 369 ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") 370 ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") 371 )