nextcloud-spreed-signaling/etcd/api_easyjson.go
2026-03-09 09:58:57 +01:00

308 lines
7.1 KiB
Go

// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package etcd
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
api "github.com/strukturag/nextcloud-spreed-signaling/v2/api"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jlexer.Lexer
_ *jwriter.Writer
_ easyjson.Marshaler
)
func easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(in *jlexer.Lexer, out *BackendServerInfoEtcd) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
switch key {
case "endpoints":
if in.IsNull() {
in.Skip()
out.Endpoints = nil
} else {
in.Delim('[')
if out.Endpoints == nil {
if !in.IsDelim(']') {
out.Endpoints = make([]string, 0, 4)
} else {
out.Endpoints = []string{}
}
} else {
out.Endpoints = (out.Endpoints)[:0]
}
for !in.IsDelim(']') {
var v1 string
if in.IsNull() {
in.Skip()
} else {
v1 = string(in.String())
}
out.Endpoints = append(out.Endpoints, v1)
in.WantComma()
}
in.Delim(']')
}
case "active":
if in.IsNull() {
in.Skip()
} else {
out.Active = string(in.String())
}
case "connected":
if in.IsNull() {
in.Skip()
out.Connected = nil
} else {
if out.Connected == nil {
out.Connected = new(bool)
}
if in.IsNull() {
in.Skip()
} else {
*out.Connected = bool(in.Bool())
}
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(out *jwriter.Writer, in BackendServerInfoEtcd) {
out.RawByte('{')
first := true
_ = first
{
const prefix string = ",\"endpoints\":"
out.RawString(prefix[1:])
if in.Endpoints == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v2, v3 := range in.Endpoints {
if v2 > 0 {
out.RawByte(',')
}
out.String(string(v3))
}
out.RawByte(']')
}
}
if in.Active != "" {
const prefix string = ",\"active\":"
out.RawString(prefix)
out.String(string(in.Active))
}
if in.Connected != nil {
const prefix string = ",\"connected\":"
out.RawString(prefix)
out.Bool(bool(*in.Connected))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v BackendServerInfoEtcd) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v BackendServerInfoEtcd) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *BackendServerInfoEtcd) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *BackendServerInfoEtcd) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd(l, v)
}
func easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(in *jlexer.Lexer, out *BackendInformationEtcd) {
isTopLevel := in.IsStart()
if in.IsNull() {
if isTopLevel {
in.Consumed()
}
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeFieldName(false)
in.WantColon()
switch key {
case "url":
if in.IsNull() {
in.Skip()
} else {
out.Url = string(in.String())
}
case "urls":
if in.IsNull() {
in.Skip()
out.Urls = nil
} else {
in.Delim('[')
if out.Urls == nil {
if !in.IsDelim(']') {
out.Urls = make([]string, 0, 4)
} else {
out.Urls = []string{}
}
} else {
out.Urls = (out.Urls)[:0]
}
for !in.IsDelim(']') {
var v4 string
if in.IsNull() {
in.Skip()
} else {
v4 = string(in.String())
}
out.Urls = append(out.Urls, v4)
in.WantComma()
}
in.Delim(']')
}
case "secret":
if in.IsNull() {
in.Skip()
} else {
out.Secret = string(in.String())
}
case "maxstreambitrate":
if in.IsNull() {
in.Skip()
} else {
out.MaxStreamBitrate = api.Bandwidth(in.Uint64())
}
case "maxscreenbitrate":
if in.IsNull() {
in.Skip()
} else {
out.MaxScreenBitrate = api.Bandwidth(in.Uint64())
}
case "sessionlimit":
if in.IsNull() {
in.Skip()
} else {
out.SessionLimit = uint64(in.Uint64())
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(out *jwriter.Writer, in BackendInformationEtcd) {
out.RawByte('{')
first := true
_ = first
if in.Url != "" {
const prefix string = ",\"url\":"
first = false
out.RawString(prefix[1:])
out.String(string(in.Url))
}
if len(in.Urls) != 0 {
const prefix string = ",\"urls\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
{
out.RawByte('[')
for v5, v6 := range in.Urls {
if v5 > 0 {
out.RawByte(',')
}
out.String(string(v6))
}
out.RawByte(']')
}
}
{
const prefix string = ",\"secret\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.Secret))
}
if in.MaxStreamBitrate != 0 {
const prefix string = ",\"maxstreambitrate\":"
out.RawString(prefix)
out.Uint64(uint64(in.MaxStreamBitrate))
}
if in.MaxScreenBitrate != 0 {
const prefix string = ",\"maxscreenbitrate\":"
out.RawString(prefix)
out.Uint64(uint64(in.MaxScreenBitrate))
}
if in.SessionLimit != 0 {
const prefix string = ",\"sessionlimit\":"
out.RawString(prefix)
out.Uint64(uint64(in.SessionLimit))
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v BackendInformationEtcd) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v BackendInformationEtcd) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC1cedd36EncodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *BackendInformationEtcd) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *BackendInformationEtcd) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC1cedd36DecodeGithubComStrukturagNextcloudSpreedSignalingV2Etcd1(l, v)
}