generated.pb.go 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662
  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/v1beta1/generated.proto
  15. package v1beta1
  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 *Lease) Reset() { *m = Lease{} }
  26. func (m *LeaseCandidate) Reset() { *m = LeaseCandidate{} }
  27. func (m *LeaseCandidateList) Reset() { *m = LeaseCandidateList{} }
  28. func (m *LeaseCandidateSpec) Reset() { *m = LeaseCandidateSpec{} }
  29. func (m *LeaseList) Reset() { *m = LeaseList{} }
  30. func (m *LeaseSpec) Reset() { *m = LeaseSpec{} }
  31. func (m *Lease) Marshal() (dAtA []byte, err error) {
  32. size := m.Size()
  33. dAtA = make([]byte, size)
  34. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  35. if err != nil {
  36. return nil, err
  37. }
  38. return dAtA[:n], nil
  39. }
  40. func (m *Lease) MarshalTo(dAtA []byte) (int, error) {
  41. size := m.Size()
  42. return m.MarshalToSizedBuffer(dAtA[:size])
  43. }
  44. func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  45. i := len(dAtA)
  46. _ = i
  47. var l int
  48. _ = l
  49. {
  50. size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
  51. if err != nil {
  52. return 0, err
  53. }
  54. i -= size
  55. i = encodeVarintGenerated(dAtA, i, uint64(size))
  56. }
  57. i--
  58. dAtA[i] = 0x12
  59. {
  60. size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i])
  61. if err != nil {
  62. return 0, err
  63. }
  64. i -= size
  65. i = encodeVarintGenerated(dAtA, i, uint64(size))
  66. }
  67. i--
  68. dAtA[i] = 0xa
  69. return len(dAtA) - i, nil
  70. }
  71. func (m *LeaseCandidate) Marshal() (dAtA []byte, err error) {
  72. size := m.Size()
  73. dAtA = make([]byte, size)
  74. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  75. if err != nil {
  76. return nil, err
  77. }
  78. return dAtA[:n], nil
  79. }
  80. func (m *LeaseCandidate) MarshalTo(dAtA []byte) (int, error) {
  81. size := m.Size()
  82. return m.MarshalToSizedBuffer(dAtA[:size])
  83. }
  84. func (m *LeaseCandidate) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  85. i := len(dAtA)
  86. _ = i
  87. var l int
  88. _ = l
  89. {
  90. size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i])
  91. if err != nil {
  92. return 0, err
  93. }
  94. i -= size
  95. i = encodeVarintGenerated(dAtA, i, uint64(size))
  96. }
  97. i--
  98. dAtA[i] = 0x12
  99. {
  100. size, err := m.ObjectMeta.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] = 0xa
  109. return len(dAtA) - i, nil
  110. }
  111. func (m *LeaseCandidateList) Marshal() (dAtA []byte, err error) {
  112. size := m.Size()
  113. dAtA = make([]byte, size)
  114. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  115. if err != nil {
  116. return nil, err
  117. }
  118. return dAtA[:n], nil
  119. }
  120. func (m *LeaseCandidateList) MarshalTo(dAtA []byte) (int, error) {
  121. size := m.Size()
  122. return m.MarshalToSizedBuffer(dAtA[:size])
  123. }
  124. func (m *LeaseCandidateList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  125. i := len(dAtA)
  126. _ = i
  127. var l int
  128. _ = l
  129. if len(m.Items) > 0 {
  130. for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
  131. {
  132. size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  133. if err != nil {
  134. return 0, err
  135. }
  136. i -= size
  137. i = encodeVarintGenerated(dAtA, i, uint64(size))
  138. }
  139. i--
  140. dAtA[i] = 0x12
  141. }
  142. }
  143. {
  144. size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
  145. if err != nil {
  146. return 0, err
  147. }
  148. i -= size
  149. i = encodeVarintGenerated(dAtA, i, uint64(size))
  150. }
  151. i--
  152. dAtA[i] = 0xa
  153. return len(dAtA) - i, nil
  154. }
  155. func (m *LeaseCandidateSpec) Marshal() (dAtA []byte, err error) {
  156. size := m.Size()
  157. dAtA = make([]byte, size)
  158. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  159. if err != nil {
  160. return nil, err
  161. }
  162. return dAtA[:n], nil
  163. }
  164. func (m *LeaseCandidateSpec) MarshalTo(dAtA []byte) (int, error) {
  165. size := m.Size()
  166. return m.MarshalToSizedBuffer(dAtA[:size])
  167. }
  168. func (m *LeaseCandidateSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  169. i := len(dAtA)
  170. _ = i
  171. var l int
  172. _ = l
  173. i -= len(m.Strategy)
  174. copy(dAtA[i:], m.Strategy)
  175. i = encodeVarintGenerated(dAtA, i, uint64(len(m.Strategy)))
  176. i--
  177. dAtA[i] = 0x32
  178. i -= len(m.EmulationVersion)
  179. copy(dAtA[i:], m.EmulationVersion)
  180. i = encodeVarintGenerated(dAtA, i, uint64(len(m.EmulationVersion)))
  181. i--
  182. dAtA[i] = 0x2a
  183. i -= len(m.BinaryVersion)
  184. copy(dAtA[i:], m.BinaryVersion)
  185. i = encodeVarintGenerated(dAtA, i, uint64(len(m.BinaryVersion)))
  186. i--
  187. dAtA[i] = 0x22
  188. if m.RenewTime != nil {
  189. {
  190. size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i])
  191. if err != nil {
  192. return 0, err
  193. }
  194. i -= size
  195. i = encodeVarintGenerated(dAtA, i, uint64(size))
  196. }
  197. i--
  198. dAtA[i] = 0x1a
  199. }
  200. if m.PingTime != nil {
  201. {
  202. size, err := m.PingTime.MarshalToSizedBuffer(dAtA[:i])
  203. if err != nil {
  204. return 0, err
  205. }
  206. i -= size
  207. i = encodeVarintGenerated(dAtA, i, uint64(size))
  208. }
  209. i--
  210. dAtA[i] = 0x12
  211. }
  212. i -= len(m.LeaseName)
  213. copy(dAtA[i:], m.LeaseName)
  214. i = encodeVarintGenerated(dAtA, i, uint64(len(m.LeaseName)))
  215. i--
  216. dAtA[i] = 0xa
  217. return len(dAtA) - i, nil
  218. }
  219. func (m *LeaseList) Marshal() (dAtA []byte, err error) {
  220. size := m.Size()
  221. dAtA = make([]byte, size)
  222. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  223. if err != nil {
  224. return nil, err
  225. }
  226. return dAtA[:n], nil
  227. }
  228. func (m *LeaseList) MarshalTo(dAtA []byte) (int, error) {
  229. size := m.Size()
  230. return m.MarshalToSizedBuffer(dAtA[:size])
  231. }
  232. func (m *LeaseList) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  233. i := len(dAtA)
  234. _ = i
  235. var l int
  236. _ = l
  237. if len(m.Items) > 0 {
  238. for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- {
  239. {
  240. size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i])
  241. if err != nil {
  242. return 0, err
  243. }
  244. i -= size
  245. i = encodeVarintGenerated(dAtA, i, uint64(size))
  246. }
  247. i--
  248. dAtA[i] = 0x12
  249. }
  250. }
  251. {
  252. size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i])
  253. if err != nil {
  254. return 0, err
  255. }
  256. i -= size
  257. i = encodeVarintGenerated(dAtA, i, uint64(size))
  258. }
  259. i--
  260. dAtA[i] = 0xa
  261. return len(dAtA) - i, nil
  262. }
  263. func (m *LeaseSpec) Marshal() (dAtA []byte, err error) {
  264. size := m.Size()
  265. dAtA = make([]byte, size)
  266. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  267. if err != nil {
  268. return nil, err
  269. }
  270. return dAtA[:n], nil
  271. }
  272. func (m *LeaseSpec) MarshalTo(dAtA []byte) (int, error) {
  273. size := m.Size()
  274. return m.MarshalToSizedBuffer(dAtA[:size])
  275. }
  276. func (m *LeaseSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  277. i := len(dAtA)
  278. _ = i
  279. var l int
  280. _ = l
  281. if m.PreferredHolder != nil {
  282. i -= len(*m.PreferredHolder)
  283. copy(dAtA[i:], *m.PreferredHolder)
  284. i = encodeVarintGenerated(dAtA, i, uint64(len(*m.PreferredHolder)))
  285. i--
  286. dAtA[i] = 0x3a
  287. }
  288. if m.Strategy != nil {
  289. i -= len(*m.Strategy)
  290. copy(dAtA[i:], *m.Strategy)
  291. i = encodeVarintGenerated(dAtA, i, uint64(len(*m.Strategy)))
  292. i--
  293. dAtA[i] = 0x32
  294. }
  295. if m.LeaseTransitions != nil {
  296. i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseTransitions))
  297. i--
  298. dAtA[i] = 0x28
  299. }
  300. if m.RenewTime != nil {
  301. {
  302. size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i])
  303. if err != nil {
  304. return 0, err
  305. }
  306. i -= size
  307. i = encodeVarintGenerated(dAtA, i, uint64(size))
  308. }
  309. i--
  310. dAtA[i] = 0x22
  311. }
  312. if m.AcquireTime != nil {
  313. {
  314. size, err := m.AcquireTime.MarshalToSizedBuffer(dAtA[:i])
  315. if err != nil {
  316. return 0, err
  317. }
  318. i -= size
  319. i = encodeVarintGenerated(dAtA, i, uint64(size))
  320. }
  321. i--
  322. dAtA[i] = 0x1a
  323. }
  324. if m.LeaseDurationSeconds != nil {
  325. i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseDurationSeconds))
  326. i--
  327. dAtA[i] = 0x10
  328. }
  329. if m.HolderIdentity != nil {
  330. i -= len(*m.HolderIdentity)
  331. copy(dAtA[i:], *m.HolderIdentity)
  332. i = encodeVarintGenerated(dAtA, i, uint64(len(*m.HolderIdentity)))
  333. i--
  334. dAtA[i] = 0xa
  335. }
  336. return len(dAtA) - i, nil
  337. }
  338. func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
  339. offset -= sovGenerated(v)
  340. base := offset
  341. for v >= 1<<7 {
  342. dAtA[offset] = uint8(v&0x7f | 0x80)
  343. v >>= 7
  344. offset++
  345. }
  346. dAtA[offset] = uint8(v)
  347. return base
  348. }
  349. func (m *Lease) Size() (n int) {
  350. if m == nil {
  351. return 0
  352. }
  353. var l int
  354. _ = l
  355. l = m.ObjectMeta.Size()
  356. n += 1 + l + sovGenerated(uint64(l))
  357. l = m.Spec.Size()
  358. n += 1 + l + sovGenerated(uint64(l))
  359. return n
  360. }
  361. func (m *LeaseCandidate) Size() (n int) {
  362. if m == nil {
  363. return 0
  364. }
  365. var l int
  366. _ = l
  367. l = m.ObjectMeta.Size()
  368. n += 1 + l + sovGenerated(uint64(l))
  369. l = m.Spec.Size()
  370. n += 1 + l + sovGenerated(uint64(l))
  371. return n
  372. }
  373. func (m *LeaseCandidateList) Size() (n int) {
  374. if m == nil {
  375. return 0
  376. }
  377. var l int
  378. _ = l
  379. l = m.ListMeta.Size()
  380. n += 1 + l + sovGenerated(uint64(l))
  381. if len(m.Items) > 0 {
  382. for _, e := range m.Items {
  383. l = e.Size()
  384. n += 1 + l + sovGenerated(uint64(l))
  385. }
  386. }
  387. return n
  388. }
  389. func (m *LeaseCandidateSpec) Size() (n int) {
  390. if m == nil {
  391. return 0
  392. }
  393. var l int
  394. _ = l
  395. l = len(m.LeaseName)
  396. n += 1 + l + sovGenerated(uint64(l))
  397. if m.PingTime != nil {
  398. l = m.PingTime.Size()
  399. n += 1 + l + sovGenerated(uint64(l))
  400. }
  401. if m.RenewTime != nil {
  402. l = m.RenewTime.Size()
  403. n += 1 + l + sovGenerated(uint64(l))
  404. }
  405. l = len(m.BinaryVersion)
  406. n += 1 + l + sovGenerated(uint64(l))
  407. l = len(m.EmulationVersion)
  408. n += 1 + l + sovGenerated(uint64(l))
  409. l = len(m.Strategy)
  410. n += 1 + l + sovGenerated(uint64(l))
  411. return n
  412. }
  413. func (m *LeaseList) Size() (n int) {
  414. if m == nil {
  415. return 0
  416. }
  417. var l int
  418. _ = l
  419. l = m.ListMeta.Size()
  420. n += 1 + l + sovGenerated(uint64(l))
  421. if len(m.Items) > 0 {
  422. for _, e := range m.Items {
  423. l = e.Size()
  424. n += 1 + l + sovGenerated(uint64(l))
  425. }
  426. }
  427. return n
  428. }
  429. func (m *LeaseSpec) Size() (n int) {
  430. if m == nil {
  431. return 0
  432. }
  433. var l int
  434. _ = l
  435. if m.HolderIdentity != nil {
  436. l = len(*m.HolderIdentity)
  437. n += 1 + l + sovGenerated(uint64(l))
  438. }
  439. if m.LeaseDurationSeconds != nil {
  440. n += 1 + sovGenerated(uint64(*m.LeaseDurationSeconds))
  441. }
  442. if m.AcquireTime != nil {
  443. l = m.AcquireTime.Size()
  444. n += 1 + l + sovGenerated(uint64(l))
  445. }
  446. if m.RenewTime != nil {
  447. l = m.RenewTime.Size()
  448. n += 1 + l + sovGenerated(uint64(l))
  449. }
  450. if m.LeaseTransitions != nil {
  451. n += 1 + sovGenerated(uint64(*m.LeaseTransitions))
  452. }
  453. if m.Strategy != nil {
  454. l = len(*m.Strategy)
  455. n += 1 + l + sovGenerated(uint64(l))
  456. }
  457. if m.PreferredHolder != nil {
  458. l = len(*m.PreferredHolder)
  459. n += 1 + l + sovGenerated(uint64(l))
  460. }
  461. return n
  462. }
  463. func sovGenerated(x uint64) (n int) {
  464. return (math_bits.Len64(x|1) + 6) / 7
  465. }
  466. func sozGenerated(x uint64) (n int) {
  467. return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  468. }
  469. func (this *Lease) String() string {
  470. if this == nil {
  471. return "nil"
  472. }
  473. s := strings.Join([]string{`&Lease{`,
  474. `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
  475. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseSpec", "LeaseSpec", 1), `&`, ``, 1) + `,`,
  476. `}`,
  477. }, "")
  478. return s
  479. }
  480. func (this *LeaseCandidate) String() string {
  481. if this == nil {
  482. return "nil"
  483. }
  484. s := strings.Join([]string{`&LeaseCandidate{`,
  485. `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
  486. `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseCandidateSpec", "LeaseCandidateSpec", 1), `&`, ``, 1) + `,`,
  487. `}`,
  488. }, "")
  489. return s
  490. }
  491. func (this *LeaseCandidateList) String() string {
  492. if this == nil {
  493. return "nil"
  494. }
  495. repeatedStringForItems := "[]LeaseCandidate{"
  496. for _, f := range this.Items {
  497. repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "LeaseCandidate", "LeaseCandidate", 1), `&`, ``, 1) + ","
  498. }
  499. repeatedStringForItems += "}"
  500. s := strings.Join([]string{`&LeaseCandidateList{`,
  501. `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
  502. `Items:` + repeatedStringForItems + `,`,
  503. `}`,
  504. }, "")
  505. return s
  506. }
  507. func (this *LeaseCandidateSpec) String() string {
  508. if this == nil {
  509. return "nil"
  510. }
  511. s := strings.Join([]string{`&LeaseCandidateSpec{`,
  512. `LeaseName:` + fmt.Sprintf("%v", this.LeaseName) + `,`,
  513. `PingTime:` + strings.Replace(fmt.Sprintf("%v", this.PingTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  514. `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  515. `BinaryVersion:` + fmt.Sprintf("%v", this.BinaryVersion) + `,`,
  516. `EmulationVersion:` + fmt.Sprintf("%v", this.EmulationVersion) + `,`,
  517. `Strategy:` + fmt.Sprintf("%v", this.Strategy) + `,`,
  518. `}`,
  519. }, "")
  520. return s
  521. }
  522. func (this *LeaseList) String() string {
  523. if this == nil {
  524. return "nil"
  525. }
  526. repeatedStringForItems := "[]Lease{"
  527. for _, f := range this.Items {
  528. repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Lease", "Lease", 1), `&`, ``, 1) + ","
  529. }
  530. repeatedStringForItems += "}"
  531. s := strings.Join([]string{`&LeaseList{`,
  532. `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`,
  533. `Items:` + repeatedStringForItems + `,`,
  534. `}`,
  535. }, "")
  536. return s
  537. }
  538. func (this *LeaseSpec) String() string {
  539. if this == nil {
  540. return "nil"
  541. }
  542. s := strings.Join([]string{`&LeaseSpec{`,
  543. `HolderIdentity:` + valueToStringGenerated(this.HolderIdentity) + `,`,
  544. `LeaseDurationSeconds:` + valueToStringGenerated(this.LeaseDurationSeconds) + `,`,
  545. `AcquireTime:` + strings.Replace(fmt.Sprintf("%v", this.AcquireTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  546. `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`,
  547. `LeaseTransitions:` + valueToStringGenerated(this.LeaseTransitions) + `,`,
  548. `Strategy:` + valueToStringGenerated(this.Strategy) + `,`,
  549. `PreferredHolder:` + valueToStringGenerated(this.PreferredHolder) + `,`,
  550. `}`,
  551. }, "")
  552. return s
  553. }
  554. func valueToStringGenerated(v interface{}) string {
  555. rv := reflect.ValueOf(v)
  556. if rv.IsNil() {
  557. return "nil"
  558. }
  559. pv := reflect.Indirect(rv).Interface()
  560. return fmt.Sprintf("*%v", pv)
  561. }
  562. func (m *Lease) Unmarshal(dAtA []byte) error {
  563. l := len(dAtA)
  564. iNdEx := 0
  565. for iNdEx < l {
  566. preIndex := iNdEx
  567. var wire uint64
  568. for shift := uint(0); ; shift += 7 {
  569. if shift >= 64 {
  570. return ErrIntOverflowGenerated
  571. }
  572. if iNdEx >= l {
  573. return io.ErrUnexpectedEOF
  574. }
  575. b := dAtA[iNdEx]
  576. iNdEx++
  577. wire |= uint64(b&0x7F) << shift
  578. if b < 0x80 {
  579. break
  580. }
  581. }
  582. fieldNum := int32(wire >> 3)
  583. wireType := int(wire & 0x7)
  584. if wireType == 4 {
  585. return fmt.Errorf("proto: Lease: wiretype end group for non-group")
  586. }
  587. if fieldNum <= 0 {
  588. return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire)
  589. }
  590. switch fieldNum {
  591. case 1:
  592. if wireType != 2 {
  593. return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
  594. }
  595. var msglen int
  596. for shift := uint(0); ; shift += 7 {
  597. if shift >= 64 {
  598. return ErrIntOverflowGenerated
  599. }
  600. if iNdEx >= l {
  601. return io.ErrUnexpectedEOF
  602. }
  603. b := dAtA[iNdEx]
  604. iNdEx++
  605. msglen |= int(b&0x7F) << shift
  606. if b < 0x80 {
  607. break
  608. }
  609. }
  610. if msglen < 0 {
  611. return ErrInvalidLengthGenerated
  612. }
  613. postIndex := iNdEx + msglen
  614. if postIndex < 0 {
  615. return ErrInvalidLengthGenerated
  616. }
  617. if postIndex > l {
  618. return io.ErrUnexpectedEOF
  619. }
  620. if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  621. return err
  622. }
  623. iNdEx = postIndex
  624. case 2:
  625. if wireType != 2 {
  626. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  627. }
  628. var msglen int
  629. for shift := uint(0); ; shift += 7 {
  630. if shift >= 64 {
  631. return ErrIntOverflowGenerated
  632. }
  633. if iNdEx >= l {
  634. return io.ErrUnexpectedEOF
  635. }
  636. b := dAtA[iNdEx]
  637. iNdEx++
  638. msglen |= int(b&0x7F) << shift
  639. if b < 0x80 {
  640. break
  641. }
  642. }
  643. if msglen < 0 {
  644. return ErrInvalidLengthGenerated
  645. }
  646. postIndex := iNdEx + msglen
  647. if postIndex < 0 {
  648. return ErrInvalidLengthGenerated
  649. }
  650. if postIndex > l {
  651. return io.ErrUnexpectedEOF
  652. }
  653. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  654. return err
  655. }
  656. iNdEx = postIndex
  657. default:
  658. iNdEx = preIndex
  659. skippy, err := skipGenerated(dAtA[iNdEx:])
  660. if err != nil {
  661. return err
  662. }
  663. if (skippy < 0) || (iNdEx+skippy) < 0 {
  664. return ErrInvalidLengthGenerated
  665. }
  666. if (iNdEx + skippy) > l {
  667. return io.ErrUnexpectedEOF
  668. }
  669. iNdEx += skippy
  670. }
  671. }
  672. if iNdEx > l {
  673. return io.ErrUnexpectedEOF
  674. }
  675. return nil
  676. }
  677. func (m *LeaseCandidate) Unmarshal(dAtA []byte) error {
  678. l := len(dAtA)
  679. iNdEx := 0
  680. for iNdEx < l {
  681. preIndex := iNdEx
  682. var wire uint64
  683. for shift := uint(0); ; shift += 7 {
  684. if shift >= 64 {
  685. return ErrIntOverflowGenerated
  686. }
  687. if iNdEx >= l {
  688. return io.ErrUnexpectedEOF
  689. }
  690. b := dAtA[iNdEx]
  691. iNdEx++
  692. wire |= uint64(b&0x7F) << shift
  693. if b < 0x80 {
  694. break
  695. }
  696. }
  697. fieldNum := int32(wire >> 3)
  698. wireType := int(wire & 0x7)
  699. if wireType == 4 {
  700. return fmt.Errorf("proto: LeaseCandidate: wiretype end group for non-group")
  701. }
  702. if fieldNum <= 0 {
  703. return fmt.Errorf("proto: LeaseCandidate: illegal tag %d (wire type %d)", fieldNum, wire)
  704. }
  705. switch fieldNum {
  706. case 1:
  707. if wireType != 2 {
  708. return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType)
  709. }
  710. var msglen int
  711. for shift := uint(0); ; shift += 7 {
  712. if shift >= 64 {
  713. return ErrIntOverflowGenerated
  714. }
  715. if iNdEx >= l {
  716. return io.ErrUnexpectedEOF
  717. }
  718. b := dAtA[iNdEx]
  719. iNdEx++
  720. msglen |= int(b&0x7F) << shift
  721. if b < 0x80 {
  722. break
  723. }
  724. }
  725. if msglen < 0 {
  726. return ErrInvalidLengthGenerated
  727. }
  728. postIndex := iNdEx + msglen
  729. if postIndex < 0 {
  730. return ErrInvalidLengthGenerated
  731. }
  732. if postIndex > l {
  733. return io.ErrUnexpectedEOF
  734. }
  735. if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  736. return err
  737. }
  738. iNdEx = postIndex
  739. case 2:
  740. if wireType != 2 {
  741. return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType)
  742. }
  743. var msglen int
  744. for shift := uint(0); ; shift += 7 {
  745. if shift >= 64 {
  746. return ErrIntOverflowGenerated
  747. }
  748. if iNdEx >= l {
  749. return io.ErrUnexpectedEOF
  750. }
  751. b := dAtA[iNdEx]
  752. iNdEx++
  753. msglen |= int(b&0x7F) << shift
  754. if b < 0x80 {
  755. break
  756. }
  757. }
  758. if msglen < 0 {
  759. return ErrInvalidLengthGenerated
  760. }
  761. postIndex := iNdEx + msglen
  762. if postIndex < 0 {
  763. return ErrInvalidLengthGenerated
  764. }
  765. if postIndex > l {
  766. return io.ErrUnexpectedEOF
  767. }
  768. if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  769. return err
  770. }
  771. iNdEx = postIndex
  772. default:
  773. iNdEx = preIndex
  774. skippy, err := skipGenerated(dAtA[iNdEx:])
  775. if err != nil {
  776. return err
  777. }
  778. if (skippy < 0) || (iNdEx+skippy) < 0 {
  779. return ErrInvalidLengthGenerated
  780. }
  781. if (iNdEx + skippy) > l {
  782. return io.ErrUnexpectedEOF
  783. }
  784. iNdEx += skippy
  785. }
  786. }
  787. if iNdEx > l {
  788. return io.ErrUnexpectedEOF
  789. }
  790. return nil
  791. }
  792. func (m *LeaseCandidateList) Unmarshal(dAtA []byte) error {
  793. l := len(dAtA)
  794. iNdEx := 0
  795. for iNdEx < l {
  796. preIndex := iNdEx
  797. var wire uint64
  798. for shift := uint(0); ; shift += 7 {
  799. if shift >= 64 {
  800. return ErrIntOverflowGenerated
  801. }
  802. if iNdEx >= l {
  803. return io.ErrUnexpectedEOF
  804. }
  805. b := dAtA[iNdEx]
  806. iNdEx++
  807. wire |= uint64(b&0x7F) << shift
  808. if b < 0x80 {
  809. break
  810. }
  811. }
  812. fieldNum := int32(wire >> 3)
  813. wireType := int(wire & 0x7)
  814. if wireType == 4 {
  815. return fmt.Errorf("proto: LeaseCandidateList: wiretype end group for non-group")
  816. }
  817. if fieldNum <= 0 {
  818. return fmt.Errorf("proto: LeaseCandidateList: illegal tag %d (wire type %d)", fieldNum, wire)
  819. }
  820. switch fieldNum {
  821. case 1:
  822. if wireType != 2 {
  823. return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
  824. }
  825. var msglen int
  826. for shift := uint(0); ; shift += 7 {
  827. if shift >= 64 {
  828. return ErrIntOverflowGenerated
  829. }
  830. if iNdEx >= l {
  831. return io.ErrUnexpectedEOF
  832. }
  833. b := dAtA[iNdEx]
  834. iNdEx++
  835. msglen |= int(b&0x7F) << shift
  836. if b < 0x80 {
  837. break
  838. }
  839. }
  840. if msglen < 0 {
  841. return ErrInvalidLengthGenerated
  842. }
  843. postIndex := iNdEx + msglen
  844. if postIndex < 0 {
  845. return ErrInvalidLengthGenerated
  846. }
  847. if postIndex > l {
  848. return io.ErrUnexpectedEOF
  849. }
  850. if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  851. return err
  852. }
  853. iNdEx = postIndex
  854. case 2:
  855. if wireType != 2 {
  856. return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
  857. }
  858. var msglen int
  859. for shift := uint(0); ; shift += 7 {
  860. if shift >= 64 {
  861. return ErrIntOverflowGenerated
  862. }
  863. if iNdEx >= l {
  864. return io.ErrUnexpectedEOF
  865. }
  866. b := dAtA[iNdEx]
  867. iNdEx++
  868. msglen |= int(b&0x7F) << shift
  869. if b < 0x80 {
  870. break
  871. }
  872. }
  873. if msglen < 0 {
  874. return ErrInvalidLengthGenerated
  875. }
  876. postIndex := iNdEx + msglen
  877. if postIndex < 0 {
  878. return ErrInvalidLengthGenerated
  879. }
  880. if postIndex > l {
  881. return io.ErrUnexpectedEOF
  882. }
  883. m.Items = append(m.Items, LeaseCandidate{})
  884. if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  885. return err
  886. }
  887. iNdEx = postIndex
  888. default:
  889. iNdEx = preIndex
  890. skippy, err := skipGenerated(dAtA[iNdEx:])
  891. if err != nil {
  892. return err
  893. }
  894. if (skippy < 0) || (iNdEx+skippy) < 0 {
  895. return ErrInvalidLengthGenerated
  896. }
  897. if (iNdEx + skippy) > l {
  898. return io.ErrUnexpectedEOF
  899. }
  900. iNdEx += skippy
  901. }
  902. }
  903. if iNdEx > l {
  904. return io.ErrUnexpectedEOF
  905. }
  906. return nil
  907. }
  908. func (m *LeaseCandidateSpec) Unmarshal(dAtA []byte) error {
  909. l := len(dAtA)
  910. iNdEx := 0
  911. for iNdEx < l {
  912. preIndex := iNdEx
  913. var wire uint64
  914. for shift := uint(0); ; shift += 7 {
  915. if shift >= 64 {
  916. return ErrIntOverflowGenerated
  917. }
  918. if iNdEx >= l {
  919. return io.ErrUnexpectedEOF
  920. }
  921. b := dAtA[iNdEx]
  922. iNdEx++
  923. wire |= uint64(b&0x7F) << shift
  924. if b < 0x80 {
  925. break
  926. }
  927. }
  928. fieldNum := int32(wire >> 3)
  929. wireType := int(wire & 0x7)
  930. if wireType == 4 {
  931. return fmt.Errorf("proto: LeaseCandidateSpec: wiretype end group for non-group")
  932. }
  933. if fieldNum <= 0 {
  934. return fmt.Errorf("proto: LeaseCandidateSpec: illegal tag %d (wire type %d)", fieldNum, wire)
  935. }
  936. switch fieldNum {
  937. case 1:
  938. if wireType != 2 {
  939. return fmt.Errorf("proto: wrong wireType = %d for field LeaseName", wireType)
  940. }
  941. var stringLen uint64
  942. for shift := uint(0); ; shift += 7 {
  943. if shift >= 64 {
  944. return ErrIntOverflowGenerated
  945. }
  946. if iNdEx >= l {
  947. return io.ErrUnexpectedEOF
  948. }
  949. b := dAtA[iNdEx]
  950. iNdEx++
  951. stringLen |= uint64(b&0x7F) << shift
  952. if b < 0x80 {
  953. break
  954. }
  955. }
  956. intStringLen := int(stringLen)
  957. if intStringLen < 0 {
  958. return ErrInvalidLengthGenerated
  959. }
  960. postIndex := iNdEx + intStringLen
  961. if postIndex < 0 {
  962. return ErrInvalidLengthGenerated
  963. }
  964. if postIndex > l {
  965. return io.ErrUnexpectedEOF
  966. }
  967. m.LeaseName = string(dAtA[iNdEx:postIndex])
  968. iNdEx = postIndex
  969. case 2:
  970. if wireType != 2 {
  971. return fmt.Errorf("proto: wrong wireType = %d for field PingTime", wireType)
  972. }
  973. var msglen int
  974. for shift := uint(0); ; shift += 7 {
  975. if shift >= 64 {
  976. return ErrIntOverflowGenerated
  977. }
  978. if iNdEx >= l {
  979. return io.ErrUnexpectedEOF
  980. }
  981. b := dAtA[iNdEx]
  982. iNdEx++
  983. msglen |= int(b&0x7F) << shift
  984. if b < 0x80 {
  985. break
  986. }
  987. }
  988. if msglen < 0 {
  989. return ErrInvalidLengthGenerated
  990. }
  991. postIndex := iNdEx + msglen
  992. if postIndex < 0 {
  993. return ErrInvalidLengthGenerated
  994. }
  995. if postIndex > l {
  996. return io.ErrUnexpectedEOF
  997. }
  998. if m.PingTime == nil {
  999. m.PingTime = &v1.MicroTime{}
  1000. }
  1001. if err := m.PingTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1002. return err
  1003. }
  1004. iNdEx = postIndex
  1005. case 3:
  1006. if wireType != 2 {
  1007. return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType)
  1008. }
  1009. var msglen int
  1010. for shift := uint(0); ; shift += 7 {
  1011. if shift >= 64 {
  1012. return ErrIntOverflowGenerated
  1013. }
  1014. if iNdEx >= l {
  1015. return io.ErrUnexpectedEOF
  1016. }
  1017. b := dAtA[iNdEx]
  1018. iNdEx++
  1019. msglen |= int(b&0x7F) << shift
  1020. if b < 0x80 {
  1021. break
  1022. }
  1023. }
  1024. if msglen < 0 {
  1025. return ErrInvalidLengthGenerated
  1026. }
  1027. postIndex := iNdEx + msglen
  1028. if postIndex < 0 {
  1029. return ErrInvalidLengthGenerated
  1030. }
  1031. if postIndex > l {
  1032. return io.ErrUnexpectedEOF
  1033. }
  1034. if m.RenewTime == nil {
  1035. m.RenewTime = &v1.MicroTime{}
  1036. }
  1037. if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1038. return err
  1039. }
  1040. iNdEx = postIndex
  1041. case 4:
  1042. if wireType != 2 {
  1043. return fmt.Errorf("proto: wrong wireType = %d for field BinaryVersion", wireType)
  1044. }
  1045. var stringLen uint64
  1046. for shift := uint(0); ; shift += 7 {
  1047. if shift >= 64 {
  1048. return ErrIntOverflowGenerated
  1049. }
  1050. if iNdEx >= l {
  1051. return io.ErrUnexpectedEOF
  1052. }
  1053. b := dAtA[iNdEx]
  1054. iNdEx++
  1055. stringLen |= uint64(b&0x7F) << shift
  1056. if b < 0x80 {
  1057. break
  1058. }
  1059. }
  1060. intStringLen := int(stringLen)
  1061. if intStringLen < 0 {
  1062. return ErrInvalidLengthGenerated
  1063. }
  1064. postIndex := iNdEx + intStringLen
  1065. if postIndex < 0 {
  1066. return ErrInvalidLengthGenerated
  1067. }
  1068. if postIndex > l {
  1069. return io.ErrUnexpectedEOF
  1070. }
  1071. m.BinaryVersion = string(dAtA[iNdEx:postIndex])
  1072. iNdEx = postIndex
  1073. case 5:
  1074. if wireType != 2 {
  1075. return fmt.Errorf("proto: wrong wireType = %d for field EmulationVersion", wireType)
  1076. }
  1077. var stringLen uint64
  1078. for shift := uint(0); ; shift += 7 {
  1079. if shift >= 64 {
  1080. return ErrIntOverflowGenerated
  1081. }
  1082. if iNdEx >= l {
  1083. return io.ErrUnexpectedEOF
  1084. }
  1085. b := dAtA[iNdEx]
  1086. iNdEx++
  1087. stringLen |= uint64(b&0x7F) << shift
  1088. if b < 0x80 {
  1089. break
  1090. }
  1091. }
  1092. intStringLen := int(stringLen)
  1093. if intStringLen < 0 {
  1094. return ErrInvalidLengthGenerated
  1095. }
  1096. postIndex := iNdEx + intStringLen
  1097. if postIndex < 0 {
  1098. return ErrInvalidLengthGenerated
  1099. }
  1100. if postIndex > l {
  1101. return io.ErrUnexpectedEOF
  1102. }
  1103. m.EmulationVersion = string(dAtA[iNdEx:postIndex])
  1104. iNdEx = postIndex
  1105. case 6:
  1106. if wireType != 2 {
  1107. return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType)
  1108. }
  1109. var stringLen uint64
  1110. for shift := uint(0); ; shift += 7 {
  1111. if shift >= 64 {
  1112. return ErrIntOverflowGenerated
  1113. }
  1114. if iNdEx >= l {
  1115. return io.ErrUnexpectedEOF
  1116. }
  1117. b := dAtA[iNdEx]
  1118. iNdEx++
  1119. stringLen |= uint64(b&0x7F) << shift
  1120. if b < 0x80 {
  1121. break
  1122. }
  1123. }
  1124. intStringLen := int(stringLen)
  1125. if intStringLen < 0 {
  1126. return ErrInvalidLengthGenerated
  1127. }
  1128. postIndex := iNdEx + intStringLen
  1129. if postIndex < 0 {
  1130. return ErrInvalidLengthGenerated
  1131. }
  1132. if postIndex > l {
  1133. return io.ErrUnexpectedEOF
  1134. }
  1135. m.Strategy = k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex])
  1136. iNdEx = postIndex
  1137. default:
  1138. iNdEx = preIndex
  1139. skippy, err := skipGenerated(dAtA[iNdEx:])
  1140. if err != nil {
  1141. return err
  1142. }
  1143. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1144. return ErrInvalidLengthGenerated
  1145. }
  1146. if (iNdEx + skippy) > l {
  1147. return io.ErrUnexpectedEOF
  1148. }
  1149. iNdEx += skippy
  1150. }
  1151. }
  1152. if iNdEx > l {
  1153. return io.ErrUnexpectedEOF
  1154. }
  1155. return nil
  1156. }
  1157. func (m *LeaseList) Unmarshal(dAtA []byte) error {
  1158. l := len(dAtA)
  1159. iNdEx := 0
  1160. for iNdEx < l {
  1161. preIndex := iNdEx
  1162. var wire uint64
  1163. for shift := uint(0); ; shift += 7 {
  1164. if shift >= 64 {
  1165. return ErrIntOverflowGenerated
  1166. }
  1167. if iNdEx >= l {
  1168. return io.ErrUnexpectedEOF
  1169. }
  1170. b := dAtA[iNdEx]
  1171. iNdEx++
  1172. wire |= uint64(b&0x7F) << shift
  1173. if b < 0x80 {
  1174. break
  1175. }
  1176. }
  1177. fieldNum := int32(wire >> 3)
  1178. wireType := int(wire & 0x7)
  1179. if wireType == 4 {
  1180. return fmt.Errorf("proto: LeaseList: wiretype end group for non-group")
  1181. }
  1182. if fieldNum <= 0 {
  1183. return fmt.Errorf("proto: LeaseList: illegal tag %d (wire type %d)", fieldNum, wire)
  1184. }
  1185. switch fieldNum {
  1186. case 1:
  1187. if wireType != 2 {
  1188. return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType)
  1189. }
  1190. var msglen int
  1191. for shift := uint(0); ; shift += 7 {
  1192. if shift >= 64 {
  1193. return ErrIntOverflowGenerated
  1194. }
  1195. if iNdEx >= l {
  1196. return io.ErrUnexpectedEOF
  1197. }
  1198. b := dAtA[iNdEx]
  1199. iNdEx++
  1200. msglen |= int(b&0x7F) << shift
  1201. if b < 0x80 {
  1202. break
  1203. }
  1204. }
  1205. if msglen < 0 {
  1206. return ErrInvalidLengthGenerated
  1207. }
  1208. postIndex := iNdEx + msglen
  1209. if postIndex < 0 {
  1210. return ErrInvalidLengthGenerated
  1211. }
  1212. if postIndex > l {
  1213. return io.ErrUnexpectedEOF
  1214. }
  1215. if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1216. return err
  1217. }
  1218. iNdEx = postIndex
  1219. case 2:
  1220. if wireType != 2 {
  1221. return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType)
  1222. }
  1223. var msglen int
  1224. for shift := uint(0); ; shift += 7 {
  1225. if shift >= 64 {
  1226. return ErrIntOverflowGenerated
  1227. }
  1228. if iNdEx >= l {
  1229. return io.ErrUnexpectedEOF
  1230. }
  1231. b := dAtA[iNdEx]
  1232. iNdEx++
  1233. msglen |= int(b&0x7F) << shift
  1234. if b < 0x80 {
  1235. break
  1236. }
  1237. }
  1238. if msglen < 0 {
  1239. return ErrInvalidLengthGenerated
  1240. }
  1241. postIndex := iNdEx + msglen
  1242. if postIndex < 0 {
  1243. return ErrInvalidLengthGenerated
  1244. }
  1245. if postIndex > l {
  1246. return io.ErrUnexpectedEOF
  1247. }
  1248. m.Items = append(m.Items, Lease{})
  1249. if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1250. return err
  1251. }
  1252. iNdEx = postIndex
  1253. default:
  1254. iNdEx = preIndex
  1255. skippy, err := skipGenerated(dAtA[iNdEx:])
  1256. if err != nil {
  1257. return err
  1258. }
  1259. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1260. return ErrInvalidLengthGenerated
  1261. }
  1262. if (iNdEx + skippy) > l {
  1263. return io.ErrUnexpectedEOF
  1264. }
  1265. iNdEx += skippy
  1266. }
  1267. }
  1268. if iNdEx > l {
  1269. return io.ErrUnexpectedEOF
  1270. }
  1271. return nil
  1272. }
  1273. func (m *LeaseSpec) Unmarshal(dAtA []byte) error {
  1274. l := len(dAtA)
  1275. iNdEx := 0
  1276. for iNdEx < l {
  1277. preIndex := iNdEx
  1278. var wire uint64
  1279. for shift := uint(0); ; shift += 7 {
  1280. if shift >= 64 {
  1281. return ErrIntOverflowGenerated
  1282. }
  1283. if iNdEx >= l {
  1284. return io.ErrUnexpectedEOF
  1285. }
  1286. b := dAtA[iNdEx]
  1287. iNdEx++
  1288. wire |= uint64(b&0x7F) << shift
  1289. if b < 0x80 {
  1290. break
  1291. }
  1292. }
  1293. fieldNum := int32(wire >> 3)
  1294. wireType := int(wire & 0x7)
  1295. if wireType == 4 {
  1296. return fmt.Errorf("proto: LeaseSpec: wiretype end group for non-group")
  1297. }
  1298. if fieldNum <= 0 {
  1299. return fmt.Errorf("proto: LeaseSpec: illegal tag %d (wire type %d)", fieldNum, wire)
  1300. }
  1301. switch fieldNum {
  1302. case 1:
  1303. if wireType != 2 {
  1304. return fmt.Errorf("proto: wrong wireType = %d for field HolderIdentity", wireType)
  1305. }
  1306. var stringLen uint64
  1307. for shift := uint(0); ; shift += 7 {
  1308. if shift >= 64 {
  1309. return ErrIntOverflowGenerated
  1310. }
  1311. if iNdEx >= l {
  1312. return io.ErrUnexpectedEOF
  1313. }
  1314. b := dAtA[iNdEx]
  1315. iNdEx++
  1316. stringLen |= uint64(b&0x7F) << shift
  1317. if b < 0x80 {
  1318. break
  1319. }
  1320. }
  1321. intStringLen := int(stringLen)
  1322. if intStringLen < 0 {
  1323. return ErrInvalidLengthGenerated
  1324. }
  1325. postIndex := iNdEx + intStringLen
  1326. if postIndex < 0 {
  1327. return ErrInvalidLengthGenerated
  1328. }
  1329. if postIndex > l {
  1330. return io.ErrUnexpectedEOF
  1331. }
  1332. s := string(dAtA[iNdEx:postIndex])
  1333. m.HolderIdentity = &s
  1334. iNdEx = postIndex
  1335. case 2:
  1336. if wireType != 0 {
  1337. return fmt.Errorf("proto: wrong wireType = %d for field LeaseDurationSeconds", wireType)
  1338. }
  1339. var v int32
  1340. for shift := uint(0); ; shift += 7 {
  1341. if shift >= 64 {
  1342. return ErrIntOverflowGenerated
  1343. }
  1344. if iNdEx >= l {
  1345. return io.ErrUnexpectedEOF
  1346. }
  1347. b := dAtA[iNdEx]
  1348. iNdEx++
  1349. v |= int32(b&0x7F) << shift
  1350. if b < 0x80 {
  1351. break
  1352. }
  1353. }
  1354. m.LeaseDurationSeconds = &v
  1355. case 3:
  1356. if wireType != 2 {
  1357. return fmt.Errorf("proto: wrong wireType = %d for field AcquireTime", wireType)
  1358. }
  1359. var msglen int
  1360. for shift := uint(0); ; shift += 7 {
  1361. if shift >= 64 {
  1362. return ErrIntOverflowGenerated
  1363. }
  1364. if iNdEx >= l {
  1365. return io.ErrUnexpectedEOF
  1366. }
  1367. b := dAtA[iNdEx]
  1368. iNdEx++
  1369. msglen |= int(b&0x7F) << shift
  1370. if b < 0x80 {
  1371. break
  1372. }
  1373. }
  1374. if msglen < 0 {
  1375. return ErrInvalidLengthGenerated
  1376. }
  1377. postIndex := iNdEx + msglen
  1378. if postIndex < 0 {
  1379. return ErrInvalidLengthGenerated
  1380. }
  1381. if postIndex > l {
  1382. return io.ErrUnexpectedEOF
  1383. }
  1384. if m.AcquireTime == nil {
  1385. m.AcquireTime = &v1.MicroTime{}
  1386. }
  1387. if err := m.AcquireTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1388. return err
  1389. }
  1390. iNdEx = postIndex
  1391. case 4:
  1392. if wireType != 2 {
  1393. return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType)
  1394. }
  1395. var msglen int
  1396. for shift := uint(0); ; shift += 7 {
  1397. if shift >= 64 {
  1398. return ErrIntOverflowGenerated
  1399. }
  1400. if iNdEx >= l {
  1401. return io.ErrUnexpectedEOF
  1402. }
  1403. b := dAtA[iNdEx]
  1404. iNdEx++
  1405. msglen |= int(b&0x7F) << shift
  1406. if b < 0x80 {
  1407. break
  1408. }
  1409. }
  1410. if msglen < 0 {
  1411. return ErrInvalidLengthGenerated
  1412. }
  1413. postIndex := iNdEx + msglen
  1414. if postIndex < 0 {
  1415. return ErrInvalidLengthGenerated
  1416. }
  1417. if postIndex > l {
  1418. return io.ErrUnexpectedEOF
  1419. }
  1420. if m.RenewTime == nil {
  1421. m.RenewTime = &v1.MicroTime{}
  1422. }
  1423. if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1424. return err
  1425. }
  1426. iNdEx = postIndex
  1427. case 5:
  1428. if wireType != 0 {
  1429. return fmt.Errorf("proto: wrong wireType = %d for field LeaseTransitions", wireType)
  1430. }
  1431. var v int32
  1432. for shift := uint(0); ; shift += 7 {
  1433. if shift >= 64 {
  1434. return ErrIntOverflowGenerated
  1435. }
  1436. if iNdEx >= l {
  1437. return io.ErrUnexpectedEOF
  1438. }
  1439. b := dAtA[iNdEx]
  1440. iNdEx++
  1441. v |= int32(b&0x7F) << shift
  1442. if b < 0x80 {
  1443. break
  1444. }
  1445. }
  1446. m.LeaseTransitions = &v
  1447. case 6:
  1448. if wireType != 2 {
  1449. return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType)
  1450. }
  1451. var stringLen uint64
  1452. for shift := uint(0); ; shift += 7 {
  1453. if shift >= 64 {
  1454. return ErrIntOverflowGenerated
  1455. }
  1456. if iNdEx >= l {
  1457. return io.ErrUnexpectedEOF
  1458. }
  1459. b := dAtA[iNdEx]
  1460. iNdEx++
  1461. stringLen |= uint64(b&0x7F) << shift
  1462. if b < 0x80 {
  1463. break
  1464. }
  1465. }
  1466. intStringLen := int(stringLen)
  1467. if intStringLen < 0 {
  1468. return ErrInvalidLengthGenerated
  1469. }
  1470. postIndex := iNdEx + intStringLen
  1471. if postIndex < 0 {
  1472. return ErrInvalidLengthGenerated
  1473. }
  1474. if postIndex > l {
  1475. return io.ErrUnexpectedEOF
  1476. }
  1477. s := k8s_io_api_coordination_v1.CoordinatedLeaseStrategy(dAtA[iNdEx:postIndex])
  1478. m.Strategy = &s
  1479. iNdEx = postIndex
  1480. case 7:
  1481. if wireType != 2 {
  1482. return fmt.Errorf("proto: wrong wireType = %d for field PreferredHolder", wireType)
  1483. }
  1484. var stringLen uint64
  1485. for shift := uint(0); ; shift += 7 {
  1486. if shift >= 64 {
  1487. return ErrIntOverflowGenerated
  1488. }
  1489. if iNdEx >= l {
  1490. return io.ErrUnexpectedEOF
  1491. }
  1492. b := dAtA[iNdEx]
  1493. iNdEx++
  1494. stringLen |= uint64(b&0x7F) << shift
  1495. if b < 0x80 {
  1496. break
  1497. }
  1498. }
  1499. intStringLen := int(stringLen)
  1500. if intStringLen < 0 {
  1501. return ErrInvalidLengthGenerated
  1502. }
  1503. postIndex := iNdEx + intStringLen
  1504. if postIndex < 0 {
  1505. return ErrInvalidLengthGenerated
  1506. }
  1507. if postIndex > l {
  1508. return io.ErrUnexpectedEOF
  1509. }
  1510. s := string(dAtA[iNdEx:postIndex])
  1511. m.PreferredHolder = &s
  1512. iNdEx = postIndex
  1513. default:
  1514. iNdEx = preIndex
  1515. skippy, err := skipGenerated(dAtA[iNdEx:])
  1516. if err != nil {
  1517. return err
  1518. }
  1519. if (skippy < 0) || (iNdEx+skippy) < 0 {
  1520. return ErrInvalidLengthGenerated
  1521. }
  1522. if (iNdEx + skippy) > l {
  1523. return io.ErrUnexpectedEOF
  1524. }
  1525. iNdEx += skippy
  1526. }
  1527. }
  1528. if iNdEx > l {
  1529. return io.ErrUnexpectedEOF
  1530. }
  1531. return nil
  1532. }
  1533. func skipGenerated(dAtA []byte) (n int, err error) {
  1534. l := len(dAtA)
  1535. iNdEx := 0
  1536. depth := 0
  1537. for iNdEx < l {
  1538. var wire uint64
  1539. for shift := uint(0); ; shift += 7 {
  1540. if shift >= 64 {
  1541. return 0, ErrIntOverflowGenerated
  1542. }
  1543. if iNdEx >= l {
  1544. return 0, io.ErrUnexpectedEOF
  1545. }
  1546. b := dAtA[iNdEx]
  1547. iNdEx++
  1548. wire |= (uint64(b) & 0x7F) << shift
  1549. if b < 0x80 {
  1550. break
  1551. }
  1552. }
  1553. wireType := int(wire & 0x7)
  1554. switch wireType {
  1555. case 0:
  1556. for shift := uint(0); ; shift += 7 {
  1557. if shift >= 64 {
  1558. return 0, ErrIntOverflowGenerated
  1559. }
  1560. if iNdEx >= l {
  1561. return 0, io.ErrUnexpectedEOF
  1562. }
  1563. iNdEx++
  1564. if dAtA[iNdEx-1] < 0x80 {
  1565. break
  1566. }
  1567. }
  1568. case 1:
  1569. iNdEx += 8
  1570. case 2:
  1571. var length int
  1572. for shift := uint(0); ; shift += 7 {
  1573. if shift >= 64 {
  1574. return 0, ErrIntOverflowGenerated
  1575. }
  1576. if iNdEx >= l {
  1577. return 0, io.ErrUnexpectedEOF
  1578. }
  1579. b := dAtA[iNdEx]
  1580. iNdEx++
  1581. length |= (int(b) & 0x7F) << shift
  1582. if b < 0x80 {
  1583. break
  1584. }
  1585. }
  1586. if length < 0 {
  1587. return 0, ErrInvalidLengthGenerated
  1588. }
  1589. iNdEx += length
  1590. case 3:
  1591. depth++
  1592. case 4:
  1593. if depth == 0 {
  1594. return 0, ErrUnexpectedEndOfGroupGenerated
  1595. }
  1596. depth--
  1597. case 5:
  1598. iNdEx += 4
  1599. default:
  1600. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  1601. }
  1602. if iNdEx < 0 {
  1603. return 0, ErrInvalidLengthGenerated
  1604. }
  1605. if depth == 0 {
  1606. return iNdEx, nil
  1607. }
  1608. }
  1609. return 0, io.ErrUnexpectedEOF
  1610. }
  1611. var (
  1612. ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling")
  1613. ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow")
  1614. ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
  1615. )