keys.generated.go 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087
  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/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. yym1 := z.DecBinary()
  141. _ = yym1
  142. if false {
  143. } else if z.HasExtensions() && z.DecExt(x) {
  144. } else {
  145. yyct2 := r.ContainerType()
  146. if yyct2 == codecSelferValueTypeMap1819 {
  147. yyl2 := r.ReadMapStart()
  148. if yyl2 == 0 {
  149. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  150. } else {
  151. x.codecDecodeSelfFromMap(yyl2, d)
  152. }
  153. } else if yyct2 == codecSelferValueTypeArray1819 {
  154. yyl2 := r.ReadArrayStart()
  155. if yyl2 == 0 {
  156. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  157. } else {
  158. x.codecDecodeSelfFromArray(yyl2, 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 yys3Slc = z.DecScratchBuffer() // default slice to decode into
  170. _ = yys3Slc
  171. var yyhl3 bool = l >= 0
  172. for yyj3 := 0; ; yyj3++ {
  173. if yyhl3 {
  174. if yyj3 >= l {
  175. break
  176. }
  177. } else {
  178. if r.CheckBreak() {
  179. break
  180. }
  181. }
  182. z.DecSendContainerState(codecSelfer_containerMapKey1819)
  183. yys3Slc = r.DecodeBytes(yys3Slc, true, true)
  184. yys3 := string(yys3Slc)
  185. z.DecSendContainerState(codecSelfer_containerMapValue1819)
  186. switch yys3 {
  187. case "action":
  188. if r.TryDecodeAsNil() {
  189. x.Action = ""
  190. } else {
  191. yyv4 := &x.Action
  192. yym5 := z.DecBinary()
  193. _ = yym5
  194. if false {
  195. } else {
  196. *((*string)(yyv4)) = r.DecodeString()
  197. }
  198. }
  199. case "node":
  200. if r.TryDecodeAsNil() {
  201. if x.Node != nil {
  202. x.Node = nil
  203. }
  204. } else {
  205. if x.Node == nil {
  206. x.Node = new(Node)
  207. }
  208. x.Node.CodecDecodeSelf(d)
  209. }
  210. case "prevNode":
  211. if r.TryDecodeAsNil() {
  212. if x.PrevNode != nil {
  213. x.PrevNode = nil
  214. }
  215. } else {
  216. if x.PrevNode == nil {
  217. x.PrevNode = new(Node)
  218. }
  219. x.PrevNode.CodecDecodeSelf(d)
  220. }
  221. default:
  222. z.DecStructFieldNotFound(-1, yys3)
  223. } // end switch yys3
  224. } // end for yyj3
  225. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  226. }
  227. func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
  228. var h codecSelfer1819
  229. z, r := codec1978.GenHelperDecoder(d)
  230. _, _, _ = h, z, r
  231. var yyj8 int
  232. var yyb8 bool
  233. var yyhl8 bool = l >= 0
  234. yyj8++
  235. if yyhl8 {
  236. yyb8 = yyj8 > l
  237. } else {
  238. yyb8 = r.CheckBreak()
  239. }
  240. if yyb8 {
  241. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  242. return
  243. }
  244. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  245. if r.TryDecodeAsNil() {
  246. x.Action = ""
  247. } else {
  248. yyv9 := &x.Action
  249. yym10 := z.DecBinary()
  250. _ = yym10
  251. if false {
  252. } else {
  253. *((*string)(yyv9)) = r.DecodeString()
  254. }
  255. }
  256. yyj8++
  257. if yyhl8 {
  258. yyb8 = yyj8 > l
  259. } else {
  260. yyb8 = r.CheckBreak()
  261. }
  262. if yyb8 {
  263. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  264. return
  265. }
  266. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  267. if r.TryDecodeAsNil() {
  268. if x.Node != nil {
  269. x.Node = nil
  270. }
  271. } else {
  272. if x.Node == nil {
  273. x.Node = new(Node)
  274. }
  275. x.Node.CodecDecodeSelf(d)
  276. }
  277. yyj8++
  278. if yyhl8 {
  279. yyb8 = yyj8 > l
  280. } else {
  281. yyb8 = r.CheckBreak()
  282. }
  283. if yyb8 {
  284. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  285. return
  286. }
  287. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  288. if r.TryDecodeAsNil() {
  289. if x.PrevNode != nil {
  290. x.PrevNode = nil
  291. }
  292. } else {
  293. if x.PrevNode == nil {
  294. x.PrevNode = new(Node)
  295. }
  296. x.PrevNode.CodecDecodeSelf(d)
  297. }
  298. for {
  299. yyj8++
  300. if yyhl8 {
  301. yyb8 = yyj8 > l
  302. } else {
  303. yyb8 = r.CheckBreak()
  304. }
  305. if yyb8 {
  306. break
  307. }
  308. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  309. z.DecStructFieldNotFound(yyj8-1, "")
  310. }
  311. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  312. }
  313. func (x *Node) CodecEncodeSelf(e *codec1978.Encoder) {
  314. var h codecSelfer1819
  315. z, r := codec1978.GenHelperEncoder(e)
  316. _, _, _ = h, z, r
  317. if x == nil {
  318. r.EncodeNil()
  319. } else {
  320. yym1 := z.EncBinary()
  321. _ = yym1
  322. if false {
  323. } else if z.HasExtensions() && z.EncExt(x) {
  324. } else {
  325. yysep2 := !z.EncBinary()
  326. yy2arr2 := z.EncBasicHandle().StructToArray
  327. var yyq2 [8]bool
  328. _, _, _ = yysep2, yyq2, yy2arr2
  329. const yyr2 bool = false
  330. yyq2[1] = x.Dir != false
  331. yyq2[6] = x.Expiration != nil
  332. yyq2[7] = x.TTL != 0
  333. var yynn2 int
  334. if yyr2 || yy2arr2 {
  335. r.EncodeArrayStart(8)
  336. } else {
  337. yynn2 = 5
  338. for _, b := range yyq2 {
  339. if b {
  340. yynn2++
  341. }
  342. }
  343. r.EncodeMapStart(yynn2)
  344. yynn2 = 0
  345. }
  346. if yyr2 || yy2arr2 {
  347. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  348. yym4 := z.EncBinary()
  349. _ = yym4
  350. if false {
  351. } else {
  352. r.EncodeString(codecSelferC_UTF81819, string(x.Key))
  353. }
  354. } else {
  355. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  356. r.EncodeString(codecSelferC_UTF81819, string("key"))
  357. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  358. yym5 := z.EncBinary()
  359. _ = yym5
  360. if false {
  361. } else {
  362. r.EncodeString(codecSelferC_UTF81819, string(x.Key))
  363. }
  364. }
  365. if yyr2 || yy2arr2 {
  366. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  367. if yyq2[1] {
  368. yym7 := z.EncBinary()
  369. _ = yym7
  370. if false {
  371. } else {
  372. r.EncodeBool(bool(x.Dir))
  373. }
  374. } else {
  375. r.EncodeBool(false)
  376. }
  377. } else {
  378. if yyq2[1] {
  379. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  380. r.EncodeString(codecSelferC_UTF81819, string("dir"))
  381. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  382. yym8 := z.EncBinary()
  383. _ = yym8
  384. if false {
  385. } else {
  386. r.EncodeBool(bool(x.Dir))
  387. }
  388. }
  389. }
  390. if yyr2 || yy2arr2 {
  391. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  392. yym10 := z.EncBinary()
  393. _ = yym10
  394. if false {
  395. } else {
  396. r.EncodeString(codecSelferC_UTF81819, string(x.Value))
  397. }
  398. } else {
  399. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  400. r.EncodeString(codecSelferC_UTF81819, string("value"))
  401. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  402. yym11 := z.EncBinary()
  403. _ = yym11
  404. if false {
  405. } else {
  406. r.EncodeString(codecSelferC_UTF81819, string(x.Value))
  407. }
  408. }
  409. if yyr2 || yy2arr2 {
  410. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  411. if x.Nodes == nil {
  412. r.EncodeNil()
  413. } else {
  414. x.Nodes.CodecEncodeSelf(e)
  415. }
  416. } else {
  417. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  418. r.EncodeString(codecSelferC_UTF81819, string("nodes"))
  419. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  420. if x.Nodes == nil {
  421. r.EncodeNil()
  422. } else {
  423. x.Nodes.CodecEncodeSelf(e)
  424. }
  425. }
  426. if yyr2 || yy2arr2 {
  427. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  428. yym16 := z.EncBinary()
  429. _ = yym16
  430. if false {
  431. } else {
  432. r.EncodeUint(uint64(x.CreatedIndex))
  433. }
  434. } else {
  435. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  436. r.EncodeString(codecSelferC_UTF81819, string("createdIndex"))
  437. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  438. yym17 := z.EncBinary()
  439. _ = yym17
  440. if false {
  441. } else {
  442. r.EncodeUint(uint64(x.CreatedIndex))
  443. }
  444. }
  445. if yyr2 || yy2arr2 {
  446. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  447. yym19 := z.EncBinary()
  448. _ = yym19
  449. if false {
  450. } else {
  451. r.EncodeUint(uint64(x.ModifiedIndex))
  452. }
  453. } else {
  454. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  455. r.EncodeString(codecSelferC_UTF81819, string("modifiedIndex"))
  456. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  457. yym20 := z.EncBinary()
  458. _ = yym20
  459. if false {
  460. } else {
  461. r.EncodeUint(uint64(x.ModifiedIndex))
  462. }
  463. }
  464. if yyr2 || yy2arr2 {
  465. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  466. if yyq2[6] {
  467. if x.Expiration == nil {
  468. r.EncodeNil()
  469. } else {
  470. yym22 := z.EncBinary()
  471. _ = yym22
  472. if false {
  473. } else if yym23 := z.TimeRtidIfBinc(); yym23 != 0 {
  474. r.EncodeBuiltin(yym23, x.Expiration)
  475. } else if z.HasExtensions() && z.EncExt(x.Expiration) {
  476. } else if yym22 {
  477. z.EncBinaryMarshal(x.Expiration)
  478. } else if !yym22 && z.IsJSONHandle() {
  479. z.EncJSONMarshal(x.Expiration)
  480. } else {
  481. z.EncFallback(x.Expiration)
  482. }
  483. }
  484. } else {
  485. r.EncodeNil()
  486. }
  487. } else {
  488. if yyq2[6] {
  489. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  490. r.EncodeString(codecSelferC_UTF81819, string("expiration"))
  491. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  492. if x.Expiration == nil {
  493. r.EncodeNil()
  494. } else {
  495. yym24 := z.EncBinary()
  496. _ = yym24
  497. if false {
  498. } else if yym25 := z.TimeRtidIfBinc(); yym25 != 0 {
  499. r.EncodeBuiltin(yym25, x.Expiration)
  500. } else if z.HasExtensions() && z.EncExt(x.Expiration) {
  501. } else if yym24 {
  502. z.EncBinaryMarshal(x.Expiration)
  503. } else if !yym24 && z.IsJSONHandle() {
  504. z.EncJSONMarshal(x.Expiration)
  505. } else {
  506. z.EncFallback(x.Expiration)
  507. }
  508. }
  509. }
  510. }
  511. if yyr2 || yy2arr2 {
  512. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  513. if yyq2[7] {
  514. yym27 := z.EncBinary()
  515. _ = yym27
  516. if false {
  517. } else {
  518. r.EncodeInt(int64(x.TTL))
  519. }
  520. } else {
  521. r.EncodeInt(0)
  522. }
  523. } else {
  524. if yyq2[7] {
  525. z.EncSendContainerState(codecSelfer_containerMapKey1819)
  526. r.EncodeString(codecSelferC_UTF81819, string("ttl"))
  527. z.EncSendContainerState(codecSelfer_containerMapValue1819)
  528. yym28 := z.EncBinary()
  529. _ = yym28
  530. if false {
  531. } else {
  532. r.EncodeInt(int64(x.TTL))
  533. }
  534. }
  535. }
  536. if yyr2 || yy2arr2 {
  537. z.EncSendContainerState(codecSelfer_containerArrayEnd1819)
  538. } else {
  539. z.EncSendContainerState(codecSelfer_containerMapEnd1819)
  540. }
  541. }
  542. }
  543. }
  544. func (x *Node) CodecDecodeSelf(d *codec1978.Decoder) {
  545. var h codecSelfer1819
  546. z, r := codec1978.GenHelperDecoder(d)
  547. _, _, _ = h, z, r
  548. yym1 := z.DecBinary()
  549. _ = yym1
  550. if false {
  551. } else if z.HasExtensions() && z.DecExt(x) {
  552. } else {
  553. yyct2 := r.ContainerType()
  554. if yyct2 == codecSelferValueTypeMap1819 {
  555. yyl2 := r.ReadMapStart()
  556. if yyl2 == 0 {
  557. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  558. } else {
  559. x.codecDecodeSelfFromMap(yyl2, d)
  560. }
  561. } else if yyct2 == codecSelferValueTypeArray1819 {
  562. yyl2 := r.ReadArrayStart()
  563. if yyl2 == 0 {
  564. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  565. } else {
  566. x.codecDecodeSelfFromArray(yyl2, d)
  567. }
  568. } else {
  569. panic(codecSelferOnlyMapOrArrayEncodeToStructErr1819)
  570. }
  571. }
  572. }
  573. func (x *Node) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
  574. var h codecSelfer1819
  575. z, r := codec1978.GenHelperDecoder(d)
  576. _, _, _ = h, z, r
  577. var yys3Slc = z.DecScratchBuffer() // default slice to decode into
  578. _ = yys3Slc
  579. var yyhl3 bool = l >= 0
  580. for yyj3 := 0; ; yyj3++ {
  581. if yyhl3 {
  582. if yyj3 >= l {
  583. break
  584. }
  585. } else {
  586. if r.CheckBreak() {
  587. break
  588. }
  589. }
  590. z.DecSendContainerState(codecSelfer_containerMapKey1819)
  591. yys3Slc = r.DecodeBytes(yys3Slc, true, true)
  592. yys3 := string(yys3Slc)
  593. z.DecSendContainerState(codecSelfer_containerMapValue1819)
  594. switch yys3 {
  595. case "key":
  596. if r.TryDecodeAsNil() {
  597. x.Key = ""
  598. } else {
  599. yyv4 := &x.Key
  600. yym5 := z.DecBinary()
  601. _ = yym5
  602. if false {
  603. } else {
  604. *((*string)(yyv4)) = r.DecodeString()
  605. }
  606. }
  607. case "dir":
  608. if r.TryDecodeAsNil() {
  609. x.Dir = false
  610. } else {
  611. yyv6 := &x.Dir
  612. yym7 := z.DecBinary()
  613. _ = yym7
  614. if false {
  615. } else {
  616. *((*bool)(yyv6)) = r.DecodeBool()
  617. }
  618. }
  619. case "value":
  620. if r.TryDecodeAsNil() {
  621. x.Value = ""
  622. } else {
  623. yyv8 := &x.Value
  624. yym9 := z.DecBinary()
  625. _ = yym9
  626. if false {
  627. } else {
  628. *((*string)(yyv8)) = r.DecodeString()
  629. }
  630. }
  631. case "nodes":
  632. if r.TryDecodeAsNil() {
  633. x.Nodes = nil
  634. } else {
  635. yyv10 := &x.Nodes
  636. yyv10.CodecDecodeSelf(d)
  637. }
  638. case "createdIndex":
  639. if r.TryDecodeAsNil() {
  640. x.CreatedIndex = 0
  641. } else {
  642. yyv11 := &x.CreatedIndex
  643. yym12 := z.DecBinary()
  644. _ = yym12
  645. if false {
  646. } else {
  647. *((*uint64)(yyv11)) = uint64(r.DecodeUint(64))
  648. }
  649. }
  650. case "modifiedIndex":
  651. if r.TryDecodeAsNil() {
  652. x.ModifiedIndex = 0
  653. } else {
  654. yyv13 := &x.ModifiedIndex
  655. yym14 := z.DecBinary()
  656. _ = yym14
  657. if false {
  658. } else {
  659. *((*uint64)(yyv13)) = uint64(r.DecodeUint(64))
  660. }
  661. }
  662. case "expiration":
  663. if r.TryDecodeAsNil() {
  664. if x.Expiration != nil {
  665. x.Expiration = nil
  666. }
  667. } else {
  668. if x.Expiration == nil {
  669. x.Expiration = new(time.Time)
  670. }
  671. yym16 := z.DecBinary()
  672. _ = yym16
  673. if false {
  674. } else if yym17 := z.TimeRtidIfBinc(); yym17 != 0 {
  675. r.DecodeBuiltin(yym17, x.Expiration)
  676. } else if z.HasExtensions() && z.DecExt(x.Expiration) {
  677. } else if yym16 {
  678. z.DecBinaryUnmarshal(x.Expiration)
  679. } else if !yym16 && z.IsJSONHandle() {
  680. z.DecJSONUnmarshal(x.Expiration)
  681. } else {
  682. z.DecFallback(x.Expiration, false)
  683. }
  684. }
  685. case "ttl":
  686. if r.TryDecodeAsNil() {
  687. x.TTL = 0
  688. } else {
  689. yyv18 := &x.TTL
  690. yym19 := z.DecBinary()
  691. _ = yym19
  692. if false {
  693. } else {
  694. *((*int64)(yyv18)) = int64(r.DecodeInt(64))
  695. }
  696. }
  697. default:
  698. z.DecStructFieldNotFound(-1, yys3)
  699. } // end switch yys3
  700. } // end for yyj3
  701. z.DecSendContainerState(codecSelfer_containerMapEnd1819)
  702. }
  703. func (x *Node) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
  704. var h codecSelfer1819
  705. z, r := codec1978.GenHelperDecoder(d)
  706. _, _, _ = h, z, r
  707. var yyj20 int
  708. var yyb20 bool
  709. var yyhl20 bool = l >= 0
  710. yyj20++
  711. if yyhl20 {
  712. yyb20 = yyj20 > l
  713. } else {
  714. yyb20 = r.CheckBreak()
  715. }
  716. if yyb20 {
  717. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  718. return
  719. }
  720. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  721. if r.TryDecodeAsNil() {
  722. x.Key = ""
  723. } else {
  724. yyv21 := &x.Key
  725. yym22 := z.DecBinary()
  726. _ = yym22
  727. if false {
  728. } else {
  729. *((*string)(yyv21)) = r.DecodeString()
  730. }
  731. }
  732. yyj20++
  733. if yyhl20 {
  734. yyb20 = yyj20 > l
  735. } else {
  736. yyb20 = r.CheckBreak()
  737. }
  738. if yyb20 {
  739. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  740. return
  741. }
  742. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  743. if r.TryDecodeAsNil() {
  744. x.Dir = false
  745. } else {
  746. yyv23 := &x.Dir
  747. yym24 := z.DecBinary()
  748. _ = yym24
  749. if false {
  750. } else {
  751. *((*bool)(yyv23)) = r.DecodeBool()
  752. }
  753. }
  754. yyj20++
  755. if yyhl20 {
  756. yyb20 = yyj20 > l
  757. } else {
  758. yyb20 = r.CheckBreak()
  759. }
  760. if yyb20 {
  761. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  762. return
  763. }
  764. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  765. if r.TryDecodeAsNil() {
  766. x.Value = ""
  767. } else {
  768. yyv25 := &x.Value
  769. yym26 := z.DecBinary()
  770. _ = yym26
  771. if false {
  772. } else {
  773. *((*string)(yyv25)) = r.DecodeString()
  774. }
  775. }
  776. yyj20++
  777. if yyhl20 {
  778. yyb20 = yyj20 > l
  779. } else {
  780. yyb20 = r.CheckBreak()
  781. }
  782. if yyb20 {
  783. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  784. return
  785. }
  786. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  787. if r.TryDecodeAsNil() {
  788. x.Nodes = nil
  789. } else {
  790. yyv27 := &x.Nodes
  791. yyv27.CodecDecodeSelf(d)
  792. }
  793. yyj20++
  794. if yyhl20 {
  795. yyb20 = yyj20 > l
  796. } else {
  797. yyb20 = r.CheckBreak()
  798. }
  799. if yyb20 {
  800. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  801. return
  802. }
  803. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  804. if r.TryDecodeAsNil() {
  805. x.CreatedIndex = 0
  806. } else {
  807. yyv28 := &x.CreatedIndex
  808. yym29 := z.DecBinary()
  809. _ = yym29
  810. if false {
  811. } else {
  812. *((*uint64)(yyv28)) = uint64(r.DecodeUint(64))
  813. }
  814. }
  815. yyj20++
  816. if yyhl20 {
  817. yyb20 = yyj20 > l
  818. } else {
  819. yyb20 = r.CheckBreak()
  820. }
  821. if yyb20 {
  822. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  823. return
  824. }
  825. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  826. if r.TryDecodeAsNil() {
  827. x.ModifiedIndex = 0
  828. } else {
  829. yyv30 := &x.ModifiedIndex
  830. yym31 := z.DecBinary()
  831. _ = yym31
  832. if false {
  833. } else {
  834. *((*uint64)(yyv30)) = uint64(r.DecodeUint(64))
  835. }
  836. }
  837. yyj20++
  838. if yyhl20 {
  839. yyb20 = yyj20 > l
  840. } else {
  841. yyb20 = r.CheckBreak()
  842. }
  843. if yyb20 {
  844. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  845. return
  846. }
  847. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  848. if r.TryDecodeAsNil() {
  849. if x.Expiration != nil {
  850. x.Expiration = nil
  851. }
  852. } else {
  853. if x.Expiration == nil {
  854. x.Expiration = new(time.Time)
  855. }
  856. yym33 := z.DecBinary()
  857. _ = yym33
  858. if false {
  859. } else if yym34 := z.TimeRtidIfBinc(); yym34 != 0 {
  860. r.DecodeBuiltin(yym34, x.Expiration)
  861. } else if z.HasExtensions() && z.DecExt(x.Expiration) {
  862. } else if yym33 {
  863. z.DecBinaryUnmarshal(x.Expiration)
  864. } else if !yym33 && z.IsJSONHandle() {
  865. z.DecJSONUnmarshal(x.Expiration)
  866. } else {
  867. z.DecFallback(x.Expiration, false)
  868. }
  869. }
  870. yyj20++
  871. if yyhl20 {
  872. yyb20 = yyj20 > l
  873. } else {
  874. yyb20 = r.CheckBreak()
  875. }
  876. if yyb20 {
  877. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  878. return
  879. }
  880. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  881. if r.TryDecodeAsNil() {
  882. x.TTL = 0
  883. } else {
  884. yyv35 := &x.TTL
  885. yym36 := z.DecBinary()
  886. _ = yym36
  887. if false {
  888. } else {
  889. *((*int64)(yyv35)) = int64(r.DecodeInt(64))
  890. }
  891. }
  892. for {
  893. yyj20++
  894. if yyhl20 {
  895. yyb20 = yyj20 > l
  896. } else {
  897. yyb20 = r.CheckBreak()
  898. }
  899. if yyb20 {
  900. break
  901. }
  902. z.DecSendContainerState(codecSelfer_containerArrayElem1819)
  903. z.DecStructFieldNotFound(yyj20-1, "")
  904. }
  905. z.DecSendContainerState(codecSelfer_containerArrayEnd1819)
  906. }
  907. func (x Nodes) CodecEncodeSelf(e *codec1978.Encoder) {
  908. var h codecSelfer1819
  909. z, r := codec1978.GenHelperEncoder(e)
  910. _, _, _ = h, z, r
  911. if x == nil {
  912. r.EncodeNil()
  913. } else {
  914. yym1 := z.EncBinary()
  915. _ = yym1
  916. if false {
  917. } else if z.HasExtensions() && z.EncExt(x) {
  918. } else {
  919. h.encNodes((Nodes)(x), e)
  920. }
  921. }
  922. }
  923. func (x *Nodes) CodecDecodeSelf(d *codec1978.Decoder) {
  924. var h codecSelfer1819
  925. z, r := codec1978.GenHelperDecoder(d)
  926. _, _, _ = h, z, r
  927. yym1 := z.DecBinary()
  928. _ = yym1
  929. if false {
  930. } else if z.HasExtensions() && z.DecExt(x) {
  931. } else {
  932. h.decNodes((*Nodes)(x), d)
  933. }
  934. }
  935. func (x codecSelfer1819) encNodes(v Nodes, e *codec1978.Encoder) {
  936. var h codecSelfer1819
  937. z, r := codec1978.GenHelperEncoder(e)
  938. _, _, _ = h, z, r
  939. r.EncodeArrayStart(len(v))
  940. for _, yyv1 := range v {
  941. z.EncSendContainerState(codecSelfer_containerArrayElem1819)
  942. if yyv1 == nil {
  943. r.EncodeNil()
  944. } else {
  945. yyv1.CodecEncodeSelf(e)
  946. }
  947. }
  948. z.EncSendContainerState(codecSelfer_containerArrayEnd1819)
  949. }
  950. func (x codecSelfer1819) decNodes(v *Nodes, d *codec1978.Decoder) {
  951. var h codecSelfer1819
  952. z, r := codec1978.GenHelperDecoder(d)
  953. _, _, _ = h, z, r
  954. yyv1 := *v
  955. yyh1, yyl1 := z.DecSliceHelperStart()
  956. var yyc1 bool
  957. _ = yyc1
  958. if yyl1 == 0 {
  959. if yyv1 == nil {
  960. yyv1 = []*Node{}
  961. yyc1 = true
  962. } else if len(yyv1) != 0 {
  963. yyv1 = yyv1[:0]
  964. yyc1 = true
  965. }
  966. } else if yyl1 > 0 {
  967. var yyrr1, yyrl1 int
  968. var yyrt1 bool
  969. _, _ = yyrl1, yyrt1
  970. yyrr1 = yyl1 // len(yyv1)
  971. if yyl1 > cap(yyv1) {
  972. yyrg1 := len(yyv1) > 0
  973. yyv21 := yyv1
  974. yyrl1, yyrt1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 8)
  975. if yyrt1 {
  976. if yyrl1 <= cap(yyv1) {
  977. yyv1 = yyv1[:yyrl1]
  978. } else {
  979. yyv1 = make([]*Node, yyrl1)
  980. }
  981. } else {
  982. yyv1 = make([]*Node, yyrl1)
  983. }
  984. yyc1 = true
  985. yyrr1 = len(yyv1)
  986. if yyrg1 {
  987. copy(yyv1, yyv21)
  988. }
  989. } else if yyl1 != len(yyv1) {
  990. yyv1 = yyv1[:yyl1]
  991. yyc1 = true
  992. }
  993. yyj1 := 0
  994. for ; yyj1 < yyrr1; yyj1++ {
  995. yyh1.ElemContainerState(yyj1)
  996. if r.TryDecodeAsNil() {
  997. if yyv1[yyj1] != nil {
  998. *yyv1[yyj1] = Node{}
  999. }
  1000. } else {
  1001. if yyv1[yyj1] == nil {
  1002. yyv1[yyj1] = new(Node)
  1003. }
  1004. yyw2 := yyv1[yyj1]
  1005. yyw2.CodecDecodeSelf(d)
  1006. }
  1007. }
  1008. if yyrt1 {
  1009. for ; yyj1 < yyl1; yyj1++ {
  1010. yyv1 = append(yyv1, nil)
  1011. yyh1.ElemContainerState(yyj1)
  1012. if r.TryDecodeAsNil() {
  1013. if yyv1[yyj1] != nil {
  1014. *yyv1[yyj1] = Node{}
  1015. }
  1016. } else {
  1017. if yyv1[yyj1] == nil {
  1018. yyv1[yyj1] = new(Node)
  1019. }
  1020. yyw3 := yyv1[yyj1]
  1021. yyw3.CodecDecodeSelf(d)
  1022. }
  1023. }
  1024. }
  1025. } else {
  1026. yyj1 := 0
  1027. for ; !r.CheckBreak(); yyj1++ {
  1028. if yyj1 >= len(yyv1) {
  1029. yyv1 = append(yyv1, nil) // var yyz1 *Node
  1030. yyc1 = true
  1031. }
  1032. yyh1.ElemContainerState(yyj1)
  1033. if yyj1 < len(yyv1) {
  1034. if r.TryDecodeAsNil() {
  1035. if yyv1[yyj1] != nil {
  1036. *yyv1[yyj1] = Node{}
  1037. }
  1038. } else {
  1039. if yyv1[yyj1] == nil {
  1040. yyv1[yyj1] = new(Node)
  1041. }
  1042. yyw4 := yyv1[yyj1]
  1043. yyw4.CodecDecodeSelf(d)
  1044. }
  1045. } else {
  1046. z.DecSwallow()
  1047. }
  1048. }
  1049. if yyj1 < len(yyv1) {
  1050. yyv1 = yyv1[:yyj1]
  1051. yyc1 = true
  1052. } else if yyj1 == 0 && yyv1 == nil {
  1053. yyv1 = []*Node{}
  1054. yyc1 = true
  1055. }
  1056. }
  1057. yyh1.End()
  1058. if yyc1 {
  1059. *v = yyv1
  1060. }
  1061. }