generated.pb.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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/coordination/v1alpha2/generated.proto
  15. package v1alpha2
  16. import (
  17. fmt "fmt"
  18. io "io"
  19. k8s_io_api_coordination_v1 "k8s.io/api/coordination/v1"
  20. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  21. math_bits "math/bits"
  22. reflect "reflect"
  23. strings "strings"
  24. )
  25. func (m *LeaseCandidate) Reset() { *m = LeaseCandidate{} }
  26. func (m *LeaseCandidateList) Reset() { *m = LeaseCandidateList{} }
  27. func (m *LeaseCandidateSpec) Reset() { *m = LeaseCandidateSpec{} }
  28. func (m *LeaseCandidate) Marshal() (dAtA []byte, err error) {
  29. size := m.Size()
  30. dAtA = make([]byte, size)
  31. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  32. if err != nil {
  33. return nil, err
  34. }
  35. return dAtA[:n], nil
  36. }
  37. func (m *LeaseCandidate) MarshalTo(dAtA []byte) (int, error) {
  38. size := m.Size()
  39. return m.MarshalToSizedBuffer(dAtA[:size])
  40. }
  41. func (m *LeaseCandidate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  42. i := len(dAtA)
  43. _ = i
  44. var l int
  45. _ = l
  46. {
  47. size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
  48. if err != nil {
  49. return 0, err
  50. }
  51. i -= size
  52. i = encodeVarintGenerated(dAtA, i, uint64(size))
  53. }
  54. i--
  55. dAtA[i] = 0x12
  56. {
  57. size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
  58. if err != nil {
  59. return 0, err
  60. }
  61. i -= size
  62. i = encodeVarintGenerated(dAtA, i, uint64(size))
  63. }
  64. i--
  65. dAtA[i] = 0xa
  66. return len(dAtA) - i, nil
  67. }
  68. func (m *LeaseCandidateList) Marshal() (dAtA []byte, err error) {
  69. size := m.Size()
  70. dAtA = make([]byte, size)
  71. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  72. if err != nil {
  73. return nil, err
  74. }
  75. return dAtA[:n], nil
  76. }
  77. func (m *LeaseCandidateList) MarshalTo(dAtA []byte) (int, error) {
  78. size := m.Size()
  79. return m.MarshalToSizedBuffer(dAtA[:size])
  80. }
  81. func (m *LeaseCandidateList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  82. i := len(dAtA)
  83. _ = i
  84. var l int
  85. _ = l
  86. if len(m.Items) > 0 {
  87. for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
  88. {
  89. size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  90. if err != nil {
  91. return 0, err
  92. }
  93. i -= size
  94. i = encodeVarintGenerated(dAtA, i, uint64(size))
  95. }
  96. i--
  97. dAtA[i] = 0x12
  98. }
  99. }
  100. {
  101. size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
  102. if err != nil {
  103. return 0, err
  104. }
  105. i -= size
  106. i = encodeVarintGenerated(dAtA, i, uint64(size))
  107. }
  108. i--
  109. dAtA[i] = 0xa
  110. return len(dAtA) - i, nil
  111. }
  112. func (m *LeaseCandidateSpec) Marshal() (dAtA []byte, err error) {
  113. size := m.Size()
  114. dAtA = make([]byte, size)
  115. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  116. if err != nil {
  117. return nil, err
  118. }
  119. return dAtA[:n], nil
  120. }
  121. func (m *LeaseCandidateSpec) MarshalTo(dAtA []byte) (int, error) {
  122. size := m.Size()
  123. return m.MarshalToSizedBuffer(dAtA[:size])
  124. }
  125. func (m *LeaseCandidateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  126. i := len(dAtA)
  127. _ = i
  128. var l int
  129. _ = l
  130. i -= len(m.Strategy)
  131. copy(dAtA[i:], m.Strategy)
  132. i = encodeVarintGenerated(dAtA, i, uint64(len(m.Strategy)))
  133. i--
  134. dAtA[i] = 0x32
  135. i -= len(m.EmulationVersion)
  136. copy(dAtA[i:], m.EmulationVersion)
  137. i = encodeVarintGenerated(dAtA, i, uint64(len(m.EmulationVersion)))
  138. i--
  139. dAtA[i] = 0x2a
  140. i -= len(m.BinaryVersion)
  141. copy(dAtA[i:], m.BinaryVersion)
  142. i = encodeVarintGenerated(dAtA, i, uint64(len(m.BinaryVersion)))
  143. i--
  144. dAtA[i] = 0x22
  145. if m.RenewTime != nil {
  146. {
  147. size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i])
  148. if err != nil {
  149. return 0, err
  150. }
  151. i -= size
  152. i = encodeVarintGenerated(dAtA, i, uint64(size))
  153. }
  154. i--
  155. dAtA[i] = 0x1a
  156. }
  157. if m.PingTime != nil {
  158. {
  159. size, err := m.PingTime.MarshalToSizedBuffer(dAtA[:i])
  160. if err != nil {
  161. return 0, err
  162. }
  163. i -= size
  164. i = encodeVarintGenerated(dAtA, i, uint64(size))
  165. }
  166. i--
  167. dAtA[i] = 0x12
  168. }
  169. i -= len(m.LeaseName)
  170. copy(dAtA[i:], m.LeaseName)
  171. i = encodeVarintGenerated(dAtA, i, uint64(len(m.LeaseName)))
  172. i--
  173. dAtA[i] = 0xa
  174. return len(dAtA) - i, nil
  175. }
  176. func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
  177. offset -= sovGenerated(v)
  178. base := offset
  179. for v >= 1<<7 {
  180. dAtA[offset] = uint8(v&0x7f | 0x80)
  181. v >>= 7
  182. offset++
  183. }
  184. dAtA[offset] = uint8(v)
  185. return base
  186. }
  187. func (m *LeaseCandidate) Size() (n int) {
  188. if m == nil {
  189. return 0
  190. }
  191. var l int
  192. _ = l
  193. l = m.ObjectMeta.Size()
  194. n += 1 + l + sovGenerated(uint64(l))
  195. l = m.Spec.Size()
  196. n += 1 + l + sovGenerated(uint64(l))
  197. return n
  198. }
  199. func (m *LeaseCandidateList) Size() (n int) {
  200. if m == nil {
  201. return 0
  202. }
  203. var l int
  204. _ = l
  205. l = m.ListMeta.Size()
  206. n += 1 + l + sovGenerated(uint64(l))
  207. if len(m.Items) > 0 {
  208. for _, e := range m.Items {
  209. l = e.Size()
  210. n += 1 + l + sovGenerated(uint64(l))
  211. }
  212. }
  213. return n
  214. }
  215. func (m *LeaseCandidateSpec) Size() (n int) {
  216. if m == nil {
  217. return 0
  218. }
  219. var l int
  220. _ = l
  221. l = len(m.LeaseName)
  222. n += 1 + l + sovGenerated(uint64(l))
  223. if m.PingTime != nil {
  224. l = m.PingTime.Size()
  225. n += 1 + l + sovGenerated(uint64(l))
  226. }
  227. if m.RenewTime != nil {
  228. l = m.RenewTime.Size()
  229. n += 1 + l + sovGenerated(uint64(l))
  230. }
  231. l = len(m.BinaryVersion)
  232. n += 1 + l + sovGenerated(uint64(l))
  233. l = len(m.EmulationVersion)
  234. n += 1 + l + sovGenerated(uint64(l))
  235. l = len(m.Strategy)
  236. n += 1 + l + sovGenerated(uint64(l))
  237. return n
  238. }
  239. func sovGenerated(x uint64) (n int) {
  240. return (math_bits.Len64(x|1) + 6) / 7
  241. }
  242. func sozGenerated(x uint64) (n int) {
  243. return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  244. }
  245. func (this *LeaseCandidate) String() string {
  246. if this == nil {
  247. return "nil"
  248. }
  249. s := strings.Join([]string{`&LeaseCandidate{`,
  250. `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
  251. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseCandidateSpec", "LeaseCandidateSpec", 1), `&`, ``, 1) + `,`,
  252. `}`,
  253. }, "")
  254. return s
  255. }
  256. func (this *LeaseCandidateList) String() string {
  257. if this == nil {
  258. return "nil"
  259. }
  260. repeatedStringForItems := "[]LeaseCandidate{"
  261. for _, f := range this.Items {
  262. repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "LeaseCandidate", "LeaseCandidate", 1), `&`, ``, 1) + ","
  263. }
  264. repeatedStringForItems += "}"
  265. s := strings.Join([]string{`&LeaseCandidateList{`,
  266. `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
  267. `Items:` + repeatedStringForItems + `,`,
  268. `}`,
  269. }, "")
  270. return s
  271. }
  272. func (this *LeaseCandidateSpec) String() string {
  273. if this == nil {
  274. return "nil"
  275. }
  276. s := strings.Join([]string{`&LeaseCandidateSpec{`,
  277. `LeaseName:` + fmt.Sprintf("%v", this.LeaseName) + `,`,
  278. `PingTime:` + strings.Replace(fmt.Sprintf("%v", this.PingTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  279. `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  280. `BinaryVersion:` + fmt.Sprintf("%v", this.BinaryVersion) + `,`,
  281. `EmulationVersion:` + fmt.Sprintf("%v", this.EmulationVersion) + `,`,
  282. `Strategy:` + fmt.Sprintf("%v", this.Strategy) + `,`,
  283. `}`,
  284. }, "")
  285. return s
  286. }
  287. func valueToStringGenerated(v interface{}) string {
  288. rv := reflect.ValueOf(v)
  289. if rv.IsNil() {
  290. return "nil"
  291. }
  292. pv := reflect.Indirect(rv).Interface()
  293. return fmt.Sprintf("*%v", pv)
  294. }
  295. func (m *LeaseCandidate) Unmarshal(dAtA []byte) error {
  296. l := len(dAtA)
  297. iNdEx := 0
  298. for iNdEx < l {
  299. preIndex := iNdEx
  300. var wire uint64
  301. for shift := uint(0); ; shift += 7 {
  302. if shift >= 64 {
  303. return ErrIntOverflowGenerated
  304. }
  305. if iNdEx >= l {
  306. return io.ErrUnexpectedEOF
  307. }
  308. b := dAtA[iNdEx]
  309. iNdEx++
  310. wire |= uint64(b&0x7F) << shift
  311. if b < 0x80 {
  312. break
  313. }
  314. }
  315. fieldNum := int32(wire >> 3)
  316. wireType := int(wire & 0x7)
  317. if wireType == 4 {
  318. return fmt.Errorf("proto: LeaseCandidate: wiretype end group for non-group")
  319. }
  320. if fieldNum <= 0 {
  321. return fmt.Errorf("proto: LeaseCandidate: illegal tag %d (wire type %d)", fieldNum, wire)
  322. }
  323. switch fieldNum {
  324. case 1:
  325. if wireType != 2 {
  326. return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
  327. }
  328. var msglen int
  329. for shift := uint(0); ; shift += 7 {
  330. if shift >= 64 {
  331. return ErrIntOverflowGenerated
  332. }
  333. if iNdEx >= l {
  334. return io.ErrUnexpectedEOF
  335. }
  336. b := dAtA[iNdEx]
  337. iNdEx++
  338. msglen |= int(b&0x7F) << shift
  339. if b < 0x80 {
  340. break
  341. }
  342. }
  343. if msglen < 0 {
  344. return ErrInvalidLengthGenerated
  345. }
  346. postIndex := iNdEx + msglen
  347. if postIndex < 0 {
  348. return ErrInvalidLengthGenerated
  349. }
  350. if postIndex > l {
  351. return io.ErrUnexpectedEOF
  352. }
  353. if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  354. return err
  355. }
  356. iNdEx = postIndex
  357. case 2:
  358. if wireType != 2 {
  359. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  360. }
  361. var msglen int
  362. for shift := uint(0); ; shift += 7 {
  363. if shift >= 64 {
  364. return ErrIntOverflowGenerated
  365. }
  366. if iNdEx >= l {
  367. return io.ErrUnexpectedEOF
  368. }
  369. b := dAtA[iNdEx]
  370. iNdEx++
  371. msglen |= int(b&0x7F) << shift
  372. if b < 0x80 {
  373. break
  374. }
  375. }
  376. if msglen < 0 {
  377. return ErrInvalidLengthGenerated
  378. }
  379. postIndex := iNdEx + msglen
  380. if postIndex < 0 {
  381. return ErrInvalidLengthGenerated
  382. }
  383. if postIndex > l {
  384. return io.ErrUnexpectedEOF
  385. }
  386. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  387. return err
  388. }
  389. iNdEx = postIndex
  390. default:
  391. iNdEx = preIndex
  392. skippy, err := skipGenerated(dAtA[iNdEx:])
  393. if err != nil {
  394. return err
  395. }
  396. if (skippy < 0) || (iNdEx+skippy) < 0 {
  397. return ErrInvalidLengthGenerated
  398. }
  399. if (iNdEx + skippy) > l {
  400. return io.ErrUnexpectedEOF
  401. }
  402. iNdEx += skippy
  403. }
  404. }
  405. if iNdEx > l {
  406. return io.ErrUnexpectedEOF
  407. }
  408. return nil
  409. }
  410. func (m *LeaseCandidateList) Unmarshal(dAtA []byte) error {
  411. l := len(dAtA)
  412. iNdEx := 0
  413. for iNdEx < l {
  414. preIndex := iNdEx
  415. var wire uint64
  416. for shift := uint(0); ; shift += 7 {
  417. if shift >= 64 {
  418. return ErrIntOverflowGenerated
  419. }
  420. if iNdEx >= l {
  421. return io.ErrUnexpectedEOF
  422. }
  423. b := dAtA[iNdEx]
  424. iNdEx++
  425. wire |= uint64(b&0x7F) << shift
  426. if b < 0x80 {
  427. break
  428. }
  429. }
  430. fieldNum := int32(wire >> 3)
  431. wireType := int(wire & 0x7)
  432. if wireType == 4 {
  433. return fmt.Errorf("proto: LeaseCandidateList: wiretype end group for non-group")
  434. }
  435. if fieldNum <= 0 {
  436. return fmt.Errorf("proto: LeaseCandidateList: illegal tag %d (wire type %d)", fieldNum, wire)
  437. }
  438. switch fieldNum {
  439. case 1:
  440. if wireType != 2 {
  441. return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
  442. }
  443. var msglen int
  444. for shift := uint(0); ; shift += 7 {
  445. if shift >= 64 {
  446. return ErrIntOverflowGenerated
  447. }
  448. if iNdEx >= l {
  449. return io.ErrUnexpectedEOF
  450. }
  451. b := dAtA[iNdEx]
  452. iNdEx++
  453. msglen |= int(b&0x7F) << shift
  454. if b < 0x80 {
  455. break
  456. }
  457. }
  458. if msglen < 0 {
  459. return ErrInvalidLengthGenerated
  460. }
  461. postIndex := iNdEx + msglen
  462. if postIndex < 0 {
  463. return ErrInvalidLengthGenerated
  464. }
  465. if postIndex > l {
  466. return io.ErrUnexpectedEOF
  467. }
  468. if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  469. return err
  470. }
  471. iNdEx = postIndex
  472. case 2:
  473. if wireType != 2 {
  474. return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
  475. }
  476. var msglen int
  477. for shift := uint(0); ; shift += 7 {
  478. if shift >= 64 {
  479. return ErrIntOverflowGenerated
  480. }
  481. if iNdEx >= l {
  482. return io.ErrUnexpectedEOF
  483. }
  484. b := dAtA[iNdEx]
  485. iNdEx++
  486. msglen |= int(b&0x7F) << shift
  487. if b < 0x80 {
  488. break
  489. }
  490. }
  491. if msglen < 0 {
  492. return ErrInvalidLengthGenerated
  493. }
  494. postIndex := iNdEx + msglen
  495. if postIndex < 0 {
  496. return ErrInvalidLengthGenerated
  497. }
  498. if postIndex > l {
  499. return io.ErrUnexpectedEOF
  500. }
  501. m.Items = append(m.Items, LeaseCandidate{})
  502. if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  503. return err
  504. }
  505. iNdEx = postIndex
  506. default:
  507. iNdEx = preIndex
  508. skippy, err := skipGenerated(dAtA[iNdEx:])
  509. if err != nil {
  510. return err
  511. }
  512. if (skippy < 0) || (iNdEx+skippy) < 0 {
  513. return ErrInvalidLengthGenerated
  514. }
  515. if (iNdEx + skippy) > l {
  516. return io.ErrUnexpectedEOF
  517. }
  518. iNdEx += skippy
  519. }
  520. }
  521. if iNdEx > l {
  522. return io.ErrUnexpectedEOF
  523. }
  524. return nil
  525. }
  526. func (m *LeaseCandidateSpec) Unmarshal(dAtA []byte) error {
  527. l := len(dAtA)
  528. iNdEx := 0
  529. for iNdEx < l {
  530. preIndex := iNdEx
  531. var wire uint64
  532. for shift := uint(0); ; shift += 7 {
  533. if shift >= 64 {
  534. return ErrIntOverflowGenerated
  535. }
  536. if iNdEx >= l {
  537. return io.ErrUnexpectedEOF
  538. }
  539. b := dAtA[iNdEx]
  540. iNdEx++
  541. wire |= uint64(b&0x7F) << shift
  542. if b < 0x80 {
  543. break
  544. }
  545. }
  546. fieldNum := int32(wire >> 3)
  547. wireType := int(wire & 0x7)
  548. if wireType == 4 {
  549. return fmt.Errorf("proto: LeaseCandidateSpec: wiretype end group for non-group")
  550. }
  551. if fieldNum <= 0 {
  552. return fmt.Errorf("proto: LeaseCandidateSpec: illegal tag %d (wire type %d)", fieldNum, wire)
  553. }
  554. switch fieldNum {
  555. case 1:
  556. if wireType != 2 {
  557. return fmt.Errorf("proto: wrong wireType = %d for field LeaseName", wireType)
  558. }
  559. var stringLen uint64
  560. for shift := uint(0); ; shift += 7 {
  561. if shift >= 64 {
  562. return ErrIntOverflowGenerated
  563. }
  564. if iNdEx >= l {
  565. return io.ErrUnexpectedEOF
  566. }
  567. b := dAtA[iNdEx]
  568. iNdEx++
  569. stringLen |= uint64(b&0x7F) << shift
  570. if b < 0x80 {
  571. break
  572. }
  573. }
  574. intStringLen := int(stringLen)
  575. if intStringLen < 0 {
  576. return ErrInvalidLengthGenerated
  577. }
  578. postIndex := iNdEx + intStringLen
  579. if postIndex < 0 {
  580. return ErrInvalidLengthGenerated
  581. }
  582. if postIndex > l {
  583. return io.ErrUnexpectedEOF
  584. }
  585. m.LeaseName = string(dAtA[iNdEx:postIndex])
  586. iNdEx = postIndex
  587. case 2:
  588. if wireType != 2 {
  589. return fmt.Errorf("proto: wrong wireType = %d for field PingTime", wireType)
  590. }
  591. var msglen int
  592. for shift := uint(0); ; shift += 7 {
  593. if shift >= 64 {
  594. return ErrIntOverflowGenerated
  595. }
  596. if iNdEx >= l {
  597. return io.ErrUnexpectedEOF
  598. }
  599. b := dAtA[iNdEx]
  600. iNdEx++
  601. msglen |= int(b&0x7F) << shift
  602. if b < 0x80 {
  603. break
  604. }
  605. }
  606. if msglen < 0 {
  607. return ErrInvalidLengthGenerated
  608. }
  609. postIndex := iNdEx + msglen
  610. if postIndex < 0 {
  611. return ErrInvalidLengthGenerated
  612. }
  613. if postIndex > l {
  614. return io.ErrUnexpectedEOF
  615. }
  616. if m.PingTime == nil {
  617. m.PingTime = &v1.MicroTime{}
  618. }
  619. if err := m.PingTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  620. return err
  621. }
  622. iNdEx = postIndex
  623. case 3:
  624. if wireType != 2 {
  625. return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType)
  626. }
  627. var msglen int
  628. for shift := uint(0); ; shift += 7 {
  629. if shift >= 64 {
  630. return ErrIntOverflowGenerated
  631. }
  632. if iNdEx >= l {
  633. return io.ErrUnexpectedEOF
  634. }
  635. b := dAtA[iNdEx]
  636. iNdEx++
  637. msglen |= int(b&0x7F) << shift
  638. if b < 0x80 {
  639. break
  640. }
  641. }
  642. if msglen < 0 {
  643. return ErrInvalidLengthGenerated
  644. }
  645. postIndex := iNdEx + msglen
  646. if postIndex < 0 {
  647. return ErrInvalidLengthGenerated
  648. }
  649. if postIndex > l {
  650. return io.ErrUnexpectedEOF
  651. }
  652. if m.RenewTime == nil {
  653. m.RenewTime = &v1.MicroTime{}
  654. }
  655. if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  656. return err
  657. }
  658. iNdEx = postIndex
  659. case 4:
  660. if wireType != 2 {
  661. return fmt.Errorf("proto: wrong wireType = %d for field BinaryVersion", wireType)
  662. }
  663. var stringLen uint64
  664. for shift := uint(0); ; shift += 7 {
  665. if shift >= 64 {
  666. return ErrIntOverflowGenerated
  667. }
  668. if iNdEx >= l {
  669. return io.ErrUnexpectedEOF
  670. }
  671. b := dAtA[iNdEx]
  672. iNdEx++
  673. stringLen |= uint64(b&0x7F) << shift
  674. if b < 0x80 {
  675. break
  676. }
  677. }
  678. intStringLen := int(stringLen)
  679. if intStringLen < 0 {
  680. return ErrInvalidLengthGenerated
  681. }
  682. postIndex := iNdEx + intStringLen
  683. if postIndex < 0 {
  684. return ErrInvalidLengthGenerated
  685. }
  686. if postIndex > l {
  687. return io.ErrUnexpectedEOF
  688. }
  689. m.BinaryVersion = string(dAtA[iNdEx:postIndex])
  690. iNdEx = postIndex
  691. case 5:
  692. if wireType != 2 {
  693. return fmt.Errorf("proto: wrong wireType = %d for field EmulationVersion", wireType)
  694. }
  695. var stringLen uint64
  696. for shift := uint(0); ; shift += 7 {
  697. if shift >= 64 {
  698. return ErrIntOverflowGenerated
  699. }
  700. if iNdEx >= l {
  701. return io.ErrUnexpectedEOF
  702. }
  703. b := dAtA[iNdEx]
  704. iNdEx++
  705. stringLen |= uint64(b&0x7F) << shift
  706. if b < 0x80 {
  707. break
  708. }
  709. }
  710. intStringLen := int(stringLen)
  711. if intStringLen < 0 {
  712. return ErrInvalidLengthGenerated
  713. }
  714. postIndex := iNdEx + intStringLen
  715. if postIndex < 0 {
  716. return ErrInvalidLengthGenerated
  717. }
  718. if postIndex > l {
  719. return io.ErrUnexpectedEOF
  720. }
  721. m.EmulationVersion = string(dAtA[iNdEx:postIndex])
  722. iNdEx = postIndex
  723. case 6:
  724. if wireType != 2 {
  725. return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType)
  726. }
  727. var stringLen uint64
  728. for shift := uint(0); ; shift += 7 {
  729. if shift >= 64 {
  730. return ErrIntOverflowGenerated
  731. }
  732. if iNdEx >= l {
  733. return io.ErrUnexpectedEOF
  734. }
  735. b := dAtA[iNdEx]
  736. iNdEx++
  737. stringLen |= uint64(b&0x7F) << shift
  738. if b < 0x80 {
  739. break
  740. }
  741. }
  742. intStringLen := int(stringLen)
  743. if intStringLen < 0 {
  744. return ErrInvalidLengthGenerated
  745. }
  746. postIndex := iNdEx + intStringLen
  747. if postIndex < 0 {
  748. return ErrInvalidLengthGenerated
  749. }
  750. if postIndex > l {
  751. return io.ErrUnexpectedEOF
  752. }
  753. m.Strategy = k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex])
  754. iNdEx = postIndex
  755. default:
  756. iNdEx = preIndex
  757. skippy, err := skipGenerated(dAtA[iNdEx:])
  758. if err != nil {
  759. return err
  760. }
  761. if (skippy < 0) || (iNdEx+skippy) < 0 {
  762. return ErrInvalidLengthGenerated
  763. }
  764. if (iNdEx + skippy) > l {
  765. return io.ErrUnexpectedEOF
  766. }
  767. iNdEx += skippy
  768. }
  769. }
  770. if iNdEx > l {
  771. return io.ErrUnexpectedEOF
  772. }
  773. return nil
  774. }
  775. func skipGenerated(dAtA []byte) (n int, err error) {
  776. l := len(dAtA)
  777. iNdEx := 0
  778. depth := 0
  779. for iNdEx < l {
  780. var wire uint64
  781. for shift := uint(0); ; shift += 7 {
  782. if shift >= 64 {
  783. return 0, ErrIntOverflowGenerated
  784. }
  785. if iNdEx >= l {
  786. return 0, io.ErrUnexpectedEOF
  787. }
  788. b := dAtA[iNdEx]
  789. iNdEx++
  790. wire |= (uint64(b) & 0x7F) << shift
  791. if b < 0x80 {
  792. break
  793. }
  794. }
  795. wireType := int(wire & 0x7)
  796. switch wireType {
  797. case 0:
  798. for shift := uint(0); ; shift += 7 {
  799. if shift >= 64 {
  800. return 0, ErrIntOverflowGenerated
  801. }
  802. if iNdEx >= l {
  803. return 0, io.ErrUnexpectedEOF
  804. }
  805. iNdEx++
  806. if dAtA[iNdEx-1] < 0x80 {
  807. break
  808. }
  809. }
  810. case 1:
  811. iNdEx += 8
  812. case 2:
  813. var length int
  814. for shift := uint(0); ; shift += 7 {
  815. if shift >= 64 {
  816. return 0, ErrIntOverflowGenerated
  817. }
  818. if iNdEx >= l {
  819. return 0, io.ErrUnexpectedEOF
  820. }
  821. b := dAtA[iNdEx]
  822. iNdEx++
  823. length |= (int(b) & 0x7F) << shift
  824. if b < 0x80 {
  825. break
  826. }
  827. }
  828. if length < 0 {
  829. return 0, ErrInvalidLengthGenerated
  830. }
  831. iNdEx += length
  832. case 3:
  833. depth++
  834. case 4:
  835. if depth == 0 {
  836. return 0, ErrUnexpectedEndOfGroupGenerated
  837. }
  838. depth--
  839. case 5:
  840. iNdEx += 4
  841. default:
  842. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  843. }
  844. if iNdEx < 0 {
  845. return 0, ErrInvalidLengthGenerated
  846. }
  847. if depth == 0 {
  848. return iNdEx, nil
  849. }
  850. }
  851. return 0, io.ErrUnexpectedEOF
  852. }
  853. var (
  854. ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
  855. ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
  856. ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
  857. )