mirror of
https://github.com/jimeh/rbheap.git
synced 2026-02-19 04:46:40 +00:00
103 lines
2.2 KiB
Go
103 lines
2.2 KiB
Go
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
|
|
|
|
package main
|
|
|
|
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 easyjsonE44bcf2dDecodeGithubComJimehRbheapleak(in *jlexer.Lexer, out *Object) {
|
|
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 "address":
|
|
out.Address = string(in.String())
|
|
case "type":
|
|
out.Type = string(in.String())
|
|
default:
|
|
in.SkipRecursive()
|
|
}
|
|
in.WantComma()
|
|
}
|
|
in.Delim('}')
|
|
if isTopLevel {
|
|
in.Consumed()
|
|
}
|
|
}
|
|
func easyjsonE44bcf2dEncodeGithubComJimehRbheapleak(out *jwriter.Writer, in Object) {
|
|
out.RawByte('{')
|
|
first := true
|
|
_ = first
|
|
{
|
|
const prefix string = ",\"address\":"
|
|
if first {
|
|
first = false
|
|
out.RawString(prefix[1:])
|
|
} else {
|
|
out.RawString(prefix)
|
|
}
|
|
out.String(string(in.Address))
|
|
}
|
|
{
|
|
const prefix string = ",\"type\":"
|
|
if first {
|
|
first = false
|
|
out.RawString(prefix[1:])
|
|
} else {
|
|
out.RawString(prefix)
|
|
}
|
|
out.String(string(in.Type))
|
|
}
|
|
out.RawByte('}')
|
|
}
|
|
|
|
// MarshalJSON supports json.Marshaler interface
|
|
func (v Object) MarshalJSON() ([]byte, error) {
|
|
w := jwriter.Writer{}
|
|
easyjsonE44bcf2dEncodeGithubComJimehRbheapleak(&w, v)
|
|
return w.Buffer.BuildBytes(), w.Error
|
|
}
|
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
func (v Object) MarshalEasyJSON(w *jwriter.Writer) {
|
|
easyjsonE44bcf2dEncodeGithubComJimehRbheapleak(w, v)
|
|
}
|
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface
|
|
func (v *Object) UnmarshalJSON(data []byte) error {
|
|
r := jlexer.Lexer{Data: data}
|
|
easyjsonE44bcf2dDecodeGithubComJimehRbheapleak(&r, v)
|
|
return r.Error()
|
|
}
|
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
func (v *Object) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
easyjsonE44bcf2dDecodeGithubComJimehRbheapleak(l, v)
|
|
}
|