keys.generated.go 23 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000
  1. // ************************************************************
  2. // DO NOT EDIT.
  3. // THIS FILE IS AUTO-GENERATED BY codecgen.
  4. // ************************************************************
  5. package client
  6. import (
  7. "errors"
  8. "fmt"
  9. codec1978 "github.com/coreos/etcd/Godeps/_workspace/src/github.com/ugorji/go/codec"
  10. "reflect"
  11. "runtime"
  12. time "time"
  13. )
  14. const (
  15. // ----- content types ----
  16. codecSelferC_UTF81819 = 1
  17. codecSelferC_RAW1819 = 0
  18. // ----- value types used ----
  19. codecSelferValueTypeArray1819 = 10
  20. codecSelferValueTypeMap1819 = 9
  21. // ----- containerStateValues ----
  22. codecSelfer_containerMapKey1819 = 2
  23. codecSelfer_containerMapValue1819 = 3
  24. codecSelfer_containerMapEnd1819 = 4
  25. codecSelfer_containerArrayElem1819 = 6
  26. codecSelfer_containerArrayEnd1819 = 7
  27. )
  28. var (
  29. codecSelferBitsize1819 = uint8(reflect.TypeOf(uint(0)).Bits())
  30. codecSelferOnlyMapOrArrayEncodeToStructErr1819 = errors.New(`only encoded map or array can be decoded into a struct`)
  31. )
  32. type codecSelfer1819 struct{}
  33. func init() {
  34. if codec1978.GenVersion != 5 {
  35. _, file, _, _ := runtime.Caller(0)
  36. err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v",
  37. 5, codec1978.GenVersion, file)
  38. panic(err)
  39. }
  40. if false { // reference the types, but skip this branch at build/run time
  41. var v0 time.Time
  42. _ = v0
  43. }
  44. }
  45. func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
  46. var h codecSelfer1819
  47. z, r := codec1978.GenHelperEncoder(e)
  48. _, _, _ = h, z, r
  49. if x == nil {
  50. r.EncodeNil()
  51. } else {
  52. yym1 := z.EncBinary()
  53. _ = yym1
  54. if false {
  55. } else if z.HasExtensions() && z.EncExt(x) {
  56. } else {
  57. yysep2 := !z.EncBinary()
  58. yy2arr2 := z.EncBasicHandle().StructToArray
  59. var yyq2 [3]bool
  60. _, _, _ = yysep2, yyq2, yy2arr2
  61. const yyr2 bool = false
  62. var yynn2 int
  63. if yyr2 || yy2arr2 {
  64. r.EncodeArrayStart(3)
  65. } else {
  66. yynn2 = 3
  67. for _, b := range yyq2 {
  68. if b {
  69. yynn2++
  70. }
  71. }
  72. r.EncodeMapStart(yynn2)
  73. yynn2 = 0
  74. }
  75. if yyr2 || yy2arr2 {
  76. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  77. yym4 := z.EncBinary()
  78. _ = yym4
  79. if false {
  80. } else {
  81. r.EncodeString(codecSelferC_UTF81819, string(x.Action))
  82. }
  83. } else {
  84. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  85. r.EncodeString(codecSelferC_UTF81819, string("action"))
  86. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  87. yym5 := z.EncBinary()
  88. _ = yym5
  89. if false {
  90. } else {
  91. r.EncodeString(codecSelferC_UTF81819, string(x.Action))
  92. }
  93. }
  94. if yyr2 || yy2arr2 {
  95. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  96. if x.Node == nil {
  97. r.EncodeNil()
  98. } else {
  99. x.Node.CodecEncodeSelf(e)
  100. }
  101. } else {
  102. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  103. r.EncodeString(codecSelferC_UTF81819, string("node"))
  104. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  105. if x.Node == nil {
  106. r.EncodeNil()
  107. } else {
  108. x.Node.CodecEncodeSelf(e)
  109. }
  110. }
  111. if yyr2 || yy2arr2 {
  112. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  113. if x.PrevNode == nil {
  114. r.EncodeNil()
  115. } else {
  116. x.PrevNode.CodecEncodeSelf(e)
  117. }
  118. } else {
  119. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  120. r.EncodeString(codecSelferC_UTF81819, string("prevNode"))
  121. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  122. if x.PrevNode == nil {
  123. r.EncodeNil()
  124. } else {
  125. x.PrevNode.CodecEncodeSelf(e)
  126. }
  127. }
  128. if yyr2 || yy2arr2 {
  129. z.EncSendContainerState(codecSelfer_containerArrayEnd1819)
  130. } else {
  131. z.EncSendContainerState(codecSelfer_containerMapEnd1819)
  132. }
  133. }
  134. }
  135. }
  136. func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) {
  137. var h codecSelfer1819
  138. z, r := codec1978.GenHelperDecoder(d)
  139. _, _, _ = h, z, r
  140. yym8 := z.DecBinary()
  141. _ = yym8
  142. if false {
  143. } else if z.HasExtensions() && z.DecExt(x) {
  144. } else {
  145. yyct9 := r.ContainerType()
  146. if yyct9 == codecSelferValueTypeMap1819 {
  147. yyl9 := r.ReadMapStart()
  148. if yyl9 == 0 {
  149. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  150. } else {
  151. x.codecDecodeSelfFromMap(yyl9, d)
  152. }
  153. } else if yyct9 == codecSelferValueTypeArray1819 {
  154. yyl9 := r.ReadArrayStart()
  155. if yyl9 == 0 {
  156. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  157. } else {
  158. x.codecDecodeSelfFromArray(yyl9, d)
  159. }
  160. } else {
  161. panic(codecSelferOnlyMapOrArrayEncodeToStructErr1819)
  162. }
  163. }
  164. }
  165. func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
  166. var h codecSelfer1819
  167. z, r := codec1978.GenHelperDecoder(d)
  168. _, _, _ = h, z, r
  169. var yys10Slc = z.DecScratchBuffer() // default slice to decode into
  170. _ = yys10Slc
  171. var yyhl10 bool = l >= 0
  172. for yyj10 := 0; ; yyj10++ {
  173. if yyhl10 {
  174. if yyj10 >= l {
  175. break
  176. }
  177. } else {
  178. if r.CheckBreak() {
  179. break
  180. }
  181. }
  182. z.DecSendContainerState(codecSelfer_containerMapKey1819)
  183. yys10Slc = r.DecodeBytes(yys10Slc, true, true)
  184. yys10 := string(yys10Slc)
  185. z.DecSendContainerState(codecSelfer_containerMapValue1819)
  186. switch yys10 {
  187. case "action":
  188. if r.TryDecodeAsNil() {
  189. x.Action = ""
  190. } else {
  191. x.Action = string(r.DecodeString())
  192. }
  193. case "node":
  194. if r.TryDecodeAsNil() {
  195. if x.Node != nil {
  196. x.Node = nil
  197. }
  198. } else {
  199. if x.Node == nil {
  200. x.Node = new(Node)
  201. }
  202. x.Node.CodecDecodeSelf(d)
  203. }
  204. case "prevNode":
  205. if r.TryDecodeAsNil() {
  206. if x.PrevNode != nil {
  207. x.PrevNode = nil
  208. }
  209. } else {
  210. if x.PrevNode == nil {
  211. x.PrevNode = new(Node)
  212. }
  213. x.PrevNode.CodecDecodeSelf(d)
  214. }
  215. default:
  216. z.DecStructFieldNotFound(-1, yys10)
  217. } // end switch yys10
  218. } // end for yyj10
  219. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  220. }
  221. func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
  222. var h codecSelfer1819
  223. z, r := codec1978.GenHelperDecoder(d)
  224. _, _, _ = h, z, r
  225. var yyj14 int
  226. var yyb14 bool
  227. var yyhl14 bool = l >= 0
  228. yyj14++
  229. if yyhl14 {
  230. yyb14 = yyj14 > l
  231. } else {
  232. yyb14 = r.CheckBreak()
  233. }
  234. if yyb14 {
  235. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  236. return
  237. }
  238. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  239. if r.TryDecodeAsNil() {
  240. x.Action = ""
  241. } else {
  242. x.Action = string(r.DecodeString())
  243. }
  244. yyj14++
  245. if yyhl14 {
  246. yyb14 = yyj14 > l
  247. } else {
  248. yyb14 = r.CheckBreak()
  249. }
  250. if yyb14 {
  251. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  252. return
  253. }
  254. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  255. if r.TryDecodeAsNil() {
  256. if x.Node != nil {
  257. x.Node = nil
  258. }
  259. } else {
  260. if x.Node == nil {
  261. x.Node = new(Node)
  262. }
  263. x.Node.CodecDecodeSelf(d)
  264. }
  265. yyj14++
  266. if yyhl14 {
  267. yyb14 = yyj14 > l
  268. } else {
  269. yyb14 = r.CheckBreak()
  270. }
  271. if yyb14 {
  272. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  273. return
  274. }
  275. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  276. if r.TryDecodeAsNil() {
  277. if x.PrevNode != nil {
  278. x.PrevNode = nil
  279. }
  280. } else {
  281. if x.PrevNode == nil {
  282. x.PrevNode = new(Node)
  283. }
  284. x.PrevNode.CodecDecodeSelf(d)
  285. }
  286. for {
  287. yyj14++
  288. if yyhl14 {
  289. yyb14 = yyj14 > l
  290. } else {
  291. yyb14 = r.CheckBreak()
  292. }
  293. if yyb14 {
  294. break
  295. }
  296. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  297. z.DecStructFieldNotFound(yyj14-1, "")
  298. }
  299. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  300. }
  301. func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) {
  302. var h codecSelfer1819
  303. z, r := codec1978.GenHelperEncoder(e)
  304. _, _, _ = h, z, r
  305. if x == nil {
  306. r.EncodeNil()
  307. } else {
  308. yym18 := z.EncBinary()
  309. _ = yym18
  310. if false {
  311. } else if z.HasExtensions() && z.EncExt(x) {
  312. } else {
  313. yysep19 := !z.EncBinary()
  314. yy2arr19 := z.EncBasicHandle().StructToArray
  315. var yyq19 [8]bool
  316. _, _, _ = yysep19, yyq19, yy2arr19
  317. const yyr19 bool = false
  318. yyq19[1] = x.Dir != false
  319. yyq19[6] = x.Expiration != nil
  320. yyq19[7] = x.TTL != 0
  321. var yynn19 int
  322. if yyr19 || yy2arr19 {
  323. r.EncodeArrayStart(8)
  324. } else {
  325. yynn19 = 5
  326. for _, b := range yyq19 {
  327. if b {
  328. yynn19++
  329. }
  330. }
  331. r.EncodeMapStart(yynn19)
  332. yynn19 = 0
  333. }
  334. if yyr19 || yy2arr19 {
  335. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  336. yym21 := z.EncBinary()
  337. _ = yym21
  338. if false {
  339. } else {
  340. r.EncodeString(codecSelferC_UTF81819, string(x.Key))
  341. }
  342. } else {
  343. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  344. r.EncodeString(codecSelferC_UTF81819, string("key"))
  345. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  346. yym22 := z.EncBinary()
  347. _ = yym22
  348. if false {
  349. } else {
  350. r.EncodeString(codecSelferC_UTF81819, string(x.Key))
  351. }
  352. }
  353. if yyr19 || yy2arr19 {
  354. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  355. if yyq19[1] {
  356. yym24 := z.EncBinary()
  357. _ = yym24
  358. if false {
  359. } else {
  360. r.EncodeBool(bool(x.Dir))
  361. }
  362. } else {
  363. r.EncodeBool(false)
  364. }
  365. } else {
  366. if yyq19[1] {
  367. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  368. r.EncodeString(codecSelferC_UTF81819, string("dir"))
  369. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  370. yym25 := z.EncBinary()
  371. _ = yym25
  372. if false {
  373. } else {
  374. r.EncodeBool(bool(x.Dir))
  375. }
  376. }
  377. }
  378. if yyr19 || yy2arr19 {
  379. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  380. yym27 := z.EncBinary()
  381. _ = yym27
  382. if false {
  383. } else {
  384. r.EncodeString(codecSelferC_UTF81819, string(x.Value))
  385. }
  386. } else {
  387. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  388. r.EncodeString(codecSelferC_UTF81819, string("value"))
  389. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  390. yym28 := z.EncBinary()
  391. _ = yym28
  392. if false {
  393. } else {
  394. r.EncodeString(codecSelferC_UTF81819, string(x.Value))
  395. }
  396. }
  397. if yyr19 || yy2arr19 {
  398. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  399. if x.Nodes == nil {
  400. r.EncodeNil()
  401. } else {
  402. x.Nodes.CodecEncodeSelf(e)
  403. }
  404. } else {
  405. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  406. r.EncodeString(codecSelferC_UTF81819, string("nodes"))
  407. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  408. if x.Nodes == nil {
  409. r.EncodeNil()
  410. } else {
  411. x.Nodes.CodecEncodeSelf(e)
  412. }
  413. }
  414. if yyr19 || yy2arr19 {
  415. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  416. yym31 := z.EncBinary()
  417. _ = yym31
  418. if false {
  419. } else {
  420. r.EncodeUint(uint64(x.CreatedIndex))
  421. }
  422. } else {
  423. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  424. r.EncodeString(codecSelferC_UTF81819, string("createdIndex"))
  425. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  426. yym32 := z.EncBinary()
  427. _ = yym32
  428. if false {
  429. } else {
  430. r.EncodeUint(uint64(x.CreatedIndex))
  431. }
  432. }
  433. if yyr19 || yy2arr19 {
  434. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  435. yym34 := z.EncBinary()
  436. _ = yym34
  437. if false {
  438. } else {
  439. r.EncodeUint(uint64(x.ModifiedIndex))
  440. }
  441. } else {
  442. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  443. r.EncodeString(codecSelferC_UTF81819, string("modifiedIndex"))
  444. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  445. yym35 := z.EncBinary()
  446. _ = yym35
  447. if false {
  448. } else {
  449. r.EncodeUint(uint64(x.ModifiedIndex))
  450. }
  451. }
  452. if yyr19 || yy2arr19 {
  453. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  454. if yyq19[6] {
  455. if x.Expiration == nil {
  456. r.EncodeNil()
  457. } else {
  458. yym37 := z.EncBinary()
  459. _ = yym37
  460. if false {
  461. } else if yym38 := z.TimeRtidIfBinc(); yym38 != 0 {
  462. r.EncodeBuiltin(yym38, x.Expiration)
  463. } else if z.HasExtensions() && z.EncExt(x.Expiration) {
  464. } else if yym37 {
  465. z.EncBinaryMarshal(x.Expiration)
  466. } else if !yym37 && z.IsJSONHandle() {
  467. z.EncJSONMarshal(x.Expiration)
  468. } else {
  469. z.EncFallback(x.Expiration)
  470. }
  471. }
  472. } else {
  473. r.EncodeNil()
  474. }
  475. } else {
  476. if yyq19[6] {
  477. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  478. r.EncodeString(codecSelferC_UTF81819, string("expiration"))
  479. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  480. if x.Expiration == nil {
  481. r.EncodeNil()
  482. } else {
  483. yym39 := z.EncBinary()
  484. _ = yym39
  485. if false {
  486. } else if yym40 := z.TimeRtidIfBinc(); yym40 != 0 {
  487. r.EncodeBuiltin(yym40, x.Expiration)
  488. } else if z.HasExtensions() && z.EncExt(x.Expiration) {
  489. } else if yym39 {
  490. z.EncBinaryMarshal(x.Expiration)
  491. } else if !yym39 && z.IsJSONHandle() {
  492. z.EncJSONMarshal(x.Expiration)
  493. } else {
  494. z.EncFallback(x.Expiration)
  495. }
  496. }
  497. }
  498. }
  499. if yyr19 || yy2arr19 {
  500. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  501. if yyq19[7] {
  502. yym42 := z.EncBinary()
  503. _ = yym42
  504. if false {
  505. } else {
  506. r.EncodeInt(int64(x.TTL))
  507. }
  508. } else {
  509. r.EncodeInt(0)
  510. }
  511. } else {
  512. if yyq19[7] {
  513. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  514. r.EncodeString(codecSelferC_UTF81819, string("ttl"))
  515. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  516. yym43 := z.EncBinary()
  517. _ = yym43
  518. if false {
  519. } else {
  520. r.EncodeInt(int64(x.TTL))
  521. }
  522. }
  523. }
  524. if yyr19 || yy2arr19 {
  525. z.EncSendContainerState(codecSelfer_containerArrayEnd1819)
  526. } else {
  527. z.EncSendContainerState(codecSelfer_containerMapEnd1819)
  528. }
  529. }
  530. }
  531. }
  532. func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) {
  533. var h codecSelfer1819
  534. z, r := codec1978.GenHelperDecoder(d)
  535. _, _, _ = h, z, r
  536. yym44 := z.DecBinary()
  537. _ = yym44
  538. if false {
  539. } else if z.HasExtensions() && z.DecExt(x) {
  540. } else {
  541. yyct45 := r.ContainerType()
  542. if yyct45 == codecSelferValueTypeMap1819 {
  543. yyl45 := r.ReadMapStart()
  544. if yyl45 == 0 {
  545. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  546. } else {
  547. x.codecDecodeSelfFromMap(yyl45, d)
  548. }
  549. } else if yyct45 == codecSelferValueTypeArray1819 {
  550. yyl45 := r.ReadArrayStart()
  551. if yyl45 == 0 {
  552. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  553. } else {
  554. x.codecDecodeSelfFromArray(yyl45, d)
  555. }
  556. } else {
  557. panic(codecSelferOnlyMapOrArrayEncodeToStructErr1819)
  558. }
  559. }
  560. }
  561. func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
  562. var h codecSelfer1819
  563. z, r := codec1978.GenHelperDecoder(d)
  564. _, _, _ = h, z, r
  565. var yys46Slc = z.DecScratchBuffer() // default slice to decode into
  566. _ = yys46Slc
  567. var yyhl46 bool = l >= 0
  568. for yyj46 := 0; ; yyj46++ {
  569. if yyhl46 {
  570. if yyj46 >= l {
  571. break
  572. }
  573. } else {
  574. if r.CheckBreak() {
  575. break
  576. }
  577. }
  578. z.DecSendContainerState(codecSelfer_containerMapKey1819)
  579. yys46Slc = r.DecodeBytes(yys46Slc, true, true)
  580. yys46 := string(yys46Slc)
  581. z.DecSendContainerState(codecSelfer_containerMapValue1819)
  582. switch yys46 {
  583. case "key":
  584. if r.TryDecodeAsNil() {
  585. x.Key = ""
  586. } else {
  587. x.Key = string(r.DecodeString())
  588. }
  589. case "dir":
  590. if r.TryDecodeAsNil() {
  591. x.Dir = false
  592. } else {
  593. x.Dir = bool(r.DecodeBool())
  594. }
  595. case "value":
  596. if r.TryDecodeAsNil() {
  597. x.Value = ""
  598. } else {
  599. x.Value = string(r.DecodeString())
  600. }
  601. case "nodes":
  602. if r.TryDecodeAsNil() {
  603. x.Nodes = nil
  604. } else {
  605. yyv50 := &x.Nodes
  606. yyv50.CodecDecodeSelf(d)
  607. }
  608. case "createdIndex":
  609. if r.TryDecodeAsNil() {
  610. x.CreatedIndex = 0
  611. } else {
  612. x.CreatedIndex = uint64(r.DecodeUint(64))
  613. }
  614. case "modifiedIndex":
  615. if r.TryDecodeAsNil() {
  616. x.ModifiedIndex = 0
  617. } else {
  618. x.ModifiedIndex = uint64(r.DecodeUint(64))
  619. }
  620. case "expiration":
  621. if r.TryDecodeAsNil() {
  622. if x.Expiration != nil {
  623. x.Expiration = nil
  624. }
  625. } else {
  626. if x.Expiration == nil {
  627. x.Expiration = new(time.Time)
  628. }
  629. yym54 := z.DecBinary()
  630. _ = yym54
  631. if false {
  632. } else if yym55 := z.TimeRtidIfBinc(); yym55 != 0 {
  633. r.DecodeBuiltin(yym55, x.Expiration)
  634. } else if z.HasExtensions() && z.DecExt(x.Expiration) {
  635. } else if yym54 {
  636. z.DecBinaryUnmarshal(x.Expiration)
  637. } else if !yym54 && z.IsJSONHandle() {
  638. z.DecJSONUnmarshal(x.Expiration)
  639. } else {
  640. z.DecFallback(x.Expiration, false)
  641. }
  642. }
  643. case "ttl":
  644. if r.TryDecodeAsNil() {
  645. x.TTL = 0
  646. } else {
  647. x.TTL = int64(r.DecodeInt(64))
  648. }
  649. default:
  650. z.DecStructFieldNotFound(-1, yys46)
  651. } // end switch yys46
  652. } // end for yyj46
  653. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  654. }
  655. func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
  656. var h codecSelfer1819
  657. z, r := codec1978.GenHelperDecoder(d)
  658. _, _, _ = h, z, r
  659. var yyj57 int
  660. var yyb57 bool
  661. var yyhl57 bool = l >= 0
  662. yyj57++
  663. if yyhl57 {
  664. yyb57 = yyj57 > l
  665. } else {
  666. yyb57 = r.CheckBreak()
  667. }
  668. if yyb57 {
  669. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  670. return
  671. }
  672. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  673. if r.TryDecodeAsNil() {
  674. x.Key = ""
  675. } else {
  676. x.Key = string(r.DecodeString())
  677. }
  678. yyj57++
  679. if yyhl57 {
  680. yyb57 = yyj57 > l
  681. } else {
  682. yyb57 = r.CheckBreak()
  683. }
  684. if yyb57 {
  685. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  686. return
  687. }
  688. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  689. if r.TryDecodeAsNil() {
  690. x.Dir = false
  691. } else {
  692. x.Dir = bool(r.DecodeBool())
  693. }
  694. yyj57++
  695. if yyhl57 {
  696. yyb57 = yyj57 > l
  697. } else {
  698. yyb57 = r.CheckBreak()
  699. }
  700. if yyb57 {
  701. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  702. return
  703. }
  704. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  705. if r.TryDecodeAsNil() {
  706. x.Value = ""
  707. } else {
  708. x.Value = string(r.DecodeString())
  709. }
  710. yyj57++
  711. if yyhl57 {
  712. yyb57 = yyj57 > l
  713. } else {
  714. yyb57 = r.CheckBreak()
  715. }
  716. if yyb57 {
  717. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  718. return
  719. }
  720. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  721. if r.TryDecodeAsNil() {
  722. x.Nodes = nil
  723. } else {
  724. yyv61 := &x.Nodes
  725. yyv61.CodecDecodeSelf(d)
  726. }
  727. yyj57++
  728. if yyhl57 {
  729. yyb57 = yyj57 > l
  730. } else {
  731. yyb57 = r.CheckBreak()
  732. }
  733. if yyb57 {
  734. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  735. return
  736. }
  737. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  738. if r.TryDecodeAsNil() {
  739. x.CreatedIndex = 0
  740. } else {
  741. x.CreatedIndex = uint64(r.DecodeUint(64))
  742. }
  743. yyj57++
  744. if yyhl57 {
  745. yyb57 = yyj57 > l
  746. } else {
  747. yyb57 = r.CheckBreak()
  748. }
  749. if yyb57 {
  750. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  751. return
  752. }
  753. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  754. if r.TryDecodeAsNil() {
  755. x.ModifiedIndex = 0
  756. } else {
  757. x.ModifiedIndex = uint64(r.DecodeUint(64))
  758. }
  759. yyj57++
  760. if yyhl57 {
  761. yyb57 = yyj57 > l
  762. } else {
  763. yyb57 = r.CheckBreak()
  764. }
  765. if yyb57 {
  766. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  767. return
  768. }
  769. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  770. if r.TryDecodeAsNil() {
  771. if x.Expiration != nil {
  772. x.Expiration = nil
  773. }
  774. } else {
  775. if x.Expiration == nil {
  776. x.Expiration = new(time.Time)
  777. }
  778. yym65 := z.DecBinary()
  779. _ = yym65
  780. if false {
  781. } else if yym66 := z.TimeRtidIfBinc(); yym66 != 0 {
  782. r.DecodeBuiltin(yym66, x.Expiration)
  783. } else if z.HasExtensions() && z.DecExt(x.Expiration) {
  784. } else if yym65 {
  785. z.DecBinaryUnmarshal(x.Expiration)
  786. } else if !yym65 && z.IsJSONHandle() {
  787. z.DecJSONUnmarshal(x.Expiration)
  788. } else {
  789. z.DecFallback(x.Expiration, false)
  790. }
  791. }
  792. yyj57++
  793. if yyhl57 {
  794. yyb57 = yyj57 > l
  795. } else {
  796. yyb57 = r.CheckBreak()
  797. }
  798. if yyb57 {
  799. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  800. return
  801. }
  802. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  803. if r.TryDecodeAsNil() {
  804. x.TTL = 0
  805. } else {
  806. x.TTL = int64(r.DecodeInt(64))
  807. }
  808. for {
  809. yyj57++
  810. if yyhl57 {
  811. yyb57 = yyj57 > l
  812. } else {
  813. yyb57 = r.CheckBreak()
  814. }
  815. if yyb57 {
  816. break
  817. }
  818. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  819. z.DecStructFieldNotFound(yyj57-1, "")
  820. }
  821. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  822. }
  823. func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) {
  824. var h codecSelfer1819
  825. z, r := codec1978.GenHelperEncoder(e)
  826. _, _, _ = h, z, r
  827. if x == nil {
  828. r.EncodeNil()
  829. } else {
  830. yym68 := z.EncBinary()
  831. _ = yym68
  832. if false {
  833. } else if z.HasExtensions() && z.EncExt(x) {
  834. } else {
  835. h.encNodes((Nodes)(x), e)
  836. }
  837. }
  838. }
  839. func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) {
  840. var h codecSelfer1819
  841. z, r := codec1978.GenHelperDecoder(d)
  842. _, _, _ = h, z, r
  843. yym69 := z.DecBinary()
  844. _ = yym69
  845. if false {
  846. } else if z.HasExtensions() && z.DecExt(x) {
  847. } else {
  848. h.decNodes((*Nodes)(x), d)
  849. }
  850. }
  851. func (x codecSelfer1819) encNodes(v Nodes, e *codec1978.Encoder) {
  852. var h codecSelfer1819
  853. z, r := codec1978.GenHelperEncoder(e)
  854. _, _, _ = h, z, r
  855. r.EncodeArrayStart(len(v))
  856. for _, yyv70 := range v {
  857. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  858. if yyv70 == nil {
  859. r.EncodeNil()
  860. } else {
  861. yyv70.CodecEncodeSelf(e)
  862. }
  863. }
  864. z.EncSendContainerState(codecSelfer_containerArrayEnd1819)
  865. }
  866. func (x codecSelfer1819) decNodes(v *Nodes, d *codec1978.Decoder) {
  867. var h codecSelfer1819
  868. z, r := codec1978.GenHelperDecoder(d)
  869. _, _, _ = h, z, r
  870. yyv71 := *v
  871. yyh71, yyl71 := z.DecSliceHelperStart()
  872. var yyc71 bool
  873. if yyl71 == 0 {
  874. if yyv71 == nil {
  875. yyv71 = []*Node{}
  876. yyc71 = true
  877. } else if len(yyv71) != 0 {
  878. yyv71 = yyv71[:0]
  879. yyc71 = true
  880. }
  881. } else if yyl71 > 0 {
  882. var yyrr71, yyrl71 int
  883. var yyrt71 bool
  884. if yyl71 > cap(yyv71) {
  885. yyrg71 := len(yyv71) > 0
  886. yyv271 := yyv71
  887. yyrl71, yyrt71 = z.DecInferLen(yyl71, z.DecBasicHandle().MaxInitLen, 8)
  888. if yyrt71 {
  889. if yyrl71 <= cap(yyv71) {
  890. yyv71 = yyv71[:yyrl71]
  891. } else {
  892. yyv71 = make([]*Node, yyrl71)
  893. }
  894. } else {
  895. yyv71 = make([]*Node, yyrl71)
  896. }
  897. yyc71 = true
  898. yyrr71 = len(yyv71)
  899. if yyrg71 {
  900. copy(yyv71, yyv271)
  901. }
  902. } else if yyl71 != len(yyv71) {
  903. yyv71 = yyv71[:yyl71]
  904. yyc71 = true
  905. }
  906. yyj71 := 0
  907. for ; yyj71 < yyrr71; yyj71++ {
  908. yyh71.ElemContainerState(yyj71)
  909. if r.TryDecodeAsNil() {
  910. if yyv71[yyj71] != nil {
  911. *yyv71[yyj71] = Node{}
  912. }
  913. } else {
  914. if yyv71[yyj71] == nil {
  915. yyv71[yyj71] = new(Node)
  916. }
  917. yyw72 := yyv71[yyj71]
  918. yyw72.CodecDecodeSelf(d)
  919. }
  920. }
  921. if yyrt71 {
  922. for ; yyj71 < yyl71; yyj71++ {
  923. yyv71 = append(yyv71, nil)
  924. yyh71.ElemContainerState(yyj71)
  925. if r.TryDecodeAsNil() {
  926. if yyv71[yyj71] != nil {
  927. *yyv71[yyj71] = Node{}
  928. }
  929. } else {
  930. if yyv71[yyj71] == nil {
  931. yyv71[yyj71] = new(Node)
  932. }
  933. yyw73 := yyv71[yyj71]
  934. yyw73.CodecDecodeSelf(d)
  935. }
  936. }
  937. }
  938. } else {
  939. yyj71 := 0
  940. for ; !r.CheckBreak(); yyj71++ {
  941. if yyj71 >= len(yyv71) {
  942. yyv71 = append(yyv71, nil) // var yyz71 *Node
  943. yyc71 = true
  944. }
  945. yyh71.ElemContainerState(yyj71)
  946. if yyj71 < len(yyv71) {
  947. if r.TryDecodeAsNil() {
  948. if yyv71[yyj71] != nil {
  949. *yyv71[yyj71] = Node{}
  950. }
  951. } else {
  952. if yyv71[yyj71] == nil {
  953. yyv71[yyj71] = new(Node)
  954. }
  955. yyw74 := yyv71[yyj71]
  956. yyw74.CodecDecodeSelf(d)
  957. }
  958. } else {
  959. z.DecSwallow()
  960. }
  961. }
  962. if yyj71 < len(yyv71) {
  963. yyv71 = yyv71[:yyj71]
  964. yyc71 = true
  965. } else if yyj71 == 0 && yyv71 == nil {
  966. yyv71 = []*Node{}
  967. yyc71 = true
  968. }
  969. }
  970. yyh71.End()
  971. if yyc71 {
  972. *v = yyv71
  973. }
  974. }