Files
ozu.io/web/responses_easyjson.go

133 lines
3.3 KiB
Go

// AUTOGENERATED FILE: easyjson marshaller/unmarshallers.
package web
import (
json "encoding/json"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
var _ = json.RawMessage{} // suppress unused package warning
func easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ErrorResponse(in *jlexer.Lexer, out *ErrorResponse) {
if in.IsNull() {
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "error":
out.Error = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
}
func easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ErrorResponse(out *jwriter.Writer, in ErrorResponse) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"error\":")
out.String(string(in.Error))
out.RawByte('}')
}
func (v ErrorResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ErrorResponse(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
func (v ErrorResponse) MarshalEasyJSON(w *jwriter.Writer) {
easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ErrorResponse(w, v)
}
func (v *ErrorResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ErrorResponse(&r, v)
return r.Error()
}
func (v *ErrorResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ErrorResponse(l, v)
}
func easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ShortenedResponse(in *jlexer.Lexer, out *ShortenedResponse) {
if in.IsNull() {
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "uid":
out.UID = string(in.String())
case "url":
out.URL = string(in.String())
case "target":
out.Target = string(in.String())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
}
func easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ShortenedResponse(out *jwriter.Writer, in ShortenedResponse) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"uid\":")
out.String(string(in.UID))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"url\":")
out.String(string(in.URL))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"target\":")
out.String(string(in.Target))
out.RawByte('}')
}
func (v ShortenedResponse) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ShortenedResponse(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
func (v ShortenedResponse) MarshalEasyJSON(w *jwriter.Writer) {
easyjson_559270ae_encode_github_com_jimeh_ozu_io_web_ShortenedResponse(w, v)
}
func (v *ShortenedResponse) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ShortenedResponse(&r, v)
return r.Error()
}
func (v *ShortenedResponse) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjson_559270ae_decode_github_com_jimeh_ozu_io_web_ShortenedResponse(l, v)
}