2018-05-25 21:54:36 +00:00
|
|
|
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
|
|
|
|
|
|
|
|
package server
|
|
|
|
|
|
|
|
import (
|
|
|
|
json "encoding/json"
|
2018-12-11 09:51:20 +00:00
|
|
|
config "github.com/khlieng/dispatch/config"
|
2018-05-25 21:54:36 +00:00
|
|
|
storage "github.com/khlieng/dispatch/storage"
|
|
|
|
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 easyjson7e607aefDecodeGithubComKhliengDispatchServer(in *jlexer.Lexer, out *indexData) {
|
|
|
|
isTopLevel := in.IsStart()
|
|
|
|
if in.IsNull() {
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
in.Skip()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
in.Delim('{')
|
|
|
|
for !in.IsDelim('}') {
|
2020-05-03 07:05:16 +00:00
|
|
|
key := in.UnsafeFieldName(false)
|
2018-05-25 21:54:36 +00:00
|
|
|
in.WantColon()
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
in.WantComma()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
switch key {
|
|
|
|
case "defaults":
|
2020-05-08 08:12:21 +00:00
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((out.Defaults).UnmarshalJSON(data))
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
case "servers":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Servers = nil
|
|
|
|
} else {
|
|
|
|
in.Delim('[')
|
|
|
|
if out.Servers == nil {
|
|
|
|
if !in.IsDelim(']') {
|
2020-05-03 07:05:16 +00:00
|
|
|
out.Servers = make([]Server, 0, 0)
|
2018-05-25 21:54:36 +00:00
|
|
|
} else {
|
|
|
|
out.Servers = []Server{}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
out.Servers = (out.Servers)[:0]
|
|
|
|
}
|
|
|
|
for !in.IsDelim(']') {
|
|
|
|
var v1 Server
|
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((v1).UnmarshalJSON(data))
|
|
|
|
}
|
|
|
|
out.Servers = append(out.Servers, v1)
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim(']')
|
|
|
|
}
|
|
|
|
case "channels":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Channels = nil
|
|
|
|
} else {
|
|
|
|
in.Delim('[')
|
|
|
|
if out.Channels == nil {
|
|
|
|
if !in.IsDelim(']') {
|
2018-06-01 02:16:38 +00:00
|
|
|
out.Channels = make([]*storage.Channel, 0, 8)
|
2018-05-25 21:54:36 +00:00
|
|
|
} else {
|
2018-06-01 02:16:38 +00:00
|
|
|
out.Channels = []*storage.Channel{}
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
out.Channels = (out.Channels)[:0]
|
|
|
|
}
|
|
|
|
for !in.IsDelim(']') {
|
2018-06-01 02:16:38 +00:00
|
|
|
var v2 *storage.Channel
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
v2 = nil
|
|
|
|
} else {
|
|
|
|
if v2 == nil {
|
|
|
|
v2 = new(storage.Channel)
|
|
|
|
}
|
2020-05-03 07:05:16 +00:00
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchStorage(in, v2)
|
2018-06-01 02:16:38 +00:00
|
|
|
}
|
2018-05-25 21:54:36 +00:00
|
|
|
out.Channels = append(out.Channels, v2)
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim(']')
|
|
|
|
}
|
2020-05-06 02:19:55 +00:00
|
|
|
case "openDMs":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.OpenDMs = nil
|
|
|
|
} else {
|
|
|
|
in.Delim('[')
|
|
|
|
if out.OpenDMs == nil {
|
|
|
|
if !in.IsDelim(']') {
|
|
|
|
out.OpenDMs = make([]storage.Tab, 0, 2)
|
|
|
|
} else {
|
|
|
|
out.OpenDMs = []storage.Tab{}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
out.OpenDMs = (out.OpenDMs)[:0]
|
|
|
|
}
|
|
|
|
for !in.IsDelim(']') {
|
|
|
|
var v3 storage.Tab
|
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchStorage1(in, &v3)
|
|
|
|
out.OpenDMs = append(out.OpenDMs, v3)
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim(']')
|
|
|
|
}
|
2018-08-10 18:24:29 +00:00
|
|
|
case "hexIP":
|
|
|
|
out.HexIP = bool(in.Bool())
|
2018-11-22 11:00:18 +00:00
|
|
|
case "version":
|
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((out.Version).UnmarshalJSON(data))
|
|
|
|
}
|
2018-10-15 06:56:17 +00:00
|
|
|
case "settings":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Settings = nil
|
|
|
|
} else {
|
|
|
|
if out.Settings == nil {
|
|
|
|
out.Settings = new(storage.ClientSettings)
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((*out.Settings).UnmarshalJSON(data))
|
|
|
|
}
|
2018-10-15 06:56:17 +00:00
|
|
|
}
|
2018-05-25 21:54:36 +00:00
|
|
|
case "users":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Users = nil
|
|
|
|
} else {
|
|
|
|
if out.Users == nil {
|
|
|
|
out.Users = new(Userlist)
|
|
|
|
}
|
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((*out.Users).UnmarshalJSON(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case "messages":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Messages = nil
|
|
|
|
} else {
|
|
|
|
if out.Messages == nil {
|
|
|
|
out.Messages = new(Messages)
|
|
|
|
}
|
|
|
|
if data := in.Raw(); in.Ok() {
|
|
|
|
in.AddError((*out.Messages).UnmarshalJSON(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
in.SkipRecursive()
|
|
|
|
}
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim('}')
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func easyjson7e607aefEncodeGithubComKhliengDispatchServer(out *jwriter.Writer, in indexData) {
|
|
|
|
out.RawByte('{')
|
|
|
|
first := true
|
|
|
|
_ = first
|
2020-05-08 08:12:21 +00:00
|
|
|
if true {
|
2018-05-25 21:54:36 +00:00
|
|
|
const prefix string = ",\"defaults\":"
|
2020-05-03 07:05:16 +00:00
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
2020-05-08 08:12:21 +00:00
|
|
|
out.Raw((in.Defaults).MarshalJSON())
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
if len(in.Servers) != 0 {
|
|
|
|
const prefix string = ",\"servers\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
out.RawByte('[')
|
2020-05-06 02:19:55 +00:00
|
|
|
for v4, v5 := range in.Servers {
|
|
|
|
if v4 > 0 {
|
2018-05-25 21:54:36 +00:00
|
|
|
out.RawByte(',')
|
|
|
|
}
|
2020-05-06 02:19:55 +00:00
|
|
|
out.Raw((v5).MarshalJSON())
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
out.RawByte(']')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(in.Channels) != 0 {
|
|
|
|
const prefix string = ",\"channels\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
out.RawByte('[')
|
2020-05-06 02:19:55 +00:00
|
|
|
for v6, v7 := range in.Channels {
|
|
|
|
if v6 > 0 {
|
2018-05-25 21:54:36 +00:00
|
|
|
out.RawByte(',')
|
|
|
|
}
|
2020-05-06 02:19:55 +00:00
|
|
|
if v7 == nil {
|
2018-06-01 02:16:38 +00:00
|
|
|
out.RawString("null")
|
|
|
|
} else {
|
2020-05-06 02:19:55 +00:00
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchStorage(out, *v7)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
out.RawByte(']')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if len(in.OpenDMs) != 0 {
|
|
|
|
const prefix string = ",\"openDMs\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
out.RawByte('[')
|
|
|
|
for v8, v9 := range in.OpenDMs {
|
|
|
|
if v8 > 0 {
|
|
|
|
out.RawByte(',')
|
2018-06-01 02:16:38 +00:00
|
|
|
}
|
2020-05-06 02:19:55 +00:00
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchStorage1(out, v9)
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
out.RawByte(']')
|
|
|
|
}
|
|
|
|
}
|
2018-08-10 18:24:29 +00:00
|
|
|
if in.HexIP {
|
|
|
|
const prefix string = ",\"hexIP\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Bool(bool(in.HexIP))
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
if true {
|
|
|
|
const prefix string = ",\"version\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Raw((in.Version).MarshalJSON())
|
|
|
|
}
|
2018-10-15 06:56:17 +00:00
|
|
|
if in.Settings != nil {
|
|
|
|
const prefix string = ",\"settings\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
out.Raw((*in.Settings).MarshalJSON())
|
2018-10-15 06:56:17 +00:00
|
|
|
}
|
2018-05-25 21:54:36 +00:00
|
|
|
if in.Users != nil {
|
|
|
|
const prefix string = ",\"users\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Raw((*in.Users).MarshalJSON())
|
|
|
|
}
|
|
|
|
if in.Messages != nil {
|
|
|
|
const prefix string = ",\"messages\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Raw((*in.Messages).MarshalJSON())
|
|
|
|
}
|
|
|
|
out.RawByte('}')
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalJSON supports json.Marshaler interface
|
|
|
|
func (v indexData) MarshalJSON() ([]byte, error) {
|
|
|
|
w := jwriter.Writer{}
|
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer(&w, v)
|
|
|
|
return w.Buffer.BuildBytes(), w.Error
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
|
|
func (v indexData) MarshalEasyJSON(w *jwriter.Writer) {
|
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer(w, v)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface
|
|
|
|
func (v *indexData) UnmarshalJSON(data []byte) error {
|
|
|
|
r := jlexer.Lexer{Data: data}
|
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer(&r, v)
|
|
|
|
return r.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
|
|
func (v *indexData) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer(l, v)
|
|
|
|
}
|
2020-05-06 02:19:55 +00:00
|
|
|
func easyjson7e607aefDecodeGithubComKhliengDispatchStorage1(in *jlexer.Lexer, out *storage.Tab) {
|
|
|
|
isTopLevel := in.IsStart()
|
|
|
|
if in.IsNull() {
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
in.Skip()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
in.Delim('{')
|
|
|
|
for !in.IsDelim('}') {
|
|
|
|
key := in.UnsafeFieldName(false)
|
|
|
|
in.WantColon()
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
in.WantComma()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
switch key {
|
|
|
|
case "server":
|
|
|
|
out.Server = string(in.String())
|
|
|
|
case "name":
|
|
|
|
out.Name = string(in.String())
|
|
|
|
default:
|
|
|
|
in.SkipRecursive()
|
|
|
|
}
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim('}')
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func easyjson7e607aefEncodeGithubComKhliengDispatchStorage1(out *jwriter.Writer, in storage.Tab) {
|
|
|
|
out.RawByte('{')
|
|
|
|
first := true
|
|
|
|
_ = first
|
|
|
|
if in.Server != "" {
|
|
|
|
const prefix string = ",\"server\":"
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
out.String(string(in.Server))
|
|
|
|
}
|
|
|
|
if in.Name != "" {
|
|
|
|
const prefix string = ",\"name\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.String(string(in.Name))
|
|
|
|
}
|
|
|
|
out.RawByte('}')
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
func easyjson7e607aefDecodeGithubComKhliengDispatchStorage(in *jlexer.Lexer, out *storage.Channel) {
|
2018-10-15 06:56:17 +00:00
|
|
|
isTopLevel := in.IsStart()
|
|
|
|
if in.IsNull() {
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
in.Skip()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
in.Delim('{')
|
|
|
|
for !in.IsDelim('}') {
|
2020-05-03 07:05:16 +00:00
|
|
|
key := in.UnsafeFieldName(false)
|
2018-10-15 06:56:17 +00:00
|
|
|
in.WantColon()
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
in.WantComma()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
switch key {
|
2018-11-22 11:00:18 +00:00
|
|
|
case "server":
|
|
|
|
out.Server = string(in.String())
|
|
|
|
case "name":
|
|
|
|
out.Name = string(in.String())
|
|
|
|
case "topic":
|
|
|
|
out.Topic = string(in.String())
|
2018-10-15 06:56:17 +00:00
|
|
|
default:
|
|
|
|
in.SkipRecursive()
|
|
|
|
}
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim('}')
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
func easyjson7e607aefEncodeGithubComKhliengDispatchStorage(out *jwriter.Writer, in storage.Channel) {
|
2018-10-15 06:56:17 +00:00
|
|
|
out.RawByte('{')
|
|
|
|
first := true
|
|
|
|
_ = first
|
2018-11-22 11:00:18 +00:00
|
|
|
if in.Server != "" {
|
|
|
|
const prefix string = ",\"server\":"
|
2020-05-03 07:05:16 +00:00
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
2018-11-22 11:00:18 +00:00
|
|
|
out.String(string(in.Server))
|
|
|
|
}
|
|
|
|
if in.Name != "" {
|
|
|
|
const prefix string = ",\"name\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.String(string(in.Name))
|
|
|
|
}
|
|
|
|
if in.Topic != "" {
|
|
|
|
const prefix string = ",\"topic\":"
|
2018-10-15 06:56:17 +00:00
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
out.String(string(in.Topic))
|
2018-10-15 06:56:17 +00:00
|
|
|
}
|
|
|
|
out.RawByte('}')
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
func easyjson7e607aefDecodeGithubComKhliengDispatchServer1(in *jlexer.Lexer, out *dispatchVersion) {
|
2018-05-25 21:54:36 +00:00
|
|
|
isTopLevel := in.IsStart()
|
|
|
|
if in.IsNull() {
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
in.Skip()
|
|
|
|
return
|
|
|
|
}
|
|
|
|
in.Delim('{')
|
|
|
|
for !in.IsDelim('}') {
|
2020-05-03 07:05:16 +00:00
|
|
|
key := in.UnsafeFieldName(false)
|
2018-05-25 21:54:36 +00:00
|
|
|
in.WantColon()
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
in.WantComma()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
switch key {
|
2018-11-22 11:00:18 +00:00
|
|
|
case "tag":
|
|
|
|
out.Tag = string(in.String())
|
|
|
|
case "commit":
|
|
|
|
out.Commit = string(in.String())
|
|
|
|
case "date":
|
|
|
|
out.Date = string(in.String())
|
2018-05-25 21:54:36 +00:00
|
|
|
default:
|
|
|
|
in.SkipRecursive()
|
|
|
|
}
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim('}')
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
func easyjson7e607aefEncodeGithubComKhliengDispatchServer1(out *jwriter.Writer, in dispatchVersion) {
|
2018-05-25 21:54:36 +00:00
|
|
|
out.RawByte('{')
|
|
|
|
first := true
|
|
|
|
_ = first
|
2018-11-22 11:00:18 +00:00
|
|
|
if in.Tag != "" {
|
|
|
|
const prefix string = ",\"tag\":"
|
2020-05-03 07:05:16 +00:00
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
2018-11-22 11:00:18 +00:00
|
|
|
out.String(string(in.Tag))
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
if in.Commit != "" {
|
|
|
|
const prefix string = ",\"commit\":"
|
2018-05-25 21:54:36 +00:00
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
out.String(string(in.Commit))
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
if in.Date != "" {
|
|
|
|
const prefix string = ",\"date\":"
|
2018-05-25 21:54:36 +00:00
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
out.String(string(in.Date))
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
out.RawByte('}')
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
|
|
|
|
// MarshalJSON supports json.Marshaler interface
|
|
|
|
func (v dispatchVersion) MarshalJSON() ([]byte, error) {
|
|
|
|
w := jwriter.Writer{}
|
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer1(&w, v)
|
|
|
|
return w.Buffer.BuildBytes(), w.Error
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
|
|
func (v dispatchVersion) MarshalEasyJSON(w *jwriter.Writer) {
|
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer1(w, v)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface
|
|
|
|
func (v *dispatchVersion) UnmarshalJSON(data []byte) error {
|
|
|
|
r := jlexer.Lexer{Data: data}
|
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer1(&r, v)
|
|
|
|
return r.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
|
|
func (v *dispatchVersion) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer1(l, v)
|
|
|
|
}
|
|
|
|
func easyjson7e607aefDecodeGithubComKhliengDispatchServer2(in *jlexer.Lexer, out *connectDefaults) {
|
2018-05-25 21:54:36 +00:00
|
|
|
isTopLevel := in.IsStart()
|
|
|
|
if in.IsNull() {
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
in.Skip()
|
|
|
|
return
|
|
|
|
}
|
2020-05-08 08:12:21 +00:00
|
|
|
out.Defaults = new(config.Defaults)
|
2018-05-25 21:54:36 +00:00
|
|
|
in.Delim('{')
|
|
|
|
for !in.IsDelim('}') {
|
2020-05-03 07:05:16 +00:00
|
|
|
key := in.UnsafeFieldName(false)
|
2018-05-25 21:54:36 +00:00
|
|
|
in.WantColon()
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
in.WantComma()
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
switch key {
|
2020-05-08 08:12:21 +00:00
|
|
|
case "password":
|
|
|
|
out.Password = bool(in.Bool())
|
2018-05-25 21:54:36 +00:00
|
|
|
case "name":
|
|
|
|
out.Name = string(in.String())
|
|
|
|
case "host":
|
|
|
|
out.Host = string(in.String())
|
|
|
|
case "port":
|
|
|
|
out.Port = int(in.Int())
|
|
|
|
case "channels":
|
|
|
|
if in.IsNull() {
|
|
|
|
in.Skip()
|
|
|
|
out.Channels = nil
|
|
|
|
} else {
|
|
|
|
in.Delim('[')
|
|
|
|
if out.Channels == nil {
|
|
|
|
if !in.IsDelim(']') {
|
|
|
|
out.Channels = make([]string, 0, 4)
|
|
|
|
} else {
|
|
|
|
out.Channels = []string{}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
out.Channels = (out.Channels)[:0]
|
|
|
|
}
|
|
|
|
for !in.IsDelim(']') {
|
2020-05-08 08:12:21 +00:00
|
|
|
var v10 string
|
|
|
|
v10 = string(in.String())
|
|
|
|
out.Channels = append(out.Channels, v10)
|
2018-05-25 21:54:36 +00:00
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim(']')
|
|
|
|
}
|
|
|
|
case "ssl":
|
|
|
|
out.SSL = bool(in.Bool())
|
2018-05-31 21:24:59 +00:00
|
|
|
case "readOnly":
|
2018-05-25 21:54:36 +00:00
|
|
|
out.ReadOnly = bool(in.Bool())
|
|
|
|
case "showDetails":
|
|
|
|
out.ShowDetails = bool(in.Bool())
|
|
|
|
default:
|
|
|
|
in.SkipRecursive()
|
|
|
|
}
|
|
|
|
in.WantComma()
|
|
|
|
}
|
|
|
|
in.Delim('}')
|
|
|
|
if isTopLevel {
|
|
|
|
in.Consumed()
|
|
|
|
}
|
|
|
|
}
|
2018-11-22 11:00:18 +00:00
|
|
|
func easyjson7e607aefEncodeGithubComKhliengDispatchServer2(out *jwriter.Writer, in connectDefaults) {
|
2018-05-25 21:54:36 +00:00
|
|
|
out.RawByte('{')
|
|
|
|
first := true
|
|
|
|
_ = first
|
2020-05-08 08:12:21 +00:00
|
|
|
if in.Password {
|
|
|
|
const prefix string = ",\"password\":"
|
2020-05-03 07:05:16 +00:00
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
2020-05-08 08:12:21 +00:00
|
|
|
out.Bool(bool(in.Password))
|
|
|
|
}
|
|
|
|
if in.Name != "" {
|
|
|
|
const prefix string = ",\"name\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
2018-05-25 21:54:36 +00:00
|
|
|
out.String(string(in.Name))
|
|
|
|
}
|
|
|
|
if in.Host != "" {
|
|
|
|
const prefix string = ",\"host\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.String(string(in.Host))
|
|
|
|
}
|
|
|
|
if in.Port != 0 {
|
|
|
|
const prefix string = ",\"port\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Int(int(in.Port))
|
|
|
|
}
|
|
|
|
if len(in.Channels) != 0 {
|
|
|
|
const prefix string = ",\"channels\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
out.RawByte('[')
|
2020-05-08 08:12:21 +00:00
|
|
|
for v11, v12 := range in.Channels {
|
|
|
|
if v11 > 0 {
|
2018-05-25 21:54:36 +00:00
|
|
|
out.RawByte(',')
|
|
|
|
}
|
2020-05-08 08:12:21 +00:00
|
|
|
out.String(string(v12))
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
out.RawByte(']')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if in.SSL {
|
|
|
|
const prefix string = ",\"ssl\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Bool(bool(in.SSL))
|
|
|
|
}
|
|
|
|
if in.ReadOnly {
|
2018-05-31 21:24:59 +00:00
|
|
|
const prefix string = ",\"readOnly\":"
|
2018-05-25 21:54:36 +00:00
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Bool(bool(in.ReadOnly))
|
|
|
|
}
|
|
|
|
if in.ShowDetails {
|
|
|
|
const prefix string = ",\"showDetails\":"
|
|
|
|
if first {
|
|
|
|
first = false
|
|
|
|
out.RawString(prefix[1:])
|
|
|
|
} else {
|
|
|
|
out.RawString(prefix)
|
|
|
|
}
|
|
|
|
out.Bool(bool(in.ShowDetails))
|
|
|
|
}
|
|
|
|
out.RawByte('}')
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalJSON supports json.Marshaler interface
|
|
|
|
func (v connectDefaults) MarshalJSON() ([]byte, error) {
|
|
|
|
w := jwriter.Writer{}
|
2018-11-22 11:00:18 +00:00
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer2(&w, v)
|
2018-05-25 21:54:36 +00:00
|
|
|
return w.Buffer.BuildBytes(), w.Error
|
|
|
|
}
|
|
|
|
|
|
|
|
// MarshalEasyJSON supports easyjson.Marshaler interface
|
|
|
|
func (v connectDefaults) MarshalEasyJSON(w *jwriter.Writer) {
|
2018-11-22 11:00:18 +00:00
|
|
|
easyjson7e607aefEncodeGithubComKhliengDispatchServer2(w, v)
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON supports json.Unmarshaler interface
|
|
|
|
func (v *connectDefaults) UnmarshalJSON(data []byte) error {
|
|
|
|
r := jlexer.Lexer{Data: data}
|
2018-11-22 11:00:18 +00:00
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer2(&r, v)
|
2018-05-25 21:54:36 +00:00
|
|
|
return r.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
|
|
|
|
func (v *connectDefaults) UnmarshalEasyJSON(l *jlexer.Lexer) {
|
2018-11-22 11:00:18 +00:00
|
|
|
easyjson7e607aefDecodeGithubComKhliengDispatchServer2(l, v)
|
2018-05-25 21:54:36 +00:00
|
|
|
}
|