generated.pb.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  14. // source: k8s.io/apimachinery/pkg/util/intstr/generated.proto
  15. package intstr
  16. import (
  17. fmt "fmt"
  18. io "io"
  19. math_bits "math/bits"
  20. )
  21. func (m *IntOrString) Reset() { *m = IntOrString{} }
  22. func (m *IntOrString) Marshal() (dAtA []byte, err error) {
  23. size := m.Size()
  24. dAtA = make([]byte, size)
  25. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  26. if err != nil {
  27. return nil, err
  28. }
  29. return dAtA[:n], nil
  30. }
  31. func (m *IntOrString) MarshalTo(dAtA []byte) (int, error) {
  32. size := m.Size()
  33. return m.MarshalToSizedBuffer(dAtA[:size])
  34. }
  35. func (m *IntOrString) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  36. i := len(dAtA)
  37. _ = i
  38. var l int
  39. _ = l
  40. i -= len(m.StrVal)
  41. copy(dAtA[i:], m.StrVal)
  42. i = encodeVarintGenerated(dAtA, i, uint64(len(m.StrVal)))
  43. i--
  44. dAtA[i] = 0x1a
  45. i = encodeVarintGenerated(dAtA, i, uint64(m.IntVal))
  46. i--
  47. dAtA[i] = 0x10
  48. i = encodeVarintGenerated(dAtA, i, uint64(m.Type))
  49. i--
  50. dAtA[i] = 0x8
  51. return len(dAtA) - i, nil
  52. }
  53. func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
  54. offset -= sovGenerated(v)
  55. base := offset
  56. for v >= 1<<7 {
  57. dAtA[offset] = uint8(v&0x7f | 0x80)
  58. v >>= 7
  59. offset++
  60. }
  61. dAtA[offset] = uint8(v)
  62. return base
  63. }
  64. func (m *IntOrString) Size() (n int) {
  65. if m == nil {
  66. return 0
  67. }
  68. var l int
  69. _ = l
  70. n += 1 + sovGenerated(uint64(m.Type))
  71. n += 1 + sovGenerated(uint64(m.IntVal))
  72. l = len(m.StrVal)
  73. n += 1 + l + sovGenerated(uint64(l))
  74. return n
  75. }
  76. func sovGenerated(x uint64) (n int) {
  77. return (math_bits.Len64(x|1) + 6) / 7
  78. }
  79. func sozGenerated(x uint64) (n int) {
  80. return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  81. }
  82. func (m *IntOrString) Unmarshal(dAtA []byte) error {
  83. l := len(dAtA)
  84. iNdEx := 0
  85. for iNdEx < l {
  86. preIndex := iNdEx
  87. var wire uint64
  88. for shift := uint(0); ; shift += 7 {
  89. if shift >= 64 {
  90. return ErrIntOverflowGenerated
  91. }
  92. if iNdEx >= l {
  93. return io.ErrUnexpectedEOF
  94. }
  95. b := dAtA[iNdEx]
  96. iNdEx++
  97. wire |= uint64(b&0x7F) << shift
  98. if b < 0x80 {
  99. break
  100. }
  101. }
  102. fieldNum := int32(wire >> 3)
  103. wireType := int(wire & 0x7)
  104. if wireType == 4 {
  105. return fmt.Errorf("proto: IntOrString: wiretype end group for non-group")
  106. }
  107. if fieldNum <= 0 {
  108. return fmt.Errorf("proto: IntOrString: illegal tag %d (wire type %d)", fieldNum, wire)
  109. }
  110. switch fieldNum {
  111. case 1:
  112. if wireType != 0 {
  113. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  114. }
  115. m.Type = 0
  116. for shift := uint(0); ; shift += 7 {
  117. if shift >= 64 {
  118. return ErrIntOverflowGenerated
  119. }
  120. if iNdEx >= l {
  121. return io.ErrUnexpectedEOF
  122. }
  123. b := dAtA[iNdEx]
  124. iNdEx++
  125. m.Type |= Type(b&0x7F) << shift
  126. if b < 0x80 {
  127. break
  128. }
  129. }
  130. case 2:
  131. if wireType != 0 {
  132. return fmt.Errorf("proto: wrong wireType = %d for field IntVal", wireType)
  133. }
  134. m.IntVal = 0
  135. for shift := uint(0); ; shift += 7 {
  136. if shift >= 64 {
  137. return ErrIntOverflowGenerated
  138. }
  139. if iNdEx >= l {
  140. return io.ErrUnexpectedEOF
  141. }
  142. b := dAtA[iNdEx]
  143. iNdEx++
  144. m.IntVal |= int32(b&0x7F) << shift
  145. if b < 0x80 {
  146. break
  147. }
  148. }
  149. case 3:
  150. if wireType != 2 {
  151. return fmt.Errorf("proto: wrong wireType = %d for field StrVal", wireType)
  152. }
  153. var stringLen uint64
  154. for shift := uint(0); ; shift += 7 {
  155. if shift >= 64 {
  156. return ErrIntOverflowGenerated
  157. }
  158. if iNdEx >= l {
  159. return io.ErrUnexpectedEOF
  160. }
  161. b := dAtA[iNdEx]
  162. iNdEx++
  163. stringLen |= uint64(b&0x7F) << shift
  164. if b < 0x80 {
  165. break
  166. }
  167. }
  168. intStringLen := int(stringLen)
  169. if intStringLen < 0 {
  170. return ErrInvalidLengthGenerated
  171. }
  172. postIndex := iNdEx + intStringLen
  173. if postIndex < 0 {
  174. return ErrInvalidLengthGenerated
  175. }
  176. if postIndex > l {
  177. return io.ErrUnexpectedEOF
  178. }
  179. m.StrVal = string(dAtA[iNdEx:postIndex])
  180. iNdEx = postIndex
  181. default:
  182. iNdEx = preIndex
  183. skippy, err := skipGenerated(dAtA[iNdEx:])
  184. if err != nil {
  185. return err
  186. }
  187. if (skippy < 0) || (iNdEx+skippy) < 0 {
  188. return ErrInvalidLengthGenerated
  189. }
  190. if (iNdEx + skippy) > l {
  191. return io.ErrUnexpectedEOF
  192. }
  193. iNdEx += skippy
  194. }
  195. }
  196. if iNdEx > l {
  197. return io.ErrUnexpectedEOF
  198. }
  199. return nil
  200. }
  201. func skipGenerated(dAtA []byte) (n int, err error) {
  202. l := len(dAtA)
  203. iNdEx := 0
  204. depth := 0
  205. for iNdEx < l {
  206. var wire uint64
  207. for shift := uint(0); ; shift += 7 {
  208. if shift >= 64 {
  209. return 0, ErrIntOverflowGenerated
  210. }
  211. if iNdEx >= l {
  212. return 0, io.ErrUnexpectedEOF
  213. }
  214. b := dAtA[iNdEx]
  215. iNdEx++
  216. wire |= (uint64(b) & 0x7F) << shift
  217. if b < 0x80 {
  218. break
  219. }
  220. }
  221. wireType := int(wire & 0x7)
  222. switch wireType {
  223. case 0:
  224. for shift := uint(0); ; shift += 7 {
  225. if shift >= 64 {
  226. return 0, ErrIntOverflowGenerated
  227. }
  228. if iNdEx >= l {
  229. return 0, io.ErrUnexpectedEOF
  230. }
  231. iNdEx++
  232. if dAtA[iNdEx-1] < 0x80 {
  233. break
  234. }
  235. }
  236. case 1:
  237. iNdEx += 8
  238. case 2:
  239. var length int
  240. for shift := uint(0); ; shift += 7 {
  241. if shift >= 64 {
  242. return 0, ErrIntOverflowGenerated
  243. }
  244. if iNdEx >= l {
  245. return 0, io.ErrUnexpectedEOF
  246. }
  247. b := dAtA[iNdEx]
  248. iNdEx++
  249. length |= (int(b) & 0x7F) << shift
  250. if b < 0x80 {
  251. break
  252. }
  253. }
  254. if length < 0 {
  255. return 0, ErrInvalidLengthGenerated
  256. }
  257. iNdEx += length
  258. case 3:
  259. depth++
  260. case 4:
  261. if depth == 0 {
  262. return 0, ErrUnexpectedEndOfGroupGenerated
  263. }
  264. depth--
  265. case 5:
  266. iNdEx += 4
  267. default:
  268. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  269. }
  270. if iNdEx < 0 {
  271. return 0, ErrInvalidLengthGenerated
  272. }
  273. if depth == 0 {
  274. return iNdEx, nil
  275. }
  276. }
  277. return 0, io.ErrUnexpectedEOF
  278. }
  279. var (
  280. ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
  281. ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
  282. ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
  283. )