easyjson.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package performance
  3. import (
  4. json "encoding/json"
  5. easyjson "github.com/mailru/easyjson"
  6. jlexer "github.com/mailru/easyjson/jlexer"
  7. jwriter "github.com/mailru/easyjson/jwriter"
  8. )
  9. // suppress unused package warning
  10. var (
  11. _ *json.RawMessage
  12. _ *jlexer.Lexer
  13. _ *jwriter.Writer
  14. _ easyjson.Marshaler
  15. )
  16. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance(in *jlexer.Lexer, out *Metric) {
  17. isTopLevel := in.IsStart()
  18. if in.IsNull() {
  19. if isTopLevel {
  20. in.Consumed()
  21. }
  22. in.Skip()
  23. return
  24. }
  25. in.Delim('{')
  26. for !in.IsDelim('}') {
  27. key := in.UnsafeFieldName(false)
  28. in.WantColon()
  29. if in.IsNull() {
  30. in.Skip()
  31. in.WantComma()
  32. continue
  33. }
  34. switch key {
  35. case "name":
  36. out.Name = string(in.String())
  37. case "value":
  38. out.Value = float64(in.Float64())
  39. default:
  40. in.SkipRecursive()
  41. }
  42. in.WantComma()
  43. }
  44. in.Delim('}')
  45. if isTopLevel {
  46. in.Consumed()
  47. }
  48. }
  49. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance(out *jwriter.Writer, in Metric) {
  50. out.RawByte('{')
  51. first := true
  52. _ = first
  53. {
  54. const prefix string = ",\"name\":"
  55. out.RawString(prefix[1:])
  56. out.String(string(in.Name))
  57. }
  58. {
  59. const prefix string = ",\"value\":"
  60. out.RawString(prefix)
  61. out.Float64(float64(in.Value))
  62. }
  63. out.RawByte('}')
  64. }
  65. // MarshalJSON supports json.Marshaler interface
  66. func (v Metric) MarshalJSON() ([]byte, error) {
  67. w := jwriter.Writer{}
  68. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance(&w, v)
  69. return w.Buffer.BuildBytes(), w.Error
  70. }
  71. // MarshalEasyJSON supports easyjson.Marshaler interface
  72. func (v Metric) MarshalEasyJSON(w *jwriter.Writer) {
  73. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance(w, v)
  74. }
  75. // UnmarshalJSON supports json.Unmarshaler interface
  76. func (v *Metric) UnmarshalJSON(data []byte) error {
  77. r := jlexer.Lexer{Data: data}
  78. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance(&r, v)
  79. return r.Error()
  80. }
  81. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  82. func (v *Metric) UnmarshalEasyJSON(l *jlexer.Lexer) {
  83. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance(l, v)
  84. }
  85. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance1(in *jlexer.Lexer, out *GetMetricsReturns) {
  86. isTopLevel := in.IsStart()
  87. if in.IsNull() {
  88. if isTopLevel {
  89. in.Consumed()
  90. }
  91. in.Skip()
  92. return
  93. }
  94. in.Delim('{')
  95. for !in.IsDelim('}') {
  96. key := in.UnsafeFieldName(false)
  97. in.WantColon()
  98. if in.IsNull() {
  99. in.Skip()
  100. in.WantComma()
  101. continue
  102. }
  103. switch key {
  104. case "metrics":
  105. if in.IsNull() {
  106. in.Skip()
  107. out.Metrics = nil
  108. } else {
  109. in.Delim('[')
  110. if out.Metrics == nil {
  111. if !in.IsDelim(']') {
  112. out.Metrics = make([]*Metric, 0, 8)
  113. } else {
  114. out.Metrics = []*Metric{}
  115. }
  116. } else {
  117. out.Metrics = (out.Metrics)[:0]
  118. }
  119. for !in.IsDelim(']') {
  120. var v1 *Metric
  121. if in.IsNull() {
  122. in.Skip()
  123. v1 = nil
  124. } else {
  125. if v1 == nil {
  126. v1 = new(Metric)
  127. }
  128. (*v1).UnmarshalEasyJSON(in)
  129. }
  130. out.Metrics = append(out.Metrics, v1)
  131. in.WantComma()
  132. }
  133. in.Delim(']')
  134. }
  135. default:
  136. in.SkipRecursive()
  137. }
  138. in.WantComma()
  139. }
  140. in.Delim('}')
  141. if isTopLevel {
  142. in.Consumed()
  143. }
  144. }
  145. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance1(out *jwriter.Writer, in GetMetricsReturns) {
  146. out.RawByte('{')
  147. first := true
  148. _ = first
  149. if len(in.Metrics) != 0 {
  150. const prefix string = ",\"metrics\":"
  151. first = false
  152. out.RawString(prefix[1:])
  153. {
  154. out.RawByte('[')
  155. for v2, v3 := range in.Metrics {
  156. if v2 > 0 {
  157. out.RawByte(',')
  158. }
  159. if v3 == nil {
  160. out.RawString("null")
  161. } else {
  162. (*v3).MarshalEasyJSON(out)
  163. }
  164. }
  165. out.RawByte(']')
  166. }
  167. }
  168. out.RawByte('}')
  169. }
  170. // MarshalJSON supports json.Marshaler interface
  171. func (v GetMetricsReturns) MarshalJSON() ([]byte, error) {
  172. w := jwriter.Writer{}
  173. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance1(&w, v)
  174. return w.Buffer.BuildBytes(), w.Error
  175. }
  176. // MarshalEasyJSON supports easyjson.Marshaler interface
  177. func (v GetMetricsReturns) MarshalEasyJSON(w *jwriter.Writer) {
  178. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance1(w, v)
  179. }
  180. // UnmarshalJSON supports json.Unmarshaler interface
  181. func (v *GetMetricsReturns) UnmarshalJSON(data []byte) error {
  182. r := jlexer.Lexer{Data: data}
  183. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance1(&r, v)
  184. return r.Error()
  185. }
  186. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  187. func (v *GetMetricsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  188. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance1(l, v)
  189. }
  190. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance2(in *jlexer.Lexer, out *GetMetricsParams) {
  191. isTopLevel := in.IsStart()
  192. if in.IsNull() {
  193. if isTopLevel {
  194. in.Consumed()
  195. }
  196. in.Skip()
  197. return
  198. }
  199. in.Delim('{')
  200. for !in.IsDelim('}') {
  201. key := in.UnsafeFieldName(false)
  202. in.WantColon()
  203. if in.IsNull() {
  204. in.Skip()
  205. in.WantComma()
  206. continue
  207. }
  208. switch key {
  209. default:
  210. in.SkipRecursive()
  211. }
  212. in.WantComma()
  213. }
  214. in.Delim('}')
  215. if isTopLevel {
  216. in.Consumed()
  217. }
  218. }
  219. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance2(out *jwriter.Writer, in GetMetricsParams) {
  220. out.RawByte('{')
  221. first := true
  222. _ = first
  223. out.RawByte('}')
  224. }
  225. // MarshalJSON supports json.Marshaler interface
  226. func (v GetMetricsParams) MarshalJSON() ([]byte, error) {
  227. w := jwriter.Writer{}
  228. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance2(&w, v)
  229. return w.Buffer.BuildBytes(), w.Error
  230. }
  231. // MarshalEasyJSON supports easyjson.Marshaler interface
  232. func (v GetMetricsParams) MarshalEasyJSON(w *jwriter.Writer) {
  233. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance2(w, v)
  234. }
  235. // UnmarshalJSON supports json.Unmarshaler interface
  236. func (v *GetMetricsParams) UnmarshalJSON(data []byte) error {
  237. r := jlexer.Lexer{Data: data}
  238. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance2(&r, v)
  239. return r.Error()
  240. }
  241. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  242. func (v *GetMetricsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  243. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance2(l, v)
  244. }
  245. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance3(in *jlexer.Lexer, out *EventMetrics) {
  246. isTopLevel := in.IsStart()
  247. if in.IsNull() {
  248. if isTopLevel {
  249. in.Consumed()
  250. }
  251. in.Skip()
  252. return
  253. }
  254. in.Delim('{')
  255. for !in.IsDelim('}') {
  256. key := in.UnsafeFieldName(false)
  257. in.WantColon()
  258. if in.IsNull() {
  259. in.Skip()
  260. in.WantComma()
  261. continue
  262. }
  263. switch key {
  264. case "metrics":
  265. if in.IsNull() {
  266. in.Skip()
  267. out.Metrics = nil
  268. } else {
  269. in.Delim('[')
  270. if out.Metrics == nil {
  271. if !in.IsDelim(']') {
  272. out.Metrics = make([]*Metric, 0, 8)
  273. } else {
  274. out.Metrics = []*Metric{}
  275. }
  276. } else {
  277. out.Metrics = (out.Metrics)[:0]
  278. }
  279. for !in.IsDelim(']') {
  280. var v4 *Metric
  281. if in.IsNull() {
  282. in.Skip()
  283. v4 = nil
  284. } else {
  285. if v4 == nil {
  286. v4 = new(Metric)
  287. }
  288. (*v4).UnmarshalEasyJSON(in)
  289. }
  290. out.Metrics = append(out.Metrics, v4)
  291. in.WantComma()
  292. }
  293. in.Delim(']')
  294. }
  295. case "title":
  296. out.Title = string(in.String())
  297. default:
  298. in.SkipRecursive()
  299. }
  300. in.WantComma()
  301. }
  302. in.Delim('}')
  303. if isTopLevel {
  304. in.Consumed()
  305. }
  306. }
  307. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance3(out *jwriter.Writer, in EventMetrics) {
  308. out.RawByte('{')
  309. first := true
  310. _ = first
  311. {
  312. const prefix string = ",\"metrics\":"
  313. out.RawString(prefix[1:])
  314. if in.Metrics == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
  315. out.RawString("null")
  316. } else {
  317. out.RawByte('[')
  318. for v5, v6 := range in.Metrics {
  319. if v5 > 0 {
  320. out.RawByte(',')
  321. }
  322. if v6 == nil {
  323. out.RawString("null")
  324. } else {
  325. (*v6).MarshalEasyJSON(out)
  326. }
  327. }
  328. out.RawByte(']')
  329. }
  330. }
  331. {
  332. const prefix string = ",\"title\":"
  333. out.RawString(prefix)
  334. out.String(string(in.Title))
  335. }
  336. out.RawByte('}')
  337. }
  338. // MarshalJSON supports json.Marshaler interface
  339. func (v EventMetrics) MarshalJSON() ([]byte, error) {
  340. w := jwriter.Writer{}
  341. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance3(&w, v)
  342. return w.Buffer.BuildBytes(), w.Error
  343. }
  344. // MarshalEasyJSON supports easyjson.Marshaler interface
  345. func (v EventMetrics) MarshalEasyJSON(w *jwriter.Writer) {
  346. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance3(w, v)
  347. }
  348. // UnmarshalJSON supports json.Unmarshaler interface
  349. func (v *EventMetrics) UnmarshalJSON(data []byte) error {
  350. r := jlexer.Lexer{Data: data}
  351. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance3(&r, v)
  352. return r.Error()
  353. }
  354. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  355. func (v *EventMetrics) UnmarshalEasyJSON(l *jlexer.Lexer) {
  356. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance3(l, v)
  357. }
  358. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance4(in *jlexer.Lexer, out *EnableParams) {
  359. isTopLevel := in.IsStart()
  360. if in.IsNull() {
  361. if isTopLevel {
  362. in.Consumed()
  363. }
  364. in.Skip()
  365. return
  366. }
  367. in.Delim('{')
  368. for !in.IsDelim('}') {
  369. key := in.UnsafeFieldName(false)
  370. in.WantColon()
  371. if in.IsNull() {
  372. in.Skip()
  373. in.WantComma()
  374. continue
  375. }
  376. switch key {
  377. case "timeDomain":
  378. (out.TimeDomain).UnmarshalEasyJSON(in)
  379. default:
  380. in.SkipRecursive()
  381. }
  382. in.WantComma()
  383. }
  384. in.Delim('}')
  385. if isTopLevel {
  386. in.Consumed()
  387. }
  388. }
  389. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance4(out *jwriter.Writer, in EnableParams) {
  390. out.RawByte('{')
  391. first := true
  392. _ = first
  393. if in.TimeDomain != "" {
  394. const prefix string = ",\"timeDomain\":"
  395. first = false
  396. out.RawString(prefix[1:])
  397. (in.TimeDomain).MarshalEasyJSON(out)
  398. }
  399. out.RawByte('}')
  400. }
  401. // MarshalJSON supports json.Marshaler interface
  402. func (v EnableParams) MarshalJSON() ([]byte, error) {
  403. w := jwriter.Writer{}
  404. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance4(&w, v)
  405. return w.Buffer.BuildBytes(), w.Error
  406. }
  407. // MarshalEasyJSON supports easyjson.Marshaler interface
  408. func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
  409. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance4(w, v)
  410. }
  411. // UnmarshalJSON supports json.Unmarshaler interface
  412. func (v *EnableParams) UnmarshalJSON(data []byte) error {
  413. r := jlexer.Lexer{Data: data}
  414. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance4(&r, v)
  415. return r.Error()
  416. }
  417. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  418. func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  419. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance4(l, v)
  420. }
  421. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance5(in *jlexer.Lexer, out *DisableParams) {
  422. isTopLevel := in.IsStart()
  423. if in.IsNull() {
  424. if isTopLevel {
  425. in.Consumed()
  426. }
  427. in.Skip()
  428. return
  429. }
  430. in.Delim('{')
  431. for !in.IsDelim('}') {
  432. key := in.UnsafeFieldName(false)
  433. in.WantColon()
  434. if in.IsNull() {
  435. in.Skip()
  436. in.WantComma()
  437. continue
  438. }
  439. switch key {
  440. default:
  441. in.SkipRecursive()
  442. }
  443. in.WantComma()
  444. }
  445. in.Delim('}')
  446. if isTopLevel {
  447. in.Consumed()
  448. }
  449. }
  450. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance5(out *jwriter.Writer, in DisableParams) {
  451. out.RawByte('{')
  452. first := true
  453. _ = first
  454. out.RawByte('}')
  455. }
  456. // MarshalJSON supports json.Marshaler interface
  457. func (v DisableParams) MarshalJSON() ([]byte, error) {
  458. w := jwriter.Writer{}
  459. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance5(&w, v)
  460. return w.Buffer.BuildBytes(), w.Error
  461. }
  462. // MarshalEasyJSON supports easyjson.Marshaler interface
  463. func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
  464. easyjsonC5a4559bEncodeGithubComChromedpCdprotoPerformance5(w, v)
  465. }
  466. // UnmarshalJSON supports json.Unmarshaler interface
  467. func (v *DisableParams) UnmarshalJSON(data []byte) error {
  468. r := jlexer.Lexer{Data: data}
  469. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance5(&r, v)
  470. return r.Error()
  471. }
  472. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  473. func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  474. easyjsonC5a4559bDecodeGithubComChromedpCdprotoPerformance5(l, v)
  475. }