123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
- package utils
- import (
- json "encoding/json"
- easyjson "github.com/mailru/easyjson"
- jlexer "github.com/mailru/easyjson/jlexer"
- jwriter "github.com/mailru/easyjson/jwriter"
- )
- // suppress unused package warning
- var (
- _ *json.RawMessage
- _ *jlexer.Lexer
- _ *jwriter.Writer
- _ easyjson.Marshaler
- )
- func easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils(in *jlexer.Lexer, out *ResHead) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeString()
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "errcode":
- out.ErrCode = int(in.Int())
- case "errmsg":
- out.ErrMsg = string(in.String())
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils(out *jwriter.Writer, in ResHead) {
- out.RawByte('{')
- first := true
- _ = first
- {
- const prefix string = ",\"errcode\":"
- out.RawString(prefix[1:])
- out.Int(int(in.ErrCode))
- }
- if in.ErrMsg != "" {
- const prefix string = ",\"errmsg\":"
- out.RawString(prefix)
- out.String(string(in.ErrMsg))
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v ResHead) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v ResHead) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *ResHead) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *ResHead) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils(l, v)
- }
- func easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils1(in *jlexer.Lexer, out *Res) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeString()
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- case "head":
- (out.Head).UnmarshalEasyJSON(in)
- case "data":
- if m, ok := out.Data.(easyjson.Unmarshaler); ok {
- m.UnmarshalEasyJSON(in)
- } else if m, ok := out.Data.(json.Unmarshaler); ok {
- _ = m.UnmarshalJSON(in.Raw())
- } else {
- out.Data = in.Interface()
- }
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils1(out *jwriter.Writer, in Res) {
- out.RawByte('{')
- first := true
- _ = first
- {
- const prefix string = ",\"head\":"
- out.RawString(prefix[1:])
- (in.Head).MarshalEasyJSON(out)
- }
- if in.Data != nil {
- const prefix string = ",\"data\":"
- out.RawString(prefix)
- if m, ok := in.Data.(easyjson.Marshaler); ok {
- m.MarshalEasyJSON(out)
- } else if m, ok := in.Data.(json.Marshaler); ok {
- out.Raw(m.MarshalJSON())
- } else {
- out.Raw(json.Marshal(in.Data))
- }
- }
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v Res) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils1(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v Res) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils1(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *Res) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils1(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *Res) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils1(l, v)
- }
- func easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils2(in *jlexer.Lexer, out *RequestPromise) {
- isTopLevel := in.IsStart()
- if in.IsNull() {
- if isTopLevel {
- in.Consumed()
- }
- in.Skip()
- return
- }
- in.Delim('{')
- for !in.IsDelim('}') {
- key := in.UnsafeString()
- in.WantColon()
- if in.IsNull() {
- in.Skip()
- in.WantComma()
- continue
- }
- switch key {
- default:
- in.SkipRecursive()
- }
- in.WantComma()
- }
- in.Delim('}')
- if isTopLevel {
- in.Consumed()
- }
- }
- func easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils2(out *jwriter.Writer, in RequestPromise) {
- out.RawByte('{')
- first := true
- _ = first
- out.RawByte('}')
- }
- // MarshalJSON supports json.Marshaler interface
- func (v RequestPromise) MarshalJSON() ([]byte, error) {
- w := jwriter.Writer{}
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils2(&w, v)
- return w.Buffer.BuildBytes(), w.Error
- }
- // MarshalEasyJSON supports easyjson.Marshaler interface
- func (v RequestPromise) MarshalEasyJSON(w *jwriter.Writer) {
- easyjsonD579c6ceEncodeGitAionnectComAionnectGoCommonUtils2(w, v)
- }
- // UnmarshalJSON supports json.Unmarshaler interface
- func (v *RequestPromise) UnmarshalJSON(data []byte) error {
- r := jlexer.Lexer{Data: data}
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils2(&r, v)
- return r.Error()
- }
- // UnmarshalEasyJSON supports easyjson.Unmarshaler interface
- func (v *RequestPromise) UnmarshalEasyJSON(l *jlexer.Lexer) {
- easyjsonD579c6ceDecodeGitAionnectComAionnectGoCommonUtils2(l, v)
- }
|