package headlessexperimental
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
var (
_ *json .RawMessage
_ *jlexer .Lexer
_ *jwriter .Writer
_ easyjson .Marshaler
)
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental(in *jlexer .Lexer , out *ScreenshotParams ) {
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 "format" :
(out .Format ).UnmarshalEasyJSON (in )
case "quality" :
out .Quality = int64 (in .Int64 ())
case "optimizeForSpeed" :
out .OptimizeForSpeed = bool (in .Bool ())
default :
in .SkipRecursive ()
}
in .WantComma ()
}
in .Delim ('}' )
if isTopLevel {
in .Consumed ()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental(out *jwriter .Writer , in ScreenshotParams ) {
out .RawByte ('{' )
first := true
_ = first
if in .Format != "" {
const prefix string = ",\"format\":"
first = false
out .RawString (prefix [1 :])
(in .Format ).MarshalEasyJSON (out )
}
if in .Quality != 0 {
const prefix string = ",\"quality\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
out .Int64 (int64 (in .Quality ))
}
if in .OptimizeForSpeed {
const prefix string = ",\"optimizeForSpeed\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
out .Bool (bool (in .OptimizeForSpeed ))
}
out .RawByte ('}' )
}
func (v ScreenshotParams ) MarshalJSON () ([]byte , error ) {
w := jwriter .Writer {}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental (&w , v )
return w .Buffer .BuildBytes (), w .Error
}
func (v ScreenshotParams ) MarshalEasyJSON (w *jwriter .Writer ) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental (w , v )
}
func (v *ScreenshotParams ) UnmarshalJSON (data []byte ) error {
r := jlexer .Lexer {Data : data }
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental (&r , v )
return r .Error ()
}
func (v *ScreenshotParams ) UnmarshalEasyJSON (l *jlexer .Lexer ) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental (l , v )
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1(in *jlexer .Lexer , out *BeginFrameReturns ) {
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 "hasDamage" :
out .HasDamage = bool (in .Bool ())
case "screenshotData" :
out .ScreenshotData = string (in .String ())
default :
in .SkipRecursive ()
}
in .WantComma ()
}
in .Delim ('}' )
if isTopLevel {
in .Consumed ()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1(out *jwriter .Writer , in BeginFrameReturns ) {
out .RawByte ('{' )
first := true
_ = first
if in .HasDamage {
const prefix string = ",\"hasDamage\":"
first = false
out .RawString (prefix [1 :])
out .Bool (bool (in .HasDamage ))
}
if in .ScreenshotData != "" {
const prefix string = ",\"screenshotData\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
out .String (string (in .ScreenshotData ))
}
out .RawByte ('}' )
}
func (v BeginFrameReturns ) MarshalJSON () ([]byte , error ) {
w := jwriter .Writer {}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1 (&w , v )
return w .Buffer .BuildBytes (), w .Error
}
func (v BeginFrameReturns ) MarshalEasyJSON (w *jwriter .Writer ) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental1 (w , v )
}
func (v *BeginFrameReturns ) UnmarshalJSON (data []byte ) error {
r := jlexer .Lexer {Data : data }
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1 (&r , v )
return r .Error ()
}
func (v *BeginFrameReturns ) UnmarshalEasyJSON (l *jlexer .Lexer ) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental1 (l , v )
}
func easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2(in *jlexer .Lexer , out *BeginFrameParams ) {
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 "frameTimeTicks" :
out .FrameTimeTicks = float64 (in .Float64 ())
case "interval" :
out .Interval = float64 (in .Float64 ())
case "noDisplayUpdates" :
out .NoDisplayUpdates = bool (in .Bool ())
case "screenshot" :
if in .IsNull () {
in .Skip ()
out .Screenshot = nil
} else {
if out .Screenshot == nil {
out .Screenshot = new (ScreenshotParams )
}
(*out .Screenshot ).UnmarshalEasyJSON (in )
}
default :
in .SkipRecursive ()
}
in .WantComma ()
}
in .Delim ('}' )
if isTopLevel {
in .Consumed ()
}
}
func easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2(out *jwriter .Writer , in BeginFrameParams ) {
out .RawByte ('{' )
first := true
_ = first
if in .FrameTimeTicks != 0 {
const prefix string = ",\"frameTimeTicks\":"
first = false
out .RawString (prefix [1 :])
out .Float64 (float64 (in .FrameTimeTicks ))
}
if in .Interval != 0 {
const prefix string = ",\"interval\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
out .Float64 (float64 (in .Interval ))
}
if in .NoDisplayUpdates {
const prefix string = ",\"noDisplayUpdates\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
out .Bool (bool (in .NoDisplayUpdates ))
}
if in .Screenshot != nil {
const prefix string = ",\"screenshot\":"
if first {
first = false
out .RawString (prefix [1 :])
} else {
out .RawString (prefix )
}
(*in .Screenshot ).MarshalEasyJSON (out )
}
out .RawByte ('}' )
}
func (v BeginFrameParams ) MarshalJSON () ([]byte , error ) {
w := jwriter .Writer {}
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2 (&w , v )
return w .Buffer .BuildBytes (), w .Error
}
func (v BeginFrameParams ) MarshalEasyJSON (w *jwriter .Writer ) {
easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental2 (w , v )
}
func (v *BeginFrameParams ) UnmarshalJSON (data []byte ) error {
r := jlexer .Lexer {Data : data }
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2 (&r , v )
return r .Error ()
}
func (v *BeginFrameParams ) UnmarshalEasyJSON (l *jlexer .Lexer ) {
easyjsonC5a4559bDecodeGithubComChromedpCdprotoHeadlessexperimental2 (l , v )
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .