mirror of https://github.com/IoTcat/auxpi.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
411 lines
8.9 KiB
411 lines
8.9 KiB
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. |
|
|
|
package bootstrap |
|
|
|
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 easyjsonDc4bdceDecodeAuxpiBootstrap(in *jlexer.Lexer, out *UploadConfig) { |
|
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 "local_store": |
|
out.LocalStore = bool(in.Bool()) |
|
case "open_sina_pic_store": |
|
out.OpenSinaPicStore = bool(in.Bool()) |
|
case "sina_account": |
|
(out.SinaAccount).UnmarshalEasyJSON(in) |
|
default: |
|
in.SkipRecursive() |
|
} |
|
in.WantComma() |
|
} |
|
in.Delim('}') |
|
if isTopLevel { |
|
in.Consumed() |
|
} |
|
} |
|
func easyjsonDc4bdceEncodeAuxpiBootstrap(out *jwriter.Writer, in UploadConfig) { |
|
out.RawByte('{') |
|
first := true |
|
_ = first |
|
{ |
|
const prefix string = ",\"local_store\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.Bool(bool(in.LocalStore)) |
|
} |
|
{ |
|
const prefix string = ",\"open_sina_pic_store\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.Bool(bool(in.OpenSinaPicStore)) |
|
} |
|
{ |
|
const prefix string = ",\"sina_account\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
(in.SinaAccount).MarshalEasyJSON(out) |
|
} |
|
out.RawByte('}') |
|
} |
|
|
|
// MarshalJSON supports json.Marshaler interface |
|
func (v UploadConfig) MarshalJSON() ([]byte, error) { |
|
w := jwriter.Writer{} |
|
easyjsonDc4bdceEncodeAuxpiBootstrap(&w, v) |
|
return w.Buffer.BuildBytes(), w.Error |
|
} |
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface |
|
func (v UploadConfig) MarshalEasyJSON(w *jwriter.Writer) { |
|
easyjsonDc4bdceEncodeAuxpiBootstrap(w, v) |
|
} |
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface |
|
func (v *UploadConfig) UnmarshalJSON(data []byte) error { |
|
r := jlexer.Lexer{Data: data} |
|
easyjsonDc4bdceDecodeAuxpiBootstrap(&r, v) |
|
return r.Error() |
|
} |
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface |
|
func (v *UploadConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { |
|
easyjsonDc4bdceDecodeAuxpiBootstrap(l, v) |
|
} |
|
func easyjsonDc4bdceDecodeAuxpiBootstrap1(in *jlexer.Lexer, out *SiteConfig) { |
|
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 "site_name": |
|
out.SiteName = string(in.String()) |
|
case "site_footer": |
|
out.SiteFooter = string(in.String()) |
|
case "site_url": |
|
out.SiteUrl = string(in.String()) |
|
case "site_upload_max_number": |
|
out.SiteUploadMaxNumber = int(in.Int()) |
|
case "site_up_load_max_size": |
|
out.SiteUpLoadMaxSize = int(in.Int()) |
|
case "site_upload_way": |
|
(out.SiteUploadWay).UnmarshalEasyJSON(in) |
|
default: |
|
in.SkipRecursive() |
|
} |
|
in.WantComma() |
|
} |
|
in.Delim('}') |
|
if isTopLevel { |
|
in.Consumed() |
|
} |
|
} |
|
func easyjsonDc4bdceEncodeAuxpiBootstrap1(out *jwriter.Writer, in SiteConfig) { |
|
out.RawByte('{') |
|
first := true |
|
_ = first |
|
{ |
|
const prefix string = ",\"site_name\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.SiteName)) |
|
} |
|
{ |
|
const prefix string = ",\"site_footer\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.SiteFooter)) |
|
} |
|
{ |
|
const prefix string = ",\"site_url\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.SiteUrl)) |
|
} |
|
{ |
|
const prefix string = ",\"site_upload_max_number\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.Int(int(in.SiteUploadMaxNumber)) |
|
} |
|
{ |
|
const prefix string = ",\"site_up_load_max_size\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.Int(int(in.SiteUpLoadMaxSize)) |
|
} |
|
{ |
|
const prefix string = ",\"site_upload_way\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
(in.SiteUploadWay).MarshalEasyJSON(out) |
|
} |
|
out.RawByte('}') |
|
} |
|
|
|
// MarshalJSON supports json.Marshaler interface |
|
func (v SiteConfig) MarshalJSON() ([]byte, error) { |
|
w := jwriter.Writer{} |
|
easyjsonDc4bdceEncodeAuxpiBootstrap1(&w, v) |
|
return w.Buffer.BuildBytes(), w.Error |
|
} |
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface |
|
func (v SiteConfig) MarshalEasyJSON(w *jwriter.Writer) { |
|
easyjsonDc4bdceEncodeAuxpiBootstrap1(w, v) |
|
} |
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface |
|
func (v *SiteConfig) UnmarshalJSON(data []byte) error { |
|
r := jlexer.Lexer{Data: data} |
|
easyjsonDc4bdceDecodeAuxpiBootstrap1(&r, v) |
|
return r.Error() |
|
} |
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface |
|
func (v *SiteConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { |
|
easyjsonDc4bdceDecodeAuxpiBootstrap1(l, v) |
|
} |
|
func easyjsonDc4bdceDecodeAuxpiBootstrap2(in *jlexer.Lexer, out *JsonStruct) { |
|
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 easyjsonDc4bdceEncodeAuxpiBootstrap2(out *jwriter.Writer, in JsonStruct) { |
|
out.RawByte('{') |
|
first := true |
|
_ = first |
|
out.RawByte('}') |
|
} |
|
|
|
// MarshalJSON supports json.Marshaler interface |
|
func (v JsonStruct) MarshalJSON() ([]byte, error) { |
|
w := jwriter.Writer{} |
|
easyjsonDc4bdceEncodeAuxpiBootstrap2(&w, v) |
|
return w.Buffer.BuildBytes(), w.Error |
|
} |
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface |
|
func (v JsonStruct) MarshalEasyJSON(w *jwriter.Writer) { |
|
easyjsonDc4bdceEncodeAuxpiBootstrap2(w, v) |
|
} |
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface |
|
func (v *JsonStruct) UnmarshalJSON(data []byte) error { |
|
r := jlexer.Lexer{Data: data} |
|
easyjsonDc4bdceDecodeAuxpiBootstrap2(&r, v) |
|
return r.Error() |
|
} |
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface |
|
func (v *JsonStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { |
|
easyjsonDc4bdceDecodeAuxpiBootstrap2(l, v) |
|
} |
|
func easyjsonDc4bdceDecodeAuxpiBootstrap3(in *jlexer.Lexer, out *Account) { |
|
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 "user_name": |
|
out.UserName = string(in.String()) |
|
case "pass_word": |
|
out.PassWord = string(in.String()) |
|
case "reset_sina_cookie_time": |
|
out.ResetSinaCookieTime = int(in.Int()) |
|
case "defult_pic_size": |
|
out.DefultPicSize = string(in.String()) |
|
default: |
|
in.SkipRecursive() |
|
} |
|
in.WantComma() |
|
} |
|
in.Delim('}') |
|
if isTopLevel { |
|
in.Consumed() |
|
} |
|
} |
|
func easyjsonDc4bdceEncodeAuxpiBootstrap3(out *jwriter.Writer, in Account) { |
|
out.RawByte('{') |
|
first := true |
|
_ = first |
|
{ |
|
const prefix string = ",\"user_name\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.UserName)) |
|
} |
|
{ |
|
const prefix string = ",\"pass_word\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.PassWord)) |
|
} |
|
{ |
|
const prefix string = ",\"reset_sina_cookie_time\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.Int(int(in.ResetSinaCookieTime)) |
|
} |
|
{ |
|
const prefix string = ",\"defult_pic_size\":" |
|
if first { |
|
first = false |
|
out.RawString(prefix[1:]) |
|
} else { |
|
out.RawString(prefix) |
|
} |
|
out.String(string(in.DefultPicSize)) |
|
} |
|
out.RawByte('}') |
|
} |
|
|
|
// MarshalJSON supports json.Marshaler interface |
|
func (v Account) MarshalJSON() ([]byte, error) { |
|
w := jwriter.Writer{} |
|
easyjsonDc4bdceEncodeAuxpiBootstrap3(&w, v) |
|
return w.Buffer.BuildBytes(), w.Error |
|
} |
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface |
|
func (v Account) MarshalEasyJSON(w *jwriter.Writer) { |
|
easyjsonDc4bdceEncodeAuxpiBootstrap3(w, v) |
|
} |
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface |
|
func (v *Account) UnmarshalJSON(data []byte) error { |
|
r := jlexer.Lexer{Data: data} |
|
easyjsonDc4bdceDecodeAuxpiBootstrap3(&r, v) |
|
return r.Error() |
|
} |
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface |
|
func (v *Account) UnmarshalEasyJSON(l *jlexer.Lexer) { |
|
easyjsonDc4bdceDecodeAuxpiBootstrap3(l, v) |
|
}
|
|
|