generated.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  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/api/scheduling/v1/generated.proto
  15. package v1
  16. import (
  17. fmt "fmt"
  18. io "io"
  19. k8s_io_api_core_v1 "k8s.io/api/core/v1"
  20. math_bits "math/bits"
  21. reflect "reflect"
  22. strings "strings"
  23. )
  24. func (m *PriorityClass) Reset() { *m = PriorityClass{} }
  25. func (m *PriorityClassList) Reset() { *m = PriorityClassList{} }
  26. func (m *PriorityClass) Marshal() (dAtA []byte, err error) {
  27. size := m.Size()
  28. dAtA = make([]byte, size)
  29. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  30. if err != nil {
  31. return nil, err
  32. }
  33. return dAtA[:n], nil
  34. }
  35. func (m *PriorityClass) MarshalTo(dAtA []byte) (int, error) {
  36. size := m.Size()
  37. return m.MarshalToSizedBuffer(dAtA[:size])
  38. }
  39. func (m *PriorityClass) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  40. i := len(dAtA)
  41. _ = i
  42. var l int
  43. _ = l
  44. if m.PreemptionPolicy != nil {
  45. i -= len(*m.PreemptionPolicy)
  46. copy(dAtA[i:], *m.PreemptionPolicy)
  47. i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreemptionPolicy)))
  48. i--
  49. dAtA[i] = 0x2a
  50. }
  51. i -= len(m.Description)
  52. copy(dAtA[i:], m.Description)
  53. i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description)))
  54. i--
  55. dAtA[i] = 0x22
  56. i--
  57. if m.GlobalDefault {
  58. dAtA[i] = 1
  59. } else {
  60. dAtA[i] = 0
  61. }
  62. i--
  63. dAtA[i] = 0x18
  64. i = encodeVarintGenerated(dAtA, i, uint64(m.Value))
  65. i--
  66. dAtA[i] = 0x10
  67. {
  68. size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
  69. if err != nil {
  70. return 0, err
  71. }
  72. i -= size
  73. i = encodeVarintGenerated(dAtA, i, uint64(size))
  74. }
  75. i--
  76. dAtA[i] = 0xa
  77. return len(dAtA) - i, nil
  78. }
  79. func (m *PriorityClassList) Marshal() (dAtA []byte, err error) {
  80. size := m.Size()
  81. dAtA = make([]byte, size)
  82. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  83. if err != nil {
  84. return nil, err
  85. }
  86. return dAtA[:n], nil
  87. }
  88. func (m *PriorityClassList) MarshalTo(dAtA []byte) (int, error) {
  89. size := m.Size()
  90. return m.MarshalToSizedBuffer(dAtA[:size])
  91. }
  92. func (m *PriorityClassList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  93. i := len(dAtA)
  94. _ = i
  95. var l int
  96. _ = l
  97. if len(m.Items) > 0 {
  98. for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
  99. {
  100. size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  101. if err != nil {
  102. return 0, err
  103. }
  104. i -= size
  105. i = encodeVarintGenerated(dAtA, i, uint64(size))
  106. }
  107. i--
  108. dAtA[i] = 0x12
  109. }
  110. }
  111. {
  112. size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
  113. if err != nil {
  114. return 0, err
  115. }
  116. i -= size
  117. i = encodeVarintGenerated(dAtA, i, uint64(size))
  118. }
  119. i--
  120. dAtA[i] = 0xa
  121. return len(dAtA) - i, nil
  122. }
  123. func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
  124. offset -= sovGenerated(v)
  125. base := offset
  126. for v >= 1<<7 {
  127. dAtA[offset] = uint8(v&0x7f | 0x80)
  128. v >>= 7
  129. offset++
  130. }
  131. dAtA[offset] = uint8(v)
  132. return base
  133. }
  134. func (m *PriorityClass) Size() (n int) {
  135. if m == nil {
  136. return 0
  137. }
  138. var l int
  139. _ = l
  140. l = m.ObjectMeta.Size()
  141. n += 1 + l + sovGenerated(uint64(l))
  142. n += 1 + sovGenerated(uint64(m.Value))
  143. n += 2
  144. l = len(m.Description)
  145. n += 1 + l + sovGenerated(uint64(l))
  146. if m.PreemptionPolicy != nil {
  147. l = len(*m.PreemptionPolicy)
  148. n += 1 + l + sovGenerated(uint64(l))
  149. }
  150. return n
  151. }
  152. func (m *PriorityClassList) Size() (n int) {
  153. if m == nil {
  154. return 0
  155. }
  156. var l int
  157. _ = l
  158. l = m.ListMeta.Size()
  159. n += 1 + l + sovGenerated(uint64(l))
  160. if len(m.Items) > 0 {
  161. for _, e := range m.Items {
  162. l = e.Size()
  163. n += 1 + l + sovGenerated(uint64(l))
  164. }
  165. }
  166. return n
  167. }
  168. func sovGenerated(x uint64) (n int) {
  169. return (math_bits.Len64(x|1) + 6) / 7
  170. }
  171. func sozGenerated(x uint64) (n int) {
  172. return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  173. }
  174. func (this *PriorityClass) String() string {
  175. if this == nil {
  176. return "nil"
  177. }
  178. s := strings.Join([]string{`&PriorityClass{`,
  179. `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
  180. `Value:` + fmt.Sprintf("%v", this.Value) + `,`,
  181. `GlobalDefault:` + fmt.Sprintf("%v", this.GlobalDefault) + `,`,
  182. `Description:` + fmt.Sprintf("%v", this.Description) + `,`,
  183. `PreemptionPolicy:` + valueToStringGenerated(this.PreemptionPolicy) + `,`,
  184. `}`,
  185. }, "")
  186. return s
  187. }
  188. func (this *PriorityClassList) String() string {
  189. if this == nil {
  190. return "nil"
  191. }
  192. repeatedStringForItems := "[]PriorityClass{"
  193. for _, f := range this.Items {
  194. repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "PriorityClass", "PriorityClass", 1), `&`, ``, 1) + ","
  195. }
  196. repeatedStringForItems += "}"
  197. s := strings.Join([]string{`&PriorityClassList{`,
  198. `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
  199. `Items:` + repeatedStringForItems + `,`,
  200. `}`,
  201. }, "")
  202. return s
  203. }
  204. func valueToStringGenerated(v interface{}) string {
  205. rv := reflect.ValueOf(v)
  206. if rv.IsNil() {
  207. return "nil"
  208. }
  209. pv := reflect.Indirect(rv).Interface()
  210. return fmt.Sprintf("*%v", pv)
  211. }
  212. func (m *PriorityClass) Unmarshal(dAtA []byte) error {
  213. l := len(dAtA)
  214. iNdEx := 0
  215. for iNdEx < l {
  216. preIndex := iNdEx
  217. var wire uint64
  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. wire |= uint64(b&0x7F) << shift
  228. if b < 0x80 {
  229. break
  230. }
  231. }
  232. fieldNum := int32(wire >> 3)
  233. wireType := int(wire & 0x7)
  234. if wireType == 4 {
  235. return fmt.Errorf("proto: PriorityClass: wiretype end group for non-group")
  236. }
  237. if fieldNum <= 0 {
  238. return fmt.Errorf("proto: PriorityClass: illegal tag %d (wire type %d)", fieldNum, wire)
  239. }
  240. switch fieldNum {
  241. case 1:
  242. if wireType != 2 {
  243. return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
  244. }
  245. var msglen int
  246. for shift := uint(0); ; shift += 7 {
  247. if shift >= 64 {
  248. return ErrIntOverflowGenerated
  249. }
  250. if iNdEx >= l {
  251. return io.ErrUnexpectedEOF
  252. }
  253. b := dAtA[iNdEx]
  254. iNdEx++
  255. msglen |= int(b&0x7F) << shift
  256. if b < 0x80 {
  257. break
  258. }
  259. }
  260. if msglen < 0 {
  261. return ErrInvalidLengthGenerated
  262. }
  263. postIndex := iNdEx + msglen
  264. if postIndex < 0 {
  265. return ErrInvalidLengthGenerated
  266. }
  267. if postIndex > l {
  268. return io.ErrUnexpectedEOF
  269. }
  270. if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  271. return err
  272. }
  273. iNdEx = postIndex
  274. case 2:
  275. if wireType != 0 {
  276. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  277. }
  278. m.Value = 0
  279. for shift := uint(0); ; shift += 7 {
  280. if shift >= 64 {
  281. return ErrIntOverflowGenerated
  282. }
  283. if iNdEx >= l {
  284. return io.ErrUnexpectedEOF
  285. }
  286. b := dAtA[iNdEx]
  287. iNdEx++
  288. m.Value |= int32(b&0x7F) << shift
  289. if b < 0x80 {
  290. break
  291. }
  292. }
  293. case 3:
  294. if wireType != 0 {
  295. return fmt.Errorf("proto: wrong wireType = %d for field GlobalDefault", wireType)
  296. }
  297. var v int
  298. for shift := uint(0); ; shift += 7 {
  299. if shift >= 64 {
  300. return ErrIntOverflowGenerated
  301. }
  302. if iNdEx >= l {
  303. return io.ErrUnexpectedEOF
  304. }
  305. b := dAtA[iNdEx]
  306. iNdEx++
  307. v |= int(b&0x7F) << shift
  308. if b < 0x80 {
  309. break
  310. }
  311. }
  312. m.GlobalDefault = bool(v != 0)
  313. case 4:
  314. if wireType != 2 {
  315. return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType)
  316. }
  317. var stringLen uint64
  318. for shift := uint(0); ; shift += 7 {
  319. if shift >= 64 {
  320. return ErrIntOverflowGenerated
  321. }
  322. if iNdEx >= l {
  323. return io.ErrUnexpectedEOF
  324. }
  325. b := dAtA[iNdEx]
  326. iNdEx++
  327. stringLen |= uint64(b&0x7F) << shift
  328. if b < 0x80 {
  329. break
  330. }
  331. }
  332. intStringLen := int(stringLen)
  333. if intStringLen < 0 {
  334. return ErrInvalidLengthGenerated
  335. }
  336. postIndex := iNdEx + intStringLen
  337. if postIndex < 0 {
  338. return ErrInvalidLengthGenerated
  339. }
  340. if postIndex > l {
  341. return io.ErrUnexpectedEOF
  342. }
  343. m.Description = string(dAtA[iNdEx:postIndex])
  344. iNdEx = postIndex
  345. case 5:
  346. if wireType != 2 {
  347. return fmt.Errorf("proto: wrong wireType = %d for field PreemptionPolicy", wireType)
  348. }
  349. var stringLen uint64
  350. for shift := uint(0); ; shift += 7 {
  351. if shift >= 64 {
  352. return ErrIntOverflowGenerated
  353. }
  354. if iNdEx >= l {
  355. return io.ErrUnexpectedEOF
  356. }
  357. b := dAtA[iNdEx]
  358. iNdEx++
  359. stringLen |= uint64(b&0x7F) << shift
  360. if b < 0x80 {
  361. break
  362. }
  363. }
  364. intStringLen := int(stringLen)
  365. if intStringLen < 0 {
  366. return ErrInvalidLengthGenerated
  367. }
  368. postIndex := iNdEx + intStringLen
  369. if postIndex < 0 {
  370. return ErrInvalidLengthGenerated
  371. }
  372. if postIndex > l {
  373. return io.ErrUnexpectedEOF
  374. }
  375. s := k8s_io_api_core_v1.PreemptionPolicy(dAtA[iNdEx:postIndex])
  376. m.PreemptionPolicy = &s
  377. iNdEx = postIndex
  378. default:
  379. iNdEx = preIndex
  380. skippy, err := skipGenerated(dAtA[iNdEx:])
  381. if err != nil {
  382. return err
  383. }
  384. if (skippy < 0) || (iNdEx+skippy) < 0 {
  385. return ErrInvalidLengthGenerated
  386. }
  387. if (iNdEx + skippy) > l {
  388. return io.ErrUnexpectedEOF
  389. }
  390. iNdEx += skippy
  391. }
  392. }
  393. if iNdEx > l {
  394. return io.ErrUnexpectedEOF
  395. }
  396. return nil
  397. }
  398. func (m *PriorityClassList) Unmarshal(dAtA []byte) error {
  399. l := len(dAtA)
  400. iNdEx := 0
  401. for iNdEx < l {
  402. preIndex := iNdEx
  403. var wire uint64
  404. for shift := uint(0); ; shift += 7 {
  405. if shift >= 64 {
  406. return ErrIntOverflowGenerated
  407. }
  408. if iNdEx >= l {
  409. return io.ErrUnexpectedEOF
  410. }
  411. b := dAtA[iNdEx]
  412. iNdEx++
  413. wire |= uint64(b&0x7F) << shift
  414. if b < 0x80 {
  415. break
  416. }
  417. }
  418. fieldNum := int32(wire >> 3)
  419. wireType := int(wire & 0x7)
  420. if wireType == 4 {
  421. return fmt.Errorf("proto: PriorityClassList: wiretype end group for non-group")
  422. }
  423. if fieldNum <= 0 {
  424. return fmt.Errorf("proto: PriorityClassList: illegal tag %d (wire type %d)", fieldNum, wire)
  425. }
  426. switch fieldNum {
  427. case 1:
  428. if wireType != 2 {
  429. return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
  430. }
  431. var msglen int
  432. for shift := uint(0); ; shift += 7 {
  433. if shift >= 64 {
  434. return ErrIntOverflowGenerated
  435. }
  436. if iNdEx >= l {
  437. return io.ErrUnexpectedEOF
  438. }
  439. b := dAtA[iNdEx]
  440. iNdEx++
  441. msglen |= int(b&0x7F) << shift
  442. if b < 0x80 {
  443. break
  444. }
  445. }
  446. if msglen < 0 {
  447. return ErrInvalidLengthGenerated
  448. }
  449. postIndex := iNdEx + msglen
  450. if postIndex < 0 {
  451. return ErrInvalidLengthGenerated
  452. }
  453. if postIndex > l {
  454. return io.ErrUnexpectedEOF
  455. }
  456. if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  457. return err
  458. }
  459. iNdEx = postIndex
  460. case 2:
  461. if wireType != 2 {
  462. return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
  463. }
  464. var msglen int
  465. for shift := uint(0); ; shift += 7 {
  466. if shift >= 64 {
  467. return ErrIntOverflowGenerated
  468. }
  469. if iNdEx >= l {
  470. return io.ErrUnexpectedEOF
  471. }
  472. b := dAtA[iNdEx]
  473. iNdEx++
  474. msglen |= int(b&0x7F) << shift
  475. if b < 0x80 {
  476. break
  477. }
  478. }
  479. if msglen < 0 {
  480. return ErrInvalidLengthGenerated
  481. }
  482. postIndex := iNdEx + msglen
  483. if postIndex < 0 {
  484. return ErrInvalidLengthGenerated
  485. }
  486. if postIndex > l {
  487. return io.ErrUnexpectedEOF
  488. }
  489. m.Items = append(m.Items, PriorityClass{})
  490. if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  491. return err
  492. }
  493. iNdEx = postIndex
  494. default:
  495. iNdEx = preIndex
  496. skippy, err := skipGenerated(dAtA[iNdEx:])
  497. if err != nil {
  498. return err
  499. }
  500. if (skippy < 0) || (iNdEx+skippy) < 0 {
  501. return ErrInvalidLengthGenerated
  502. }
  503. if (iNdEx + skippy) > l {
  504. return io.ErrUnexpectedEOF
  505. }
  506. iNdEx += skippy
  507. }
  508. }
  509. if iNdEx > l {
  510. return io.ErrUnexpectedEOF
  511. }
  512. return nil
  513. }
  514. func skipGenerated(dAtA []byte) (n int, err error) {
  515. l := len(dAtA)
  516. iNdEx := 0
  517. depth := 0
  518. for iNdEx < l {
  519. var wire uint64
  520. for shift := uint(0); ; shift += 7 {
  521. if shift >= 64 {
  522. return 0, ErrIntOverflowGenerated
  523. }
  524. if iNdEx >= l {
  525. return 0, io.ErrUnexpectedEOF
  526. }
  527. b := dAtA[iNdEx]
  528. iNdEx++
  529. wire |= (uint64(b) & 0x7F) << shift
  530. if b < 0x80 {
  531. break
  532. }
  533. }
  534. wireType := int(wire & 0x7)
  535. switch wireType {
  536. case 0:
  537. for shift := uint(0); ; shift += 7 {
  538. if shift >= 64 {
  539. return 0, ErrIntOverflowGenerated
  540. }
  541. if iNdEx >= l {
  542. return 0, io.ErrUnexpectedEOF
  543. }
  544. iNdEx++
  545. if dAtA[iNdEx-1] < 0x80 {
  546. break
  547. }
  548. }
  549. case 1:
  550. iNdEx += 8
  551. case 2:
  552. var length int
  553. for shift := uint(0); ; shift += 7 {
  554. if shift >= 64 {
  555. return 0, ErrIntOverflowGenerated
  556. }
  557. if iNdEx >= l {
  558. return 0, io.ErrUnexpectedEOF
  559. }
  560. b := dAtA[iNdEx]
  561. iNdEx++
  562. length |= (int(b) & 0x7F) << shift
  563. if b < 0x80 {
  564. break
  565. }
  566. }
  567. if length < 0 {
  568. return 0, ErrInvalidLengthGenerated
  569. }
  570. iNdEx += length
  571. case 3:
  572. depth++
  573. case 4:
  574. if depth == 0 {
  575. return 0, ErrUnexpectedEndOfGroupGenerated
  576. }
  577. depth--
  578. case 5:
  579. iNdEx += 4
  580. default:
  581. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  582. }
  583. if iNdEx < 0 {
  584. return 0, ErrInvalidLengthGenerated
  585. }
  586. if depth == 0 {
  587. return iNdEx, nil
  588. }
  589. }
  590. return 0, io.ErrUnexpectedEOF
  591. }
  592. var (
  593. ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
  594. ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
  595. ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
  596. )