easyjson.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
  2. package extensions
  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 easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions(in *jlexer.Lexer, out *LoadUnpackedReturns) {
  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 "id":
  36. out.ID = string(in.String())
  37. default:
  38. in.SkipRecursive()
  39. }
  40. in.WantComma()
  41. }
  42. in.Delim('}')
  43. if isTopLevel {
  44. in.Consumed()
  45. }
  46. }
  47. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions(out *jwriter.Writer, in LoadUnpackedReturns) {
  48. out.RawByte('{')
  49. first := true
  50. _ = first
  51. if in.ID != "" {
  52. const prefix string = ",\"id\":"
  53. first = false
  54. out.RawString(prefix[1:])
  55. out.String(string(in.ID))
  56. }
  57. out.RawByte('}')
  58. }
  59. // MarshalJSON supports json.Marshaler interface
  60. func (v LoadUnpackedReturns) MarshalJSON() ([]byte, error) {
  61. w := jwriter.Writer{}
  62. easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions(&w, v)
  63. return w.Buffer.BuildBytes(), w.Error
  64. }
  65. // MarshalEasyJSON supports easyjson.Marshaler interface
  66. func (v LoadUnpackedReturns) MarshalEasyJSON(w *jwriter.Writer) {
  67. easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions(w, v)
  68. }
  69. // UnmarshalJSON supports json.Unmarshaler interface
  70. func (v *LoadUnpackedReturns) UnmarshalJSON(data []byte) error {
  71. r := jlexer.Lexer{Data: data}
  72. easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions(&r, v)
  73. return r.Error()
  74. }
  75. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  76. func (v *LoadUnpackedReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
  77. easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions(l, v)
  78. }
  79. func easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions1(in *jlexer.Lexer, out *LoadUnpackedParams) {
  80. isTopLevel := in.IsStart()
  81. if in.IsNull() {
  82. if isTopLevel {
  83. in.Consumed()
  84. }
  85. in.Skip()
  86. return
  87. }
  88. in.Delim('{')
  89. for !in.IsDelim('}') {
  90. key := in.UnsafeFieldName(false)
  91. in.WantColon()
  92. if in.IsNull() {
  93. in.Skip()
  94. in.WantComma()
  95. continue
  96. }
  97. switch key {
  98. case "path":
  99. out.Path = string(in.String())
  100. default:
  101. in.SkipRecursive()
  102. }
  103. in.WantComma()
  104. }
  105. in.Delim('}')
  106. if isTopLevel {
  107. in.Consumed()
  108. }
  109. }
  110. func easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions1(out *jwriter.Writer, in LoadUnpackedParams) {
  111. out.RawByte('{')
  112. first := true
  113. _ = first
  114. {
  115. const prefix string = ",\"path\":"
  116. out.RawString(prefix[1:])
  117. out.String(string(in.Path))
  118. }
  119. out.RawByte('}')
  120. }
  121. // MarshalJSON supports json.Marshaler interface
  122. func (v LoadUnpackedParams) MarshalJSON() ([]byte, error) {
  123. w := jwriter.Writer{}
  124. easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions1(&w, v)
  125. return w.Buffer.BuildBytes(), w.Error
  126. }
  127. // MarshalEasyJSON supports easyjson.Marshaler interface
  128. func (v LoadUnpackedParams) MarshalEasyJSON(w *jwriter.Writer) {
  129. easyjsonC5a4559bEncodeGithubComChromedpCdprotoExtensions1(w, v)
  130. }
  131. // UnmarshalJSON supports json.Unmarshaler interface
  132. func (v *LoadUnpackedParams) UnmarshalJSON(data []byte) error {
  133. r := jlexer.Lexer{Data: data}
  134. easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions1(&r, v)
  135. return r.Error()
  136. }
  137. // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
  138. func (v *LoadUnpackedParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
  139. easyjsonC5a4559bDecodeGithubComChromedpCdprotoExtensions1(l, v)
  140. }