chromedp/cdp/performance/easyjson.go

520 lines
12 KiB
Go
Raw Normal View History

2017-08-11 02:28:38 +00:00
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package performance
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 easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance(in *jlexer.Lexer, out *Metric) {
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 "name":
out.Name = string(in.String())
case "value":
out.Value = float64(in.Float64())
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance(out *jwriter.Writer, in Metric) {
out.RawByte('{')
first := true
_ = first
2017-11-22 05:01:27 +00:00
{
const prefix string = ",\"name\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.Name))
2017-08-11 02:28:38 +00:00
}
2017-11-22 05:01:27 +00:00
{
const prefix string = ",\"value\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.Float64(float64(in.Value))
2017-08-11 02:28:38 +00:00
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v Metric) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v Metric) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *Metric) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *Metric) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance1(in *jlexer.Lexer, out *GetMetricsReturns) {
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 "metrics":
if in.IsNull() {
in.Skip()
out.Metrics = nil
} else {
in.Delim('[')
if out.Metrics == nil {
if !in.IsDelim(']') {
out.Metrics = make([]*Metric, 0, 8)
} else {
out.Metrics = []*Metric{}
}
} else {
out.Metrics = (out.Metrics)[:0]
}
for !in.IsDelim(']') {
var v1 *Metric
if in.IsNull() {
in.Skip()
v1 = nil
} else {
if v1 == nil {
v1 = new(Metric)
}
(*v1).UnmarshalEasyJSON(in)
}
out.Metrics = append(out.Metrics, v1)
in.WantComma()
}
in.Delim(']')
}
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance1(out *jwriter.Writer, in GetMetricsReturns) {
out.RawByte('{')
first := true
_ = first
if len(in.Metrics) != 0 {
2017-11-22 05:01:27 +00:00
const prefix string = ",\"metrics\":"
if first {
first = false
out.RawString(prefix[1:])
2017-08-11 02:28:38 +00:00
} else {
2017-11-22 05:01:27 +00:00
out.RawString(prefix)
}
{
2017-08-11 02:28:38 +00:00
out.RawByte('[')
for v2, v3 := range in.Metrics {
if v2 > 0 {
out.RawByte(',')
}
if v3 == nil {
out.RawString("null")
} else {
(*v3).MarshalEasyJSON(out)
}
}
out.RawByte(']')
}
}
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetMetricsReturns) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance1(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetMetricsReturns) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance1(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetMetricsReturns) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance1(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetMetricsReturns) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance1(l, v)
}
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance2(in *jlexer.Lexer, out *GetMetricsParams) {
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 easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance2(out *jwriter.Writer, in GetMetricsParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v GetMetricsParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance2(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v GetMetricsParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance2(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *GetMetricsParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance2(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *GetMetricsParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance2(l, v)
}
2017-08-20 23:56:21 +00:00
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance3(in *jlexer.Lexer, out *EventMetrics) {
2017-08-11 02:28:38 +00:00
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 {
2017-08-20 23:56:21 +00:00
case "metrics":
if in.IsNull() {
in.Skip()
out.Metrics = nil
} else {
in.Delim('[')
if out.Metrics == nil {
if !in.IsDelim(']') {
out.Metrics = make([]*Metric, 0, 8)
} else {
out.Metrics = []*Metric{}
}
} else {
out.Metrics = (out.Metrics)[:0]
}
for !in.IsDelim(']') {
var v4 *Metric
if in.IsNull() {
in.Skip()
v4 = nil
} else {
if v4 == nil {
v4 = new(Metric)
}
(*v4).UnmarshalEasyJSON(in)
}
out.Metrics = append(out.Metrics, v4)
in.WantComma()
}
in.Delim(']')
}
case "title":
out.Title = string(in.String())
2017-08-11 02:28:38 +00:00
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
if isTopLevel {
in.Consumed()
}
}
2017-08-20 23:56:21 +00:00
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance3(out *jwriter.Writer, in EventMetrics) {
2017-08-11 02:28:38 +00:00
out.RawByte('{')
first := true
_ = first
2017-11-22 05:01:27 +00:00
{
const prefix string = ",\"metrics\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
if in.Metrics == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 {
out.RawString("null")
} else {
out.RawByte('[')
for v5, v6 := range in.Metrics {
if v5 > 0 {
out.RawByte(',')
}
if v6 == nil {
out.RawString("null")
} else {
(*v6).MarshalEasyJSON(out)
}
2017-08-20 23:56:21 +00:00
}
2017-11-22 05:01:27 +00:00
out.RawByte(']')
2017-08-20 23:56:21 +00:00
}
}
2017-11-22 05:01:27 +00:00
{
const prefix string = ",\"title\":"
if first {
first = false
out.RawString(prefix[1:])
} else {
out.RawString(prefix)
}
out.String(string(in.Title))
2017-08-20 23:56:21 +00:00
}
2017-08-11 02:28:38 +00:00
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
2017-08-20 23:56:21 +00:00
func (v EventMetrics) MarshalJSON() ([]byte, error) {
2017-08-11 02:28:38 +00:00
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance3(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
2017-08-20 23:56:21 +00:00
func (v EventMetrics) MarshalEasyJSON(w *jwriter.Writer) {
2017-08-11 02:28:38 +00:00
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance3(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
2017-08-20 23:56:21 +00:00
func (v *EventMetrics) UnmarshalJSON(data []byte) error {
2017-08-11 02:28:38 +00:00
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance3(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
2017-08-20 23:56:21 +00:00
func (v *EventMetrics) UnmarshalEasyJSON(l *jlexer.Lexer) {
2017-08-11 02:28:38 +00:00
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance3(l, v)
}
2017-08-20 23:56:21 +00:00
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance4(in *jlexer.Lexer, out *EnableParams) {
2017-08-11 02:28:38 +00:00
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()
}
}
2017-08-20 23:56:21 +00:00
func easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance4(out *jwriter.Writer, in EnableParams) {
2017-08-11 02:28:38 +00:00
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
2017-08-20 23:56:21 +00:00
func (v EnableParams) MarshalJSON() ([]byte, error) {
2017-08-11 02:28:38 +00:00
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance4(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
2017-08-20 23:56:21 +00:00
func (v EnableParams) MarshalEasyJSON(w *jwriter.Writer) {
2017-08-11 02:28:38 +00:00
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance4(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
2017-08-20 23:56:21 +00:00
func (v *EnableParams) UnmarshalJSON(data []byte) error {
2017-08-11 02:28:38 +00:00
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance4(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
2017-08-20 23:56:21 +00:00
func (v *EnableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
2017-08-11 02:28:38 +00:00
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance4(l, v)
}
2017-08-20 23:56:21 +00:00
func easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance5(in *jlexer.Lexer, out *DisableParams) {
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 easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance5(out *jwriter.Writer, in DisableParams) {
out.RawByte('{')
first := true
_ = first
out.RawByte('}')
}
// MarshalJSON supports json.Marshaler interface
func (v DisableParams) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance5(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
// MarshalEasyJSON supports easyjson.Marshaler interface
func (v DisableParams) MarshalEasyJSON(w *jwriter.Writer) {
easyjsonC5a4559bEncodeGithubComKnqChromedpCdpPerformance5(w, v)
}
// UnmarshalJSON supports json.Unmarshaler interface
func (v *DisableParams) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance5(&r, v)
return r.Error()
}
// UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (v *DisableParams) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjsonC5a4559bDecodeGithubComKnqChromedpCdpPerformance5(l, v)
}