github.com/aclisp/heapster@v0.19.2-0.20160613100040-51756f899a96/Godeps/_workspace/src/k8s.io/kubernetes/pkg/util/intstr/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/util/intstr/generated.proto
    19  // DO NOT EDIT!
    20  
    21  /*
    22  	Package intstr is a generated protocol buffer package.
    23  
    24  	It is generated from these files:
    25  		k8s.io/kubernetes/pkg/util/intstr/generated.proto
    26  
    27  	It has these top-level messages:
    28  		IntOrString
    29  */
    30  package intstr
    31  
    32  import proto "github.com/gogo/protobuf/proto"
    33  import fmt "fmt"
    34  import math "math"
    35  
    36  import io "io"
    37  
    38  // Reference imports to suppress errors if they are not otherwise used.
    39  var _ = proto.Marshal
    40  var _ = fmt.Errorf
    41  var _ = math.Inf
    42  
    43  func (m *IntOrString) Reset()      { *m = IntOrString{} }
    44  func (*IntOrString) ProtoMessage() {}
    45  
    46  func init() {
    47  	proto.RegisterType((*IntOrString)(nil), "k8s.io.kubernetes.pkg.util.intstr.IntOrString")
    48  }
    49  func (m *IntOrString) Marshal() (data []byte, err error) {
    50  	size := m.Size()
    51  	data = make([]byte, size)
    52  	n, err := m.MarshalTo(data)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return data[:n], nil
    57  }
    58  
    59  func (m *IntOrString) MarshalTo(data []byte) (int, error) {
    60  	var i int
    61  	_ = i
    62  	var l int
    63  	_ = l
    64  	data[i] = 0x8
    65  	i++
    66  	i = encodeVarintGenerated(data, i, uint64(m.Type))
    67  	data[i] = 0x10
    68  	i++
    69  	i = encodeVarintGenerated(data, i, uint64(m.IntVal))
    70  	data[i] = 0x1a
    71  	i++
    72  	i = encodeVarintGenerated(data, i, uint64(len(m.StrVal)))
    73  	i += copy(data[i:], m.StrVal)
    74  	return i, nil
    75  }
    76  
    77  func encodeFixed64Generated(data []byte, offset int, v uint64) int {
    78  	data[offset] = uint8(v)
    79  	data[offset+1] = uint8(v >> 8)
    80  	data[offset+2] = uint8(v >> 16)
    81  	data[offset+3] = uint8(v >> 24)
    82  	data[offset+4] = uint8(v >> 32)
    83  	data[offset+5] = uint8(v >> 40)
    84  	data[offset+6] = uint8(v >> 48)
    85  	data[offset+7] = uint8(v >> 56)
    86  	return offset + 8
    87  }
    88  func encodeFixed32Generated(data []byte, offset int, v uint32) int {
    89  	data[offset] = uint8(v)
    90  	data[offset+1] = uint8(v >> 8)
    91  	data[offset+2] = uint8(v >> 16)
    92  	data[offset+3] = uint8(v >> 24)
    93  	return offset + 4
    94  }
    95  func encodeVarintGenerated(data []byte, offset int, v uint64) int {
    96  	for v >= 1<<7 {
    97  		data[offset] = uint8(v&0x7f | 0x80)
    98  		v >>= 7
    99  		offset++
   100  	}
   101  	data[offset] = uint8(v)
   102  	return offset + 1
   103  }
   104  func (m *IntOrString) Size() (n int) {
   105  	var l int
   106  	_ = l
   107  	n += 1 + sovGenerated(uint64(m.Type))
   108  	n += 1 + sovGenerated(uint64(m.IntVal))
   109  	l = len(m.StrVal)
   110  	n += 1 + l + sovGenerated(uint64(l))
   111  	return n
   112  }
   113  
   114  func sovGenerated(x uint64) (n int) {
   115  	for {
   116  		n++
   117  		x >>= 7
   118  		if x == 0 {
   119  			break
   120  		}
   121  	}
   122  	return n
   123  }
   124  func sozGenerated(x uint64) (n int) {
   125  	return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   126  }
   127  func (m *IntOrString) Unmarshal(data []byte) error {
   128  	l := len(data)
   129  	iNdEx := 0
   130  	for iNdEx < l {
   131  		preIndex := iNdEx
   132  		var wire uint64
   133  		for shift := uint(0); ; shift += 7 {
   134  			if shift >= 64 {
   135  				return ErrIntOverflowGenerated
   136  			}
   137  			if iNdEx >= l {
   138  				return io.ErrUnexpectedEOF
   139  			}
   140  			b := data[iNdEx]
   141  			iNdEx++
   142  			wire |= (uint64(b) & 0x7F) << shift
   143  			if b < 0x80 {
   144  				break
   145  			}
   146  		}
   147  		fieldNum := int32(wire >> 3)
   148  		wireType := int(wire & 0x7)
   149  		if wireType == 4 {
   150  			return fmt.Errorf("proto: IntOrString: wiretype end group for non-group")
   151  		}
   152  		if fieldNum <= 0 {
   153  			return fmt.Errorf("proto: IntOrString: illegal tag %d (wire type %d)", fieldNum, wire)
   154  		}
   155  		switch fieldNum {
   156  		case 1:
   157  			if wireType != 0 {
   158  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
   159  			}
   160  			m.Type = 0
   161  			for shift := uint(0); ; shift += 7 {
   162  				if shift >= 64 {
   163  					return ErrIntOverflowGenerated
   164  				}
   165  				if iNdEx >= l {
   166  					return io.ErrUnexpectedEOF
   167  				}
   168  				b := data[iNdEx]
   169  				iNdEx++
   170  				m.Type |= (Type(b) & 0x7F) << shift
   171  				if b < 0x80 {
   172  					break
   173  				}
   174  			}
   175  		case 2:
   176  			if wireType != 0 {
   177  				return fmt.Errorf("proto: wrong wireType = %d for field IntVal", wireType)
   178  			}
   179  			m.IntVal = 0
   180  			for shift := uint(0); ; shift += 7 {
   181  				if shift >= 64 {
   182  					return ErrIntOverflowGenerated
   183  				}
   184  				if iNdEx >= l {
   185  					return io.ErrUnexpectedEOF
   186  				}
   187  				b := data[iNdEx]
   188  				iNdEx++
   189  				m.IntVal |= (int32(b) & 0x7F) << shift
   190  				if b < 0x80 {
   191  					break
   192  				}
   193  			}
   194  		case 3:
   195  			if wireType != 2 {
   196  				return fmt.Errorf("proto: wrong wireType = %d for field StrVal", wireType)
   197  			}
   198  			var stringLen uint64
   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  				stringLen |= (uint64(b) & 0x7F) << shift
   209  				if b < 0x80 {
   210  					break
   211  				}
   212  			}
   213  			intStringLen := int(stringLen)
   214  			if intStringLen < 0 {
   215  				return ErrInvalidLengthGenerated
   216  			}
   217  			postIndex := iNdEx + intStringLen
   218  			if postIndex > l {
   219  				return io.ErrUnexpectedEOF
   220  			}
   221  			m.StrVal = string(data[iNdEx:postIndex])
   222  			iNdEx = postIndex
   223  		default:
   224  			iNdEx = preIndex
   225  			skippy, err := skipGenerated(data[iNdEx:])
   226  			if err != nil {
   227  				return err
   228  			}
   229  			if skippy < 0 {
   230  				return ErrInvalidLengthGenerated
   231  			}
   232  			if (iNdEx + skippy) > l {
   233  				return io.ErrUnexpectedEOF
   234  			}
   235  			iNdEx += skippy
   236  		}
   237  	}
   238  
   239  	if iNdEx > l {
   240  		return io.ErrUnexpectedEOF
   241  	}
   242  	return nil
   243  }
   244  func skipGenerated(data []byte) (n int, err error) {
   245  	l := len(data)
   246  	iNdEx := 0
   247  	for iNdEx < l {
   248  		var wire uint64
   249  		for shift := uint(0); ; shift += 7 {
   250  			if shift >= 64 {
   251  				return 0, ErrIntOverflowGenerated
   252  			}
   253  			if iNdEx >= l {
   254  				return 0, io.ErrUnexpectedEOF
   255  			}
   256  			b := data[iNdEx]
   257  			iNdEx++
   258  			wire |= (uint64(b) & 0x7F) << shift
   259  			if b < 0x80 {
   260  				break
   261  			}
   262  		}
   263  		wireType := int(wire & 0x7)
   264  		switch wireType {
   265  		case 0:
   266  			for shift := uint(0); ; shift += 7 {
   267  				if shift >= 64 {
   268  					return 0, ErrIntOverflowGenerated
   269  				}
   270  				if iNdEx >= l {
   271  					return 0, io.ErrUnexpectedEOF
   272  				}
   273  				iNdEx++
   274  				if data[iNdEx-1] < 0x80 {
   275  					break
   276  				}
   277  			}
   278  			return iNdEx, nil
   279  		case 1:
   280  			iNdEx += 8
   281  			return iNdEx, nil
   282  		case 2:
   283  			var length int
   284  			for shift := uint(0); ; shift += 7 {
   285  				if shift >= 64 {
   286  					return 0, ErrIntOverflowGenerated
   287  				}
   288  				if iNdEx >= l {
   289  					return 0, io.ErrUnexpectedEOF
   290  				}
   291  				b := data[iNdEx]
   292  				iNdEx++
   293  				length |= (int(b) & 0x7F) << shift
   294  				if b < 0x80 {
   295  					break
   296  				}
   297  			}
   298  			iNdEx += length
   299  			if length < 0 {
   300  				return 0, ErrInvalidLengthGenerated
   301  			}
   302  			return iNdEx, nil
   303  		case 3:
   304  			for {
   305  				var innerWire uint64
   306  				var start int = iNdEx
   307  				for shift := uint(0); ; shift += 7 {
   308  					if shift >= 64 {
   309  						return 0, ErrIntOverflowGenerated
   310  					}
   311  					if iNdEx >= l {
   312  						return 0, io.ErrUnexpectedEOF
   313  					}
   314  					b := data[iNdEx]
   315  					iNdEx++
   316  					innerWire |= (uint64(b) & 0x7F) << shift
   317  					if b < 0x80 {
   318  						break
   319  					}
   320  				}
   321  				innerWireType := int(innerWire & 0x7)
   322  				if innerWireType == 4 {
   323  					break
   324  				}
   325  				next, err := skipGenerated(data[start:])
   326  				if err != nil {
   327  					return 0, err
   328  				}
   329  				iNdEx = start + next
   330  			}
   331  			return iNdEx, nil
   332  		case 4:
   333  			return iNdEx, nil
   334  		case 5:
   335  			iNdEx += 4
   336  			return iNdEx, nil
   337  		default:
   338  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   339  		}
   340  	}
   341  	panic("unreachable")
   342  }
   343  
   344  var (
   345  	ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
   346  	ErrIntOverflowGenerated   = fmt.Errorf("proto: integer overflow")
   347  )