id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
19,200
mafredri/cdp
protocol/input/command.go
NewSynthesizePinchGestureArgs
func NewSynthesizePinchGestureArgs(x float64, y float64, scaleFactor float64) *SynthesizePinchGestureArgs { args := new(SynthesizePinchGestureArgs) args.X = x args.Y = y args.ScaleFactor = scaleFactor return args }
go
func NewSynthesizePinchGestureArgs(x float64, y float64, scaleFactor float64) *SynthesizePinchGestureArgs { args := new(SynthesizePinchGestureArgs) args.X = x args.Y = y args.ScaleFactor = scaleFactor return args }
[ "func", "NewSynthesizePinchGestureArgs", "(", "x", "float64", ",", "y", "float64", ",", "scaleFactor", "float64", ")", "*", "SynthesizePinchGestureArgs", "{", "args", ":=", "new", "(", "SynthesizePinchGestureArgs", ")", "\n", "args", ".", "X", "=", "x", "\n", "args", ".", "Y", "=", "y", "\n", "args", ".", "ScaleFactor", "=", "scaleFactor", "\n", "return", "args", "\n", "}" ]
// NewSynthesizePinchGestureArgs initializes SynthesizePinchGestureArgs with the required arguments.
[ "NewSynthesizePinchGestureArgs", "initializes", "SynthesizePinchGestureArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/input/command.go#L360-L366
19,201
mafredri/cdp
protocol/input/command.go
NewSynthesizeScrollGestureArgs
func NewSynthesizeScrollGestureArgs(x float64, y float64) *SynthesizeScrollGestureArgs { args := new(SynthesizeScrollGestureArgs) args.X = x args.Y = y return args }
go
func NewSynthesizeScrollGestureArgs(x float64, y float64) *SynthesizeScrollGestureArgs { args := new(SynthesizeScrollGestureArgs) args.X = x args.Y = y return args }
[ "func", "NewSynthesizeScrollGestureArgs", "(", "x", "float64", ",", "y", "float64", ")", "*", "SynthesizeScrollGestureArgs", "{", "args", ":=", "new", "(", "SynthesizeScrollGestureArgs", ")", "\n", "args", ".", "X", "=", "x", "\n", "args", ".", "Y", "=", "y", "\n", "return", "args", "\n", "}" ]
// NewSynthesizeScrollGestureArgs initializes SynthesizeScrollGestureArgs with the required arguments.
[ "NewSynthesizeScrollGestureArgs", "initializes", "SynthesizeScrollGestureArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/input/command.go#L400-L405
19,202
mafredri/cdp
protocol/input/command.go
SetXOverscroll
func (a *SynthesizeScrollGestureArgs) SetXOverscroll(xOverscroll float64) *SynthesizeScrollGestureArgs { a.XOverscroll = &xOverscroll return a }
go
func (a *SynthesizeScrollGestureArgs) SetXOverscroll(xOverscroll float64) *SynthesizeScrollGestureArgs { a.XOverscroll = &xOverscroll return a }
[ "func", "(", "a", "*", "SynthesizeScrollGestureArgs", ")", "SetXOverscroll", "(", "xOverscroll", "float64", ")", "*", "SynthesizeScrollGestureArgs", "{", "a", ".", "XOverscroll", "=", "&", "xOverscroll", "\n", "return", "a", "\n", "}" ]
// SetXOverscroll sets the XOverscroll optional argument. The number // of additional pixels to scroll back along the X axis, in addition to // the given distance.
[ "SetXOverscroll", "sets", "the", "XOverscroll", "optional", "argument", ".", "The", "number", "of", "additional", "pixels", "to", "scroll", "back", "along", "the", "X", "axis", "in", "addition", "to", "the", "given", "distance", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/input/command.go#L424-L427
19,203
mafredri/cdp
protocol/input/command.go
SetYOverscroll
func (a *SynthesizeScrollGestureArgs) SetYOverscroll(yOverscroll float64) *SynthesizeScrollGestureArgs { a.YOverscroll = &yOverscroll return a }
go
func (a *SynthesizeScrollGestureArgs) SetYOverscroll(yOverscroll float64) *SynthesizeScrollGestureArgs { a.YOverscroll = &yOverscroll return a }
[ "func", "(", "a", "*", "SynthesizeScrollGestureArgs", ")", "SetYOverscroll", "(", "yOverscroll", "float64", ")", "*", "SynthesizeScrollGestureArgs", "{", "a", ".", "YOverscroll", "=", "&", "yOverscroll", "\n", "return", "a", "\n", "}" ]
// SetYOverscroll sets the YOverscroll optional argument. The number // of additional pixels to scroll back along the Y axis, in addition to // the given distance.
[ "SetYOverscroll", "sets", "the", "YOverscroll", "optional", "argument", ".", "The", "number", "of", "additional", "pixels", "to", "scroll", "back", "along", "the", "Y", "axis", "in", "addition", "to", "the", "given", "distance", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/input/command.go#L432-L435
19,204
mafredri/cdp
protocol/input/command.go
NewSynthesizeTapGestureArgs
func NewSynthesizeTapGestureArgs(x float64, y float64) *SynthesizeTapGestureArgs { args := new(SynthesizeTapGestureArgs) args.X = x args.Y = y return args }
go
func NewSynthesizeTapGestureArgs(x float64, y float64) *SynthesizeTapGestureArgs { args := new(SynthesizeTapGestureArgs) args.X = x args.Y = y return args }
[ "func", "NewSynthesizeTapGestureArgs", "(", "x", "float64", ",", "y", "float64", ")", "*", "SynthesizeTapGestureArgs", "{", "args", ":=", "new", "(", "SynthesizeTapGestureArgs", ")", "\n", "args", ".", "X", "=", "x", "\n", "args", ".", "Y", "=", "y", "\n", "return", "args", "\n", "}" ]
// NewSynthesizeTapGestureArgs initializes SynthesizeTapGestureArgs with the required arguments.
[ "NewSynthesizeTapGestureArgs", "initializes", "SynthesizeTapGestureArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/input/command.go#L491-L496
19,205
mafredri/cdp
cmd/cdpgen/proto/proto.go
Desc
func (d Domain) Desc(indent, startOffset int) string { return cleanDescription(d.Description, indent, startOffset) }
go
func (d Domain) Desc(indent, startOffset int) string { return cleanDescription(d.Description, indent, startOffset) }
[ "func", "(", "d", "Domain", ")", "Desc", "(", "indent", ",", "startOffset", "int", ")", "string", "{", "return", "cleanDescription", "(", "d", ".", "Description", ",", "indent", ",", "startOffset", ")", "\n", "}" ]
// Desc returns the domain decription.
[ "Desc", "returns", "the", "domain", "decription", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L55-L57
19,206
mafredri/cdp
cmd/cdpgen/proto/proto.go
Name
func (c Command) Name() string { return lint.Name(strings.Title(c.NameName)) }
go
func (c Command) Name() string { return lint.Name(strings.Title(c.NameName)) }
[ "func", "(", "c", "Command", ")", "Name", "(", ")", "string", "{", "return", "lint", ".", "Name", "(", "strings", ".", "Title", "(", "c", ".", "NameName", ")", ")", "\n", "}" ]
// Name rturns the linted command name.
[ "Name", "rturns", "the", "linted", "command", "name", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L73-L75
19,207
mafredri/cdp
cmd/cdpgen/proto/proto.go
Desc
func (c Command) Desc(lineEndComment bool, indent, startOffset int) string { if lineEndComment { return cleanDescription(c.Description, indent, startOffset) } return lowerFirst(cleanDescription(c.Description, indent, startOffset)) }
go
func (c Command) Desc(lineEndComment bool, indent, startOffset int) string { if lineEndComment { return cleanDescription(c.Description, indent, startOffset) } return lowerFirst(cleanDescription(c.Description, indent, startOffset)) }
[ "func", "(", "c", "Command", ")", "Desc", "(", "lineEndComment", "bool", ",", "indent", ",", "startOffset", "int", ")", "string", "{", "if", "lineEndComment", "{", "return", "cleanDescription", "(", "c", ".", "Description", ",", "indent", ",", "startOffset", ")", "\n", "}", "\n", "return", "lowerFirst", "(", "cleanDescription", "(", "c", ".", "Description", ",", "indent", ",", "startOffset", ")", ")", "\n", "}" ]
// Desc returns a cleaned description.
[ "Desc", "returns", "a", "cleaned", "description", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L78-L83
19,208
mafredri/cdp
cmd/cdpgen/proto/proto.go
CmdName
func (c Command) CmdName(d Domain, export bool) string { name := d.Name() if !export { name = strings.ToLower(d.Name()) } return name + c.Name() + "" }
go
func (c Command) CmdName(d Domain, export bool) string { name := d.Name() if !export { name = strings.ToLower(d.Name()) } return name + c.Name() + "" }
[ "func", "(", "c", "Command", ")", "CmdName", "(", "d", "Domain", ",", "export", "bool", ")", "string", "{", "name", ":=", "d", ".", "Name", "(", ")", "\n", "if", "!", "export", "{", "name", "=", "strings", ".", "ToLower", "(", "d", ".", "Name", "(", ")", ")", "\n", "}", "\n", "return", "name", "+", "c", ".", "Name", "(", ")", "+", "\"", "\"", "\n", "}" ]
// CmdName returns the full name of a command.
[ "CmdName", "returns", "the", "full", "name", "of", "a", "command", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L86-L92
19,209
mafredri/cdp
cmd/cdpgen/proto/proto.go
ReplySignature
func (c Command) ReplySignature(d Domain) string { var args []string for _, arg := range c.Returns { name := arg.Name(d) if name == "range" || name == "type" { name = name[0 : len(name)-1] } typ := arg.GoType("cdp", d) if arg.Optional && !strings.HasPrefix(typ, "[]") { typ = "*" + typ } args = append(args, name+" "+typ) } return strings.Join(args, ", ") }
go
func (c Command) ReplySignature(d Domain) string { var args []string for _, arg := range c.Returns { name := arg.Name(d) if name == "range" || name == "type" { name = name[0 : len(name)-1] } typ := arg.GoType("cdp", d) if arg.Optional && !strings.HasPrefix(typ, "[]") { typ = "*" + typ } args = append(args, name+" "+typ) } return strings.Join(args, ", ") }
[ "func", "(", "c", "Command", ")", "ReplySignature", "(", "d", "Domain", ")", "string", "{", "var", "args", "[", "]", "string", "\n", "for", "_", ",", "arg", ":=", "range", "c", ".", "Returns", "{", "name", ":=", "arg", ".", "Name", "(", "d", ")", "\n", "if", "name", "==", "\"", "\"", "||", "name", "==", "\"", "\"", "{", "name", "=", "name", "[", "0", ":", "len", "(", "name", ")", "-", "1", "]", "\n", "}", "\n\n", "typ", ":=", "arg", ".", "GoType", "(", "\"", "\"", ",", "d", ")", "\n", "if", "arg", ".", "Optional", "&&", "!", "strings", ".", "HasPrefix", "(", "typ", ",", "\"", "\"", ")", "{", "typ", "=", "\"", "\"", "+", "typ", "\n", "}", "\n", "args", "=", "append", "(", "args", ",", "name", "+", "\"", "\"", "+", "typ", ")", "\n", "}", "\n", "return", "strings", ".", "Join", "(", "args", ",", "\"", "\"", ")", "\n", "}" ]
// ReplySignature returns the reply signature. Not used.
[ "ReplySignature", "returns", "the", "reply", "signature", ".", "Not", "used", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L145-L160
19,210
mafredri/cdp
cmd/cdpgen/proto/proto.go
ReplyAssign
func (c Command) ReplyAssign(receiver string, d Domain) string { var args []string for _, arg := range c.Returns { name := arg.Name(d) if name == "range" || name == "type" { name = name[0 : len(name)-1] } args = append(args, name+" = "+receiver+"."+arg.ExportedName(d)) } return strings.Join(args, "\n") }
go
func (c Command) ReplyAssign(receiver string, d Domain) string { var args []string for _, arg := range c.Returns { name := arg.Name(d) if name == "range" || name == "type" { name = name[0 : len(name)-1] } args = append(args, name+" = "+receiver+"."+arg.ExportedName(d)) } return strings.Join(args, "\n") }
[ "func", "(", "c", "Command", ")", "ReplyAssign", "(", "receiver", "string", ",", "d", "Domain", ")", "string", "{", "var", "args", "[", "]", "string", "\n", "for", "_", ",", "arg", ":=", "range", "c", ".", "Returns", "{", "name", ":=", "arg", ".", "Name", "(", "d", ")", "\n", "if", "name", "==", "\"", "\"", "||", "name", "==", "\"", "\"", "{", "name", "=", "name", "[", "0", ":", "len", "(", "name", ")", "-", "1", "]", "\n", "}", "\n", "args", "=", "append", "(", "args", ",", "name", "+", "\"", "\"", "+", "receiver", "+", "\"", "\"", "+", "arg", ".", "ExportedName", "(", "d", ")", ")", "\n", "}", "\n", "return", "strings", ".", "Join", "(", "args", ",", "\"", "\\n", "\"", ")", "\n", "}" ]
// ReplyAssign assigns the parameters of the reply. Not used.
[ "ReplyAssign", "assigns", "the", "parameters", "of", "the", "reply", ".", "Not", "used", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L163-L173
19,211
mafredri/cdp
cmd/cdpgen/proto/proto.go
Name
func (e Event) Name() string { return lint.Name(strings.Title(e.NameName)) }
go
func (e Event) Name() string { return lint.Name(strings.Title(e.NameName)) }
[ "func", "(", "e", "Event", ")", "Name", "(", ")", "string", "{", "return", "lint", ".", "Name", "(", "strings", ".", "Title", "(", "e", ".", "NameName", ")", ")", "\n", "}" ]
// Name returns the name of the event.
[ "Name", "returns", "the", "name", "of", "the", "event", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L185-L187
19,212
mafredri/cdp
cmd/cdpgen/proto/proto.go
EventName
func (e Event) EventName(d Domain) string { return nameInDomain(d, e.Name(), "") }
go
func (e Event) EventName(d Domain) string { return nameInDomain(d, e.Name(), "") }
[ "func", "(", "e", "Event", ")", "EventName", "(", "d", "Domain", ")", "string", "{", "return", "nameInDomain", "(", "d", ",", "e", ".", "Name", "(", ")", ",", "\"", "\"", ")", "\n", "}" ]
// EventName returns the name of the event as a go type.
[ "EventName", "returns", "the", "name", "of", "the", "event", "as", "a", "go", "type", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L198-L200
19,213
mafredri/cdp
cmd/cdpgen/proto/proto.go
Name
func (e Enum) Name() string { switch e { case "-Infinity", "-0": return strings.Replace(string(e), "-", "Negative", 1) } s := strings.Replace(string(e), "-", " ", -1) s = strings.Title(s) return lint.Name(strings.Replace(s, " ", "", -1)) }
go
func (e Enum) Name() string { switch e { case "-Infinity", "-0": return strings.Replace(string(e), "-", "Negative", 1) } s := strings.Replace(string(e), "-", " ", -1) s = strings.Title(s) return lint.Name(strings.Replace(s, " ", "", -1)) }
[ "func", "(", "e", "Enum", ")", "Name", "(", ")", "string", "{", "switch", "e", "{", "case", "\"", "\"", ",", "\"", "\"", ":", "return", "strings", ".", "Replace", "(", "string", "(", "e", ")", ",", "\"", "\"", ",", "\"", "\"", ",", "1", ")", "\n", "}", "\n", "s", ":=", "strings", ".", "Replace", "(", "string", "(", "e", ")", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "s", "=", "strings", ".", "Title", "(", "s", ")", "\n", "return", "lint", ".", "Name", "(", "strings", ".", "Replace", "(", "s", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", ")", "\n", "}" ]
// Name returns the Go-ified name for the enum.
[ "Name", "returns", "the", "Go", "-", "ified", "name", "for", "the", "enum", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L211-L219
19,214
mafredri/cdp
cmd/cdpgen/proto/proto.go
ExportedName
func (at AnyType) ExportedName(d Domain) string { if at.IDName != "" { return at.Name(d) } return lint.Name(strings.Title(at.NameName)) }
go
func (at AnyType) ExportedName(d Domain) string { if at.IDName != "" { return at.Name(d) } return lint.Name(strings.Title(at.NameName)) }
[ "func", "(", "at", "AnyType", ")", "ExportedName", "(", "d", "Domain", ")", "string", "{", "if", "at", ".", "IDName", "!=", "\"", "\"", "{", "return", "at", ".", "Name", "(", "d", ")", "\n", "}", "\n", "return", "lint", ".", "Name", "(", "strings", ".", "Title", "(", "at", ".", "NameName", ")", ")", "\n", "}" ]
// ExportedName returns an exported name.
[ "ExportedName", "returns", "an", "exported", "name", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L244-L249
19,215
mafredri/cdp
cmd/cdpgen/proto/proto.go
Name
func (at AnyType) Name(d Domain) string { if at.IDName != "" { return nameInDomain(d, at.IDName, "") } return lint.Name(at.NameName) }
go
func (at AnyType) Name(d Domain) string { if at.IDName != "" { return nameInDomain(d, at.IDName, "") } return lint.Name(at.NameName) }
[ "func", "(", "at", "AnyType", ")", "Name", "(", "d", "Domain", ")", "string", "{", "if", "at", ".", "IDName", "!=", "\"", "\"", "{", "return", "nameInDomain", "(", "d", ",", "at", ".", "IDName", ",", "\"", "\"", ")", "\n", "}", "\n\n", "return", "lint", ".", "Name", "(", "at", ".", "NameName", ")", "\n", "}" ]
// Name returns a Go-ified name for the AnyType.
[ "Name", "returns", "a", "Go", "-", "ified", "name", "for", "the", "AnyType", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L252-L258
19,216
mafredri/cdp
cmd/cdpgen/proto/proto.go
Recvr
func (at AnyType) Recvr(d Domain) string { return strings.ToLower(at.Name(d)[0:1]) }
go
func (at AnyType) Recvr(d Domain) string { return strings.ToLower(at.Name(d)[0:1]) }
[ "func", "(", "at", "AnyType", ")", "Recvr", "(", "d", "Domain", ")", "string", "{", "return", "strings", ".", "ToLower", "(", "at", ".", "Name", "(", "d", ")", "[", "0", ":", "1", "]", ")", "\n", "}" ]
// Recvr returns the receiver for the type.
[ "Recvr", "returns", "the", "receiver", "for", "the", "type", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L261-L263
19,217
mafredri/cdp
cmd/cdpgen/proto/proto.go
GoType
func (at AnyType) GoType(pkg string, d Domain) string { switch at.getType() { case "any": return "json.RawMessage" case "boolean": return "bool" case "string": return "string" case "number": return "float64" case "integer": return "int" case "object": return "struct" case "array": return "[]" + at.Items.GoType(pkg, d) case "reference": return at.refType(d) case "time": return "time.Time" case "enum": // Enums are handled specially. return "enum" case "base64": // By using a []byte here, Base64-encoded images are // automatically decoded by json.Unmarshal. return "[]byte" case "raw": // Special []byte, without bas64 decoding. return "RawMessage" default: log.Panicf("unhandled type: %#v", at) } panic("unreachable") }
go
func (at AnyType) GoType(pkg string, d Domain) string { switch at.getType() { case "any": return "json.RawMessage" case "boolean": return "bool" case "string": return "string" case "number": return "float64" case "integer": return "int" case "object": return "struct" case "array": return "[]" + at.Items.GoType(pkg, d) case "reference": return at.refType(d) case "time": return "time.Time" case "enum": // Enums are handled specially. return "enum" case "base64": // By using a []byte here, Base64-encoded images are // automatically decoded by json.Unmarshal. return "[]byte" case "raw": // Special []byte, without bas64 decoding. return "RawMessage" default: log.Panicf("unhandled type: %#v", at) } panic("unreachable") }
[ "func", "(", "at", "AnyType", ")", "GoType", "(", "pkg", "string", ",", "d", "Domain", ")", "string", "{", "switch", "at", ".", "getType", "(", ")", "{", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "+", "at", ".", "Items", ".", "GoType", "(", "pkg", ",", "d", ")", "\n", "case", "\"", "\"", ":", "return", "at", ".", "refType", "(", "d", ")", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "// Enums are handled specially.", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "// By using a []byte here, Base64-encoded images are", "// automatically decoded by json.Unmarshal.", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "// Special []byte, without bas64 decoding.", "return", "\"", "\"", "\n", "default", ":", "log", ".", "Panicf", "(", "\"", "\"", ",", "at", ")", "\n", "}", "\n\n", "panic", "(", "\"", "\"", ")", "\n", "}" ]
// GoType returns the Go representation for a protocol type.
[ "GoType", "returns", "the", "Go", "representation", "for", "a", "protocol", "type", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/cmd/cdpgen/proto/proto.go#L296-L331
19,218
mafredri/cdp
protocol/audits/domain.go
GetEncodedResponse
func (d *domainClient) GetEncodedResponse(ctx context.Context, args *GetEncodedResponseArgs) (reply *GetEncodedResponseReply, err error) { reply = new(GetEncodedResponseReply) if args != nil { err = rpcc.Invoke(ctx, "Audits.getEncodedResponse", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Audits.getEncodedResponse", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Audits", Op: "GetEncodedResponse", Err: err} } return }
go
func (d *domainClient) GetEncodedResponse(ctx context.Context, args *GetEncodedResponseArgs) (reply *GetEncodedResponseReply, err error) { reply = new(GetEncodedResponseReply) if args != nil { err = rpcc.Invoke(ctx, "Audits.getEncodedResponse", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Audits.getEncodedResponse", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Audits", Op: "GetEncodedResponse", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetEncodedResponse", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetEncodedResponseArgs", ")", "(", "reply", "*", "GetEncodedResponseReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetEncodedResponseReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetEncodedResponse invokes the Audits method. Returns the response body and // size if it were re-encoded with the specified settings. Only applies to // images.
[ "GetEncodedResponse", "invokes", "the", "Audits", "method", ".", "Returns", "the", "response", "body", "and", "size", "if", "it", "were", "re", "-", "encoded", "with", "the", "specified", "settings", ".", "Only", "applies", "to", "images", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/audits/domain.go#L26-L37
19,219
mafredri/cdp
sync.go
Sync
func Sync(c ...eventClient) error { var s []rpcc.Stream for _, cc := range c { cs, ok := cc.(getStreamer) if !ok { return fmt.Errorf("cdp: Sync: bad eventClient type: %T", cc) } s = append(s, cs.GetStream()) } return rpcc.Sync(s...) }
go
func Sync(c ...eventClient) error { var s []rpcc.Stream for _, cc := range c { cs, ok := cc.(getStreamer) if !ok { return fmt.Errorf("cdp: Sync: bad eventClient type: %T", cc) } s = append(s, cs.GetStream()) } return rpcc.Sync(s...) }
[ "func", "Sync", "(", "c", "...", "eventClient", ")", "error", "{", "var", "s", "[", "]", "rpcc", ".", "Stream", "\n", "for", "_", ",", "cc", ":=", "range", "c", "{", "cs", ",", "ok", ":=", "cc", ".", "(", "getStreamer", ")", "\n", "if", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "cc", ")", "\n", "}", "\n", "s", "=", "append", "(", "s", ",", "cs", ".", "GetStream", "(", ")", ")", "\n", "}", "\n", "return", "rpcc", ".", "Sync", "(", "s", "...", ")", "\n", "}" ]
// Sync takes two or more event clients and sets them into synchronous operation, // relative to each other. This operation cannot be undone. If an error is // returned this function is no-op and the event clients will continue in // asynchronous operation. // // All event clients must belong to the same connection and they must not be // closed. Passing multiple clients of the same event type to Sync is not // supported and will return an error. // // An event client that is closed is removed and has no further affect on the // clients that were synchronized. // // When two event clients, A and B, are in sync they will receive events in the // order of arrival. If an event for both A and B is triggered, in that order, // it will not be possible to receive the event from B before the event from A // has been received.
[ "Sync", "takes", "two", "or", "more", "event", "clients", "and", "sets", "them", "into", "synchronous", "operation", "relative", "to", "each", "other", ".", "This", "operation", "cannot", "be", "undone", ".", "If", "an", "error", "is", "returned", "this", "function", "is", "no", "-", "op", "and", "the", "event", "clients", "will", "continue", "in", "asynchronous", "operation", ".", "All", "event", "clients", "must", "belong", "to", "the", "same", "connection", "and", "they", "must", "not", "be", "closed", ".", "Passing", "multiple", "clients", "of", "the", "same", "event", "type", "to", "Sync", "is", "not", "supported", "and", "will", "return", "an", "error", ".", "An", "event", "client", "that", "is", "closed", "is", "removed", "and", "has", "no", "further", "affect", "on", "the", "clients", "that", "were", "synchronized", ".", "When", "two", "event", "clients", "A", "and", "B", "are", "in", "sync", "they", "will", "receive", "events", "in", "the", "order", "of", "arrival", ".", "If", "an", "event", "for", "both", "A", "and", "B", "is", "triggered", "in", "that", "order", "it", "will", "not", "be", "possible", "to", "receive", "the", "event", "from", "B", "before", "the", "event", "from", "A", "has", "been", "received", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/sync.go#L33-L43
19,220
mafredri/cdp
protocol/cast/command.go
SetPresentationURL
func (a *EnableArgs) SetPresentationURL(presentationURL string) *EnableArgs { a.PresentationURL = &presentationURL return a }
go
func (a *EnableArgs) SetPresentationURL(presentationURL string) *EnableArgs { a.PresentationURL = &presentationURL return a }
[ "func", "(", "a", "*", "EnableArgs", ")", "SetPresentationURL", "(", "presentationURL", "string", ")", "*", "EnableArgs", "{", "a", ".", "PresentationURL", "=", "&", "presentationURL", "\n", "return", "a", "\n", "}" ]
// SetPresentationURL sets the PresentationURL optional argument.
[ "SetPresentationURL", "sets", "the", "PresentationURL", "optional", "argument", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/cast/command.go#L18-L21
19,221
mafredri/cdp
protocol/cast/command.go
NewSetSinkToUseArgs
func NewSetSinkToUseArgs(sinkName string) *SetSinkToUseArgs { args := new(SetSinkToUseArgs) args.SinkName = sinkName return args }
go
func NewSetSinkToUseArgs(sinkName string) *SetSinkToUseArgs { args := new(SetSinkToUseArgs) args.SinkName = sinkName return args }
[ "func", "NewSetSinkToUseArgs", "(", "sinkName", "string", ")", "*", "SetSinkToUseArgs", "{", "args", ":=", "new", "(", "SetSinkToUseArgs", ")", "\n", "args", ".", "SinkName", "=", "sinkName", "\n", "return", "args", "\n", "}" ]
// NewSetSinkToUseArgs initializes SetSinkToUseArgs with the required arguments.
[ "NewSetSinkToUseArgs", "initializes", "SetSinkToUseArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/cast/command.go#L29-L33
19,222
mafredri/cdp
protocol/cast/command.go
NewStartTabMirroringArgs
func NewStartTabMirroringArgs(sinkName string) *StartTabMirroringArgs { args := new(StartTabMirroringArgs) args.SinkName = sinkName return args }
go
func NewStartTabMirroringArgs(sinkName string) *StartTabMirroringArgs { args := new(StartTabMirroringArgs) args.SinkName = sinkName return args }
[ "func", "NewStartTabMirroringArgs", "(", "sinkName", "string", ")", "*", "StartTabMirroringArgs", "{", "args", ":=", "new", "(", "StartTabMirroringArgs", ")", "\n", "args", ".", "SinkName", "=", "sinkName", "\n", "return", "args", "\n", "}" ]
// NewStartTabMirroringArgs initializes StartTabMirroringArgs with the required arguments.
[ "NewStartTabMirroringArgs", "initializes", "StartTabMirroringArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/cast/command.go#L41-L45
19,223
mafredri/cdp
protocol/cast/command.go
NewStopCastingArgs
func NewStopCastingArgs(sinkName string) *StopCastingArgs { args := new(StopCastingArgs) args.SinkName = sinkName return args }
go
func NewStopCastingArgs(sinkName string) *StopCastingArgs { args := new(StopCastingArgs) args.SinkName = sinkName return args }
[ "func", "NewStopCastingArgs", "(", "sinkName", "string", ")", "*", "StopCastingArgs", "{", "args", ":=", "new", "(", "StopCastingArgs", ")", "\n", "args", ".", "SinkName", "=", "sinkName", "\n", "return", "args", "\n", "}" ]
// NewStopCastingArgs initializes StopCastingArgs with the required arguments.
[ "NewStopCastingArgs", "initializes", "StopCastingArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/cast/command.go#L53-L57
19,224
mafredri/cdp
protocol/accessibility/command.go
SetNodeID
func (a *GetPartialAXTreeArgs) SetNodeID(nodeID dom.NodeID) *GetPartialAXTreeArgs { a.NodeID = &nodeID return a }
go
func (a *GetPartialAXTreeArgs) SetNodeID(nodeID dom.NodeID) *GetPartialAXTreeArgs { a.NodeID = &nodeID return a }
[ "func", "(", "a", "*", "GetPartialAXTreeArgs", ")", "SetNodeID", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetPartialAXTreeArgs", "{", "a", ".", "NodeID", "=", "&", "nodeID", "\n", "return", "a", "\n", "}" ]
// SetNodeID sets the NodeID optional argument. Identifier of the node // to get the partial accessibility tree for.
[ "SetNodeID", "sets", "the", "NodeID", "optional", "argument", ".", "Identifier", "of", "the", "node", "to", "get", "the", "partial", "accessibility", "tree", "for", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/accessibility/command.go#L27-L30
19,225
mafredri/cdp
protocol/accessibility/command.go
SetBackendNodeID
func (a *GetPartialAXTreeArgs) SetBackendNodeID(backendNodeID dom.BackendNodeID) *GetPartialAXTreeArgs { a.BackendNodeID = &backendNodeID return a }
go
func (a *GetPartialAXTreeArgs) SetBackendNodeID(backendNodeID dom.BackendNodeID) *GetPartialAXTreeArgs { a.BackendNodeID = &backendNodeID return a }
[ "func", "(", "a", "*", "GetPartialAXTreeArgs", ")", "SetBackendNodeID", "(", "backendNodeID", "dom", ".", "BackendNodeID", ")", "*", "GetPartialAXTreeArgs", "{", "a", ".", "BackendNodeID", "=", "&", "backendNodeID", "\n", "return", "a", "\n", "}" ]
// SetBackendNodeID sets the BackendNodeID optional argument. // Identifier of the backend node to get the partial accessibility tree // for.
[ "SetBackendNodeID", "sets", "the", "BackendNodeID", "optional", "argument", ".", "Identifier", "of", "the", "backend", "node", "to", "get", "the", "partial", "accessibility", "tree", "for", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/accessibility/command.go#L35-L38
19,226
mafredri/cdp
protocol/accessibility/command.go
SetObjectID
func (a *GetPartialAXTreeArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetPartialAXTreeArgs { a.ObjectID = &objectID return a }
go
func (a *GetPartialAXTreeArgs) SetObjectID(objectID runtime.RemoteObjectID) *GetPartialAXTreeArgs { a.ObjectID = &objectID return a }
[ "func", "(", "a", "*", "GetPartialAXTreeArgs", ")", "SetObjectID", "(", "objectID", "runtime", ".", "RemoteObjectID", ")", "*", "GetPartialAXTreeArgs", "{", "a", ".", "ObjectID", "=", "&", "objectID", "\n", "return", "a", "\n", "}" ]
// SetObjectID sets the ObjectID optional argument. JavaScript object // id of the node wrapper to get the partial accessibility tree for.
[ "SetObjectID", "sets", "the", "ObjectID", "optional", "argument", ".", "JavaScript", "object", "id", "of", "the", "node", "wrapper", "to", "get", "the", "partial", "accessibility", "tree", "for", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/accessibility/command.go#L42-L45
19,227
mafredri/cdp
protocol/accessibility/command.go
SetFetchRelatives
func (a *GetPartialAXTreeArgs) SetFetchRelatives(fetchRelatives bool) *GetPartialAXTreeArgs { a.FetchRelatives = &fetchRelatives return a }
go
func (a *GetPartialAXTreeArgs) SetFetchRelatives(fetchRelatives bool) *GetPartialAXTreeArgs { a.FetchRelatives = &fetchRelatives return a }
[ "func", "(", "a", "*", "GetPartialAXTreeArgs", ")", "SetFetchRelatives", "(", "fetchRelatives", "bool", ")", "*", "GetPartialAXTreeArgs", "{", "a", ".", "FetchRelatives", "=", "&", "fetchRelatives", "\n", "return", "a", "\n", "}" ]
// SetFetchRelatives sets the FetchRelatives optional argument. // Whether to fetch this nodes ancestors, siblings and children. // Defaults to true.
[ "SetFetchRelatives", "sets", "the", "FetchRelatives", "optional", "argument", ".", "Whether", "to", "fetch", "this", "nodes", "ancestors", "siblings", "and", "children", ".", "Defaults", "to", "true", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/accessibility/command.go#L50-L53
19,228
mafredri/cdp
protocol/browser/command.go
NewGrantPermissionsArgs
func NewGrantPermissionsArgs(origin string, permissions []PermissionType) *GrantPermissionsArgs { args := new(GrantPermissionsArgs) args.Origin = origin args.Permissions = permissions return args }
go
func NewGrantPermissionsArgs(origin string, permissions []PermissionType) *GrantPermissionsArgs { args := new(GrantPermissionsArgs) args.Origin = origin args.Permissions = permissions return args }
[ "func", "NewGrantPermissionsArgs", "(", "origin", "string", ",", "permissions", "[", "]", "PermissionType", ")", "*", "GrantPermissionsArgs", "{", "args", ":=", "new", "(", "GrantPermissionsArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "args", ".", "Permissions", "=", "permissions", "\n", "return", "args", "\n", "}" ]
// NewGrantPermissionsArgs initializes GrantPermissionsArgs with the required arguments.
[ "NewGrantPermissionsArgs", "initializes", "GrantPermissionsArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L17-L22
19,229
mafredri/cdp
protocol/browser/command.go
SetBrowserContextID
func (a *GrantPermissionsArgs) SetBrowserContextID(browserContextID target.BrowserContextID) *GrantPermissionsArgs { a.BrowserContextID = &browserContextID return a }
go
func (a *GrantPermissionsArgs) SetBrowserContextID(browserContextID target.BrowserContextID) *GrantPermissionsArgs { a.BrowserContextID = &browserContextID return a }
[ "func", "(", "a", "*", "GrantPermissionsArgs", ")", "SetBrowserContextID", "(", "browserContextID", "target", ".", "BrowserContextID", ")", "*", "GrantPermissionsArgs", "{", "a", ".", "BrowserContextID", "=", "&", "browserContextID", "\n", "return", "a", "\n", "}" ]
// SetBrowserContextID sets the BrowserContextID optional argument. // BrowserContext to override permissions. When omitted, default // browser context is used.
[ "SetBrowserContextID", "sets", "the", "BrowserContextID", "optional", "argument", ".", "BrowserContext", "to", "override", "permissions", ".", "When", "omitted", "default", "browser", "context", "is", "used", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L27-L30
19,230
mafredri/cdp
protocol/browser/command.go
SetBrowserContextID
func (a *ResetPermissionsArgs) SetBrowserContextID(browserContextID target.BrowserContextID) *ResetPermissionsArgs { a.BrowserContextID = &browserContextID return a }
go
func (a *ResetPermissionsArgs) SetBrowserContextID(browserContextID target.BrowserContextID) *ResetPermissionsArgs { a.BrowserContextID = &browserContextID return a }
[ "func", "(", "a", "*", "ResetPermissionsArgs", ")", "SetBrowserContextID", "(", "browserContextID", "target", ".", "BrowserContextID", ")", "*", "ResetPermissionsArgs", "{", "a", ".", "BrowserContextID", "=", "&", "browserContextID", "\n", "return", "a", "\n", "}" ]
// SetBrowserContextID sets the BrowserContextID optional argument. // BrowserContext to reset permissions. When omitted, default browser // context is used.
[ "SetBrowserContextID", "sets", "the", "BrowserContextID", "optional", "argument", ".", "BrowserContext", "to", "reset", "permissions", ".", "When", "omitted", "default", "browser", "context", "is", "used", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L47-L50
19,231
mafredri/cdp
protocol/browser/command.go
SetQuery
func (a *GetHistogramsArgs) SetQuery(query string) *GetHistogramsArgs { a.Query = &query return a }
go
func (a *GetHistogramsArgs) SetQuery(query string) *GetHistogramsArgs { a.Query = &query return a }
[ "func", "(", "a", "*", "GetHistogramsArgs", ")", "SetQuery", "(", "query", "string", ")", "*", "GetHistogramsArgs", "{", "a", ".", "Query", "=", "&", "query", "\n", "return", "a", "\n", "}" ]
// SetQuery sets the Query optional argument. Requested substring in // name. Only histograms which have query as a substring in their name // are extracted. An empty or absent query returns all histograms.
[ "SetQuery", "sets", "the", "Query", "optional", "argument", ".", "Requested", "substring", "in", "name", ".", "Only", "histograms", "which", "have", "query", "as", "a", "substring", "in", "their", "name", "are", "extracted", ".", "An", "empty", "or", "absent", "query", "returns", "all", "histograms", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L82-L85
19,232
mafredri/cdp
protocol/browser/command.go
NewGetHistogramArgs
func NewGetHistogramArgs(name string) *GetHistogramArgs { args := new(GetHistogramArgs) args.Name = name return args }
go
func NewGetHistogramArgs(name string) *GetHistogramArgs { args := new(GetHistogramArgs) args.Name = name return args }
[ "func", "NewGetHistogramArgs", "(", "name", "string", ")", "*", "GetHistogramArgs", "{", "args", ":=", "new", "(", "GetHistogramArgs", ")", "\n", "args", ".", "Name", "=", "name", "\n", "return", "args", "\n", "}" ]
// NewGetHistogramArgs initializes GetHistogramArgs with the required arguments.
[ "NewGetHistogramArgs", "initializes", "GetHistogramArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L106-L110
19,233
mafredri/cdp
protocol/browser/command.go
NewGetWindowBoundsArgs
func NewGetWindowBoundsArgs(windowID WindowID) *GetWindowBoundsArgs { args := new(GetWindowBoundsArgs) args.WindowID = windowID return args }
go
func NewGetWindowBoundsArgs(windowID WindowID) *GetWindowBoundsArgs { args := new(GetWindowBoundsArgs) args.WindowID = windowID return args }
[ "func", "NewGetWindowBoundsArgs", "(", "windowID", "WindowID", ")", "*", "GetWindowBoundsArgs", "{", "args", ":=", "new", "(", "GetWindowBoundsArgs", ")", "\n", "args", ".", "WindowID", "=", "windowID", "\n", "return", "args", "\n", "}" ]
// NewGetWindowBoundsArgs initializes GetWindowBoundsArgs with the required arguments.
[ "NewGetWindowBoundsArgs", "initializes", "GetWindowBoundsArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L130-L134
19,234
mafredri/cdp
protocol/browser/command.go
SetTargetID
func (a *GetWindowForTargetArgs) SetTargetID(targetID target.ID) *GetWindowForTargetArgs { a.TargetID = &targetID return a }
go
func (a *GetWindowForTargetArgs) SetTargetID(targetID target.ID) *GetWindowForTargetArgs { a.TargetID = &targetID return a }
[ "func", "(", "a", "*", "GetWindowForTargetArgs", ")", "SetTargetID", "(", "targetID", "target", ".", "ID", ")", "*", "GetWindowForTargetArgs", "{", "a", ".", "TargetID", "=", "&", "targetID", "\n", "return", "a", "\n", "}" ]
// SetTargetID sets the TargetID optional argument. Devtools agent // host id. If called as a part of the session, associated targetId is // used.
[ "SetTargetID", "sets", "the", "TargetID", "optional", "argument", ".", "Devtools", "agent", "host", "id", ".", "If", "called", "as", "a", "part", "of", "the", "session", "associated", "targetId", "is", "used", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L156-L159
19,235
mafredri/cdp
protocol/browser/command.go
NewSetWindowBoundsArgs
func NewSetWindowBoundsArgs(windowID WindowID, bounds Bounds) *SetWindowBoundsArgs { args := new(SetWindowBoundsArgs) args.WindowID = windowID args.Bounds = bounds return args }
go
func NewSetWindowBoundsArgs(windowID WindowID, bounds Bounds) *SetWindowBoundsArgs { args := new(SetWindowBoundsArgs) args.WindowID = windowID args.Bounds = bounds return args }
[ "func", "NewSetWindowBoundsArgs", "(", "windowID", "WindowID", ",", "bounds", "Bounds", ")", "*", "SetWindowBoundsArgs", "{", "args", ":=", "new", "(", "SetWindowBoundsArgs", ")", "\n", "args", ".", "WindowID", "=", "windowID", "\n", "args", ".", "Bounds", "=", "bounds", "\n", "return", "args", "\n", "}" ]
// NewSetWindowBoundsArgs initializes SetWindowBoundsArgs with the required arguments.
[ "NewSetWindowBoundsArgs", "initializes", "SetWindowBoundsArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L174-L179
19,236
mafredri/cdp
protocol/browser/command.go
SetBadgeLabel
func (a *SetDockTileArgs) SetBadgeLabel(badgeLabel string) *SetDockTileArgs { a.BadgeLabel = &badgeLabel return a }
go
func (a *SetDockTileArgs) SetBadgeLabel(badgeLabel string) *SetDockTileArgs { a.BadgeLabel = &badgeLabel return a }
[ "func", "(", "a", "*", "SetDockTileArgs", ")", "SetBadgeLabel", "(", "badgeLabel", "string", ")", "*", "SetDockTileArgs", "{", "a", ".", "BadgeLabel", "=", "&", "badgeLabel", "\n", "return", "a", "\n", "}" ]
// SetBadgeLabel sets the BadgeLabel optional argument.
[ "SetBadgeLabel", "sets", "the", "BadgeLabel", "optional", "argument", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L195-L198
19,237
mafredri/cdp
protocol/browser/command.go
SetImage
func (a *SetDockTileArgs) SetImage(image string) *SetDockTileArgs { a.Image = &image return a }
go
func (a *SetDockTileArgs) SetImage(image string) *SetDockTileArgs { a.Image = &image return a }
[ "func", "(", "a", "*", "SetDockTileArgs", ")", "SetImage", "(", "image", "string", ")", "*", "SetDockTileArgs", "{", "a", ".", "Image", "=", "&", "image", "\n", "return", "a", "\n", "}" ]
// SetImage sets the Image optional argument. Png encoded image.
[ "SetImage", "sets", "the", "Image", "optional", "argument", ".", "Png", "encoded", "image", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/command.go#L201-L204
19,238
mafredri/cdp
protocol/io/domain.go
Read
func (d *domainClient) Read(ctx context.Context, args *ReadArgs) (reply *ReadReply, err error) { reply = new(ReadReply) if args != nil { err = rpcc.Invoke(ctx, "IO.read", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "IO.read", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "IO", Op: "Read", Err: err} } return }
go
func (d *domainClient) Read(ctx context.Context, args *ReadArgs) (reply *ReadReply, err error) { reply = new(ReadReply) if args != nil { err = rpcc.Invoke(ctx, "IO.read", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "IO.read", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "IO", Op: "Read", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "Read", "(", "ctx", "context", ".", "Context", ",", "args", "*", "ReadArgs", ")", "(", "reply", "*", "ReadReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "ReadReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// Read invokes the IO method. Read a chunk of the stream
[ "Read", "invokes", "the", "IO", "method", ".", "Read", "a", "chunk", "of", "the", "stream" ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/io/domain.go#L38-L49
19,239
mafredri/cdp
protocol/io/domain.go
ResolveBlob
func (d *domainClient) ResolveBlob(ctx context.Context, args *ResolveBlobArgs) (reply *ResolveBlobReply, err error) { reply = new(ResolveBlobReply) if args != nil { err = rpcc.Invoke(ctx, "IO.resolveBlob", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "IO.resolveBlob", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "IO", Op: "ResolveBlob", Err: err} } return }
go
func (d *domainClient) ResolveBlob(ctx context.Context, args *ResolveBlobArgs) (reply *ResolveBlobReply, err error) { reply = new(ResolveBlobReply) if args != nil { err = rpcc.Invoke(ctx, "IO.resolveBlob", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "IO.resolveBlob", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "IO", Op: "ResolveBlob", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "ResolveBlob", "(", "ctx", "context", ".", "Context", ",", "args", "*", "ResolveBlobArgs", ")", "(", "reply", "*", "ResolveBlobReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "ResolveBlobReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// ResolveBlob invokes the IO method. Return UUID of Blob object specified by // a remote object id.
[ "ResolveBlob", "invokes", "the", "IO", "method", ".", "Return", "UUID", "of", "Blob", "object", "specified", "by", "a", "remote", "object", "id", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/io/domain.go#L53-L64
19,240
mafredri/cdp
protocol/storage/command.go
NewClearDataForOriginArgs
func NewClearDataForOriginArgs(origin string, storageTypes string) *ClearDataForOriginArgs { args := new(ClearDataForOriginArgs) args.Origin = origin args.StorageTypes = storageTypes return args }
go
func NewClearDataForOriginArgs(origin string, storageTypes string) *ClearDataForOriginArgs { args := new(ClearDataForOriginArgs) args.Origin = origin args.StorageTypes = storageTypes return args }
[ "func", "NewClearDataForOriginArgs", "(", "origin", "string", ",", "storageTypes", "string", ")", "*", "ClearDataForOriginArgs", "{", "args", ":=", "new", "(", "ClearDataForOriginArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "args", ".", "StorageTypes", "=", "storageTypes", "\n", "return", "args", "\n", "}" ]
// NewClearDataForOriginArgs initializes ClearDataForOriginArgs with the required arguments.
[ "NewClearDataForOriginArgs", "initializes", "ClearDataForOriginArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L12-L17
19,241
mafredri/cdp
protocol/storage/command.go
NewGetUsageAndQuotaArgs
func NewGetUsageAndQuotaArgs(origin string) *GetUsageAndQuotaArgs { args := new(GetUsageAndQuotaArgs) args.Origin = origin return args }
go
func NewGetUsageAndQuotaArgs(origin string) *GetUsageAndQuotaArgs { args := new(GetUsageAndQuotaArgs) args.Origin = origin return args }
[ "func", "NewGetUsageAndQuotaArgs", "(", "origin", "string", ")", "*", "GetUsageAndQuotaArgs", "{", "args", ":=", "new", "(", "GetUsageAndQuotaArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "return", "args", "\n", "}" ]
// NewGetUsageAndQuotaArgs initializes GetUsageAndQuotaArgs with the required arguments.
[ "NewGetUsageAndQuotaArgs", "initializes", "GetUsageAndQuotaArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L25-L29
19,242
mafredri/cdp
protocol/storage/command.go
NewTrackCacheStorageForOriginArgs
func NewTrackCacheStorageForOriginArgs(origin string) *TrackCacheStorageForOriginArgs { args := new(TrackCacheStorageForOriginArgs) args.Origin = origin return args }
go
func NewTrackCacheStorageForOriginArgs(origin string) *TrackCacheStorageForOriginArgs { args := new(TrackCacheStorageForOriginArgs) args.Origin = origin return args }
[ "func", "NewTrackCacheStorageForOriginArgs", "(", "origin", "string", ")", "*", "TrackCacheStorageForOriginArgs", "{", "args", ":=", "new", "(", "TrackCacheStorageForOriginArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "return", "args", "\n", "}" ]
// NewTrackCacheStorageForOriginArgs initializes TrackCacheStorageForOriginArgs with the required arguments.
[ "NewTrackCacheStorageForOriginArgs", "initializes", "TrackCacheStorageForOriginArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L44-L48
19,243
mafredri/cdp
protocol/storage/command.go
NewTrackIndexedDBForOriginArgs
func NewTrackIndexedDBForOriginArgs(origin string) *TrackIndexedDBForOriginArgs { args := new(TrackIndexedDBForOriginArgs) args.Origin = origin return args }
go
func NewTrackIndexedDBForOriginArgs(origin string) *TrackIndexedDBForOriginArgs { args := new(TrackIndexedDBForOriginArgs) args.Origin = origin return args }
[ "func", "NewTrackIndexedDBForOriginArgs", "(", "origin", "string", ")", "*", "TrackIndexedDBForOriginArgs", "{", "args", ":=", "new", "(", "TrackIndexedDBForOriginArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "return", "args", "\n", "}" ]
// NewTrackIndexedDBForOriginArgs initializes TrackIndexedDBForOriginArgs with the required arguments.
[ "NewTrackIndexedDBForOriginArgs", "initializes", "TrackIndexedDBForOriginArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L56-L60
19,244
mafredri/cdp
protocol/storage/command.go
NewUntrackCacheStorageForOriginArgs
func NewUntrackCacheStorageForOriginArgs(origin string) *UntrackCacheStorageForOriginArgs { args := new(UntrackCacheStorageForOriginArgs) args.Origin = origin return args }
go
func NewUntrackCacheStorageForOriginArgs(origin string) *UntrackCacheStorageForOriginArgs { args := new(UntrackCacheStorageForOriginArgs) args.Origin = origin return args }
[ "func", "NewUntrackCacheStorageForOriginArgs", "(", "origin", "string", ")", "*", "UntrackCacheStorageForOriginArgs", "{", "args", ":=", "new", "(", "UntrackCacheStorageForOriginArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "return", "args", "\n", "}" ]
// NewUntrackCacheStorageForOriginArgs initializes UntrackCacheStorageForOriginArgs with the required arguments.
[ "NewUntrackCacheStorageForOriginArgs", "initializes", "UntrackCacheStorageForOriginArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L68-L72
19,245
mafredri/cdp
protocol/storage/command.go
NewUntrackIndexedDBForOriginArgs
func NewUntrackIndexedDBForOriginArgs(origin string) *UntrackIndexedDBForOriginArgs { args := new(UntrackIndexedDBForOriginArgs) args.Origin = origin return args }
go
func NewUntrackIndexedDBForOriginArgs(origin string) *UntrackIndexedDBForOriginArgs { args := new(UntrackIndexedDBForOriginArgs) args.Origin = origin return args }
[ "func", "NewUntrackIndexedDBForOriginArgs", "(", "origin", "string", ")", "*", "UntrackIndexedDBForOriginArgs", "{", "args", ":=", "new", "(", "UntrackIndexedDBForOriginArgs", ")", "\n", "args", ".", "Origin", "=", "origin", "\n", "return", "args", "\n", "}" ]
// NewUntrackIndexedDBForOriginArgs initializes UntrackIndexedDBForOriginArgs with the required arguments.
[ "NewUntrackIndexedDBForOriginArgs", "initializes", "UntrackIndexedDBForOriginArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/storage/command.go#L80-L84
19,246
mafredri/cdp
protocol/memory/command.go
NewSetPressureNotificationsSuppressedArgs
func NewSetPressureNotificationsSuppressedArgs(suppressed bool) *SetPressureNotificationsSuppressedArgs { args := new(SetPressureNotificationsSuppressedArgs) args.Suppressed = suppressed return args }
go
func NewSetPressureNotificationsSuppressedArgs(suppressed bool) *SetPressureNotificationsSuppressedArgs { args := new(SetPressureNotificationsSuppressedArgs) args.Suppressed = suppressed return args }
[ "func", "NewSetPressureNotificationsSuppressedArgs", "(", "suppressed", "bool", ")", "*", "SetPressureNotificationsSuppressedArgs", "{", "args", ":=", "new", "(", "SetPressureNotificationsSuppressedArgs", ")", "\n", "args", ".", "Suppressed", "=", "suppressed", "\n", "return", "args", "\n", "}" ]
// NewSetPressureNotificationsSuppressedArgs initializes SetPressureNotificationsSuppressedArgs with the required arguments.
[ "NewSetPressureNotificationsSuppressedArgs", "initializes", "SetPressureNotificationsSuppressedArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/memory/command.go#L18-L22
19,247
mafredri/cdp
protocol/memory/command.go
NewSimulatePressureNotificationArgs
func NewSimulatePressureNotificationArgs(level PressureLevel) *SimulatePressureNotificationArgs { args := new(SimulatePressureNotificationArgs) args.Level = level return args }
go
func NewSimulatePressureNotificationArgs(level PressureLevel) *SimulatePressureNotificationArgs { args := new(SimulatePressureNotificationArgs) args.Level = level return args }
[ "func", "NewSimulatePressureNotificationArgs", "(", "level", "PressureLevel", ")", "*", "SimulatePressureNotificationArgs", "{", "args", ":=", "new", "(", "SimulatePressureNotificationArgs", ")", "\n", "args", ".", "Level", "=", "level", "\n", "return", "args", "\n", "}" ]
// NewSimulatePressureNotificationArgs initializes SimulatePressureNotificationArgs with the required arguments.
[ "NewSimulatePressureNotificationArgs", "initializes", "SimulatePressureNotificationArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/memory/command.go#L30-L34
19,248
mafredri/cdp
protocol/memory/command.go
SetSamplingInterval
func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval int) *StartSamplingArgs { a.SamplingInterval = &samplingInterval return a }
go
func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval int) *StartSamplingArgs { a.SamplingInterval = &samplingInterval return a }
[ "func", "(", "a", "*", "StartSamplingArgs", ")", "SetSamplingInterval", "(", "samplingInterval", "int", ")", "*", "StartSamplingArgs", "{", "a", ".", "SamplingInterval", "=", "&", "samplingInterval", "\n", "return", "a", "\n", "}" ]
// SetSamplingInterval sets the SamplingInterval optional argument. // Average number of bytes between samples.
[ "SetSamplingInterval", "sets", "the", "SamplingInterval", "optional", "argument", ".", "Average", "number", "of", "bytes", "between", "samples", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/memory/command.go#L51-L54
19,249
mafredri/cdp
protocol/memory/command.go
SetSuppressRandomness
func (a *StartSamplingArgs) SetSuppressRandomness(suppressRandomness bool) *StartSamplingArgs { a.SuppressRandomness = &suppressRandomness return a }
go
func (a *StartSamplingArgs) SetSuppressRandomness(suppressRandomness bool) *StartSamplingArgs { a.SuppressRandomness = &suppressRandomness return a }
[ "func", "(", "a", "*", "StartSamplingArgs", ")", "SetSuppressRandomness", "(", "suppressRandomness", "bool", ")", "*", "StartSamplingArgs", "{", "a", ".", "SuppressRandomness", "=", "&", "suppressRandomness", "\n", "return", "a", "\n", "}" ]
// SetSuppressRandomness sets the SuppressRandomness optional argument. // Do not randomize intervals between samples.
[ "SetSuppressRandomness", "sets", "the", "SuppressRandomness", "optional", "argument", ".", "Do", "not", "randomize", "intervals", "between", "samples", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/memory/command.go#L58-L61
19,250
mafredri/cdp
rpcc/stream_sync.go
write
func (s *syncMessageStore) write(m message) { s.mu.Lock() defer s.mu.Unlock() w, ok := s.writers[m.method] if !ok { // Exit early if writer has already // unsubscribed or store is closed. return } m.next = s.load if s.pending { s.backlog = append(s.backlog, &m) return } s.pending = true w.write(m) }
go
func (s *syncMessageStore) write(m message) { s.mu.Lock() defer s.mu.Unlock() w, ok := s.writers[m.method] if !ok { // Exit early if writer has already // unsubscribed or store is closed. return } m.next = s.load if s.pending { s.backlog = append(s.backlog, &m) return } s.pending = true w.write(m) }
[ "func", "(", "s", "*", "syncMessageStore", ")", "write", "(", "m", "message", ")", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "w", ",", "ok", ":=", "s", ".", "writers", "[", "m", ".", "method", "]", "\n", "if", "!", "ok", "{", "// Exit early if writer has already", "// unsubscribed or store is closed.", "return", "\n", "}", "\n\n", "m", ".", "next", "=", "s", ".", "load", "\n", "if", "s", ".", "pending", "{", "s", ".", "backlog", "=", "append", "(", "s", ".", "backlog", ",", "&", "m", ")", "\n", "return", "\n", "}", "\n\n", "s", ".", "pending", "=", "true", "\n", "w", ".", "write", "(", "m", ")", "\n", "}" ]
// write implements messageWriter, the message is stored // in a messageWriter if there are no pending messages, // otherwise appended to backlog.
[ "write", "implements", "messageWriter", "the", "message", "is", "stored", "in", "a", "messageWriter", "if", "there", "are", "no", "pending", "messages", "otherwise", "appended", "to", "backlog", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/rpcc/stream_sync.go#L78-L97
19,251
mafredri/cdp
rpcc/stream_sync.go
load
func (s *syncMessageStore) load() { s.mu.Lock() defer s.mu.Unlock() // Keep going until we can write the next message // or the backlog is empty. for { if len(s.backlog) == 0 { s.pending = false return } m := s.backlog[0] s.backlog[0] = nil // Remove reference from underlying array. s.backlog = s.backlog[1:] // Check if the writer has already unsubscribed. if w, ok := s.writers[m.method]; ok { // A write here means that this message must be // processed (calling m.next) by the recipient. // Failure to do so will prevent future messages // from being delivered. w.write(*m) return } } }
go
func (s *syncMessageStore) load() { s.mu.Lock() defer s.mu.Unlock() // Keep going until we can write the next message // or the backlog is empty. for { if len(s.backlog) == 0 { s.pending = false return } m := s.backlog[0] s.backlog[0] = nil // Remove reference from underlying array. s.backlog = s.backlog[1:] // Check if the writer has already unsubscribed. if w, ok := s.writers[m.method]; ok { // A write here means that this message must be // processed (calling m.next) by the recipient. // Failure to do so will prevent future messages // from being delivered. w.write(*m) return } } }
[ "func", "(", "s", "*", "syncMessageStore", ")", "load", "(", ")", "{", "s", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "// Keep going until we can write the next message", "// or the backlog is empty.", "for", "{", "if", "len", "(", "s", ".", "backlog", ")", "==", "0", "{", "s", ".", "pending", "=", "false", "\n", "return", "\n", "}", "\n\n", "m", ":=", "s", ".", "backlog", "[", "0", "]", "\n", "s", ".", "backlog", "[", "0", "]", "=", "nil", "// Remove reference from underlying array.", "\n", "s", ".", "backlog", "=", "s", ".", "backlog", "[", "1", ":", "]", "\n\n", "// Check if the writer has already unsubscribed.", "if", "w", ",", "ok", ":=", "s", ".", "writers", "[", "m", ".", "method", "]", ";", "ok", "{", "// A write here means that this message must be", "// processed (calling m.next) by the recipient.", "// Failure to do so will prevent future messages", "// from being delivered.", "w", ".", "write", "(", "*", "m", ")", "\n", "return", "\n", "}", "\n", "}", "\n", "}" ]
// load writes the next message into a messageWriter, // resets pending status if backlog is empty.
[ "load", "writes", "the", "next", "message", "into", "a", "messageWriter", "resets", "pending", "status", "if", "backlog", "is", "empty", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/rpcc/stream_sync.go#L101-L127
19,252
mafredri/cdp
rpcc/stream_sync.go
Sync
func Sync(s ...Stream) (err error) { if len(s) < 2 { return errors.New("rpcc: Sync: two or more streams must be provided") } set := make(map[Stream]struct{}) for _, ss := range s { if _, ok := set[ss]; ok { return errors.New("rpcc: Sync: same instance of stream passed multiple times") } set[ss] = struct{}{} } store := newSyncMessageStore() defer func() { if err != nil { store.close() } }() var conn *Conn var swap []func() for _, ss := range s { sc, ok := ss.(*streamClient) if !ok { return fmt.Errorf("rpcc: Sync: bad Stream type: %T", ss) } if conn == nil { conn = sc.conn } if sc.conn != conn { return errors.New("rpcc: Sync: all Streams must share same Conn") } // The Stream lock must be held until the // swap has been done for all streams. sc.mu.Lock() defer sc.mu.Unlock() if sc.remove == nil { return errors.New("rpcc: Sync: Stream is closed") } // Allow store to manage messages to streamClient. unsub, err := store.subscribe(sc.method, sc, sc.conn) if err != nil { return errors.New("rpcc: Sync: " + err.Error()) } // Delay listener swap until all Streams have been // processed so that we can abort on error. swap = append(swap, func() { sc.remove() // Prevent direct events from Conn. sc.remove = func() { unsub() // Remove from store on Close. sc.mbuf.clear() // Ensure pending message is processed. } // Clear stream messages to prevent sync issues. sc.mbuf.clear() }) } // Perform swap, mutex lock (streamClient.mu) is still active. for _, s := range swap { s() } return nil }
go
func Sync(s ...Stream) (err error) { if len(s) < 2 { return errors.New("rpcc: Sync: two or more streams must be provided") } set := make(map[Stream]struct{}) for _, ss := range s { if _, ok := set[ss]; ok { return errors.New("rpcc: Sync: same instance of stream passed multiple times") } set[ss] = struct{}{} } store := newSyncMessageStore() defer func() { if err != nil { store.close() } }() var conn *Conn var swap []func() for _, ss := range s { sc, ok := ss.(*streamClient) if !ok { return fmt.Errorf("rpcc: Sync: bad Stream type: %T", ss) } if conn == nil { conn = sc.conn } if sc.conn != conn { return errors.New("rpcc: Sync: all Streams must share same Conn") } // The Stream lock must be held until the // swap has been done for all streams. sc.mu.Lock() defer sc.mu.Unlock() if sc.remove == nil { return errors.New("rpcc: Sync: Stream is closed") } // Allow store to manage messages to streamClient. unsub, err := store.subscribe(sc.method, sc, sc.conn) if err != nil { return errors.New("rpcc: Sync: " + err.Error()) } // Delay listener swap until all Streams have been // processed so that we can abort on error. swap = append(swap, func() { sc.remove() // Prevent direct events from Conn. sc.remove = func() { unsub() // Remove from store on Close. sc.mbuf.clear() // Ensure pending message is processed. } // Clear stream messages to prevent sync issues. sc.mbuf.clear() }) } // Perform swap, mutex lock (streamClient.mu) is still active. for _, s := range swap { s() } return nil }
[ "func", "Sync", "(", "s", "...", "Stream", ")", "(", "err", "error", ")", "{", "if", "len", "(", "s", ")", "<", "2", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "set", ":=", "make", "(", "map", "[", "Stream", "]", "struct", "{", "}", ")", "\n", "for", "_", ",", "ss", ":=", "range", "s", "{", "if", "_", ",", "ok", ":=", "set", "[", "ss", "]", ";", "ok", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "set", "[", "ss", "]", "=", "struct", "{", "}", "{", "}", "\n", "}", "\n\n", "store", ":=", "newSyncMessageStore", "(", ")", "\n", "defer", "func", "(", ")", "{", "if", "err", "!=", "nil", "{", "store", ".", "close", "(", ")", "\n", "}", "\n", "}", "(", ")", "\n\n", "var", "conn", "*", "Conn", "\n", "var", "swap", "[", "]", "func", "(", ")", "\n\n", "for", "_", ",", "ss", ":=", "range", "s", "{", "sc", ",", "ok", ":=", "ss", ".", "(", "*", "streamClient", ")", "\n", "if", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "ss", ")", "\n", "}", "\n", "if", "conn", "==", "nil", "{", "conn", "=", "sc", ".", "conn", "\n", "}", "\n", "if", "sc", ".", "conn", "!=", "conn", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// The Stream lock must be held until the", "// swap has been done for all streams.", "sc", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "sc", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "if", "sc", ".", "remove", "==", "nil", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Allow store to manage messages to streamClient.", "unsub", ",", "err", ":=", "store", ".", "subscribe", "(", "sc", ".", "method", ",", "sc", ",", "sc", ".", "conn", ")", "\n", "if", "err", "!=", "nil", "{", "return", "errors", ".", "New", "(", "\"", "\"", "+", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n\n", "// Delay listener swap until all Streams have been", "// processed so that we can abort on error.", "swap", "=", "append", "(", "swap", ",", "func", "(", ")", "{", "sc", ".", "remove", "(", ")", "// Prevent direct events from Conn.", "\n", "sc", ".", "remove", "=", "func", "(", ")", "{", "unsub", "(", ")", "// Remove from store on Close.", "\n", "sc", ".", "mbuf", ".", "clear", "(", ")", "// Ensure pending message is processed.", "\n", "}", "\n\n", "// Clear stream messages to prevent sync issues.", "sc", ".", "mbuf", ".", "clear", "(", ")", "\n", "}", ")", "\n", "}", "\n\n", "// Perform swap, mutex lock (streamClient.mu) is still active.", "for", "_", ",", "s", ":=", "range", "swap", "{", "s", "(", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Sync takes two or more streams and sets them into synchronous operation, // relative to each other. This operation cannot be undone. If an error is // returned this function is no-op and the streams will continue in asynchronous // operation. // // All streams must belong to the same Conn and they must not be closed. Passing // multiple streams of the same method to Sync is not supported and will return // an error. // // A stream that is closed is removed and has no further affect on the streams // that were synchronized. // // When two streams, A and B, are in sync they will both receive messages in the // order that they arrived on Conn. If a message for both A and B arrives, in // that order, it will not be possible to receive the message from B before the // message from A has been received.
[ "Sync", "takes", "two", "or", "more", "streams", "and", "sets", "them", "into", "synchronous", "operation", "relative", "to", "each", "other", ".", "This", "operation", "cannot", "be", "undone", ".", "If", "an", "error", "is", "returned", "this", "function", "is", "no", "-", "op", "and", "the", "streams", "will", "continue", "in", "asynchronous", "operation", ".", "All", "streams", "must", "belong", "to", "the", "same", "Conn", "and", "they", "must", "not", "be", "closed", ".", "Passing", "multiple", "streams", "of", "the", "same", "method", "to", "Sync", "is", "not", "supported", "and", "will", "return", "an", "error", ".", "A", "stream", "that", "is", "closed", "is", "removed", "and", "has", "no", "further", "affect", "on", "the", "streams", "that", "were", "synchronized", ".", "When", "two", "streams", "A", "and", "B", "are", "in", "sync", "they", "will", "both", "receive", "messages", "in", "the", "order", "that", "they", "arrived", "on", "Conn", ".", "If", "a", "message", "for", "both", "A", "and", "B", "arrives", "in", "that", "order", "it", "will", "not", "be", "possible", "to", "receive", "the", "message", "from", "B", "before", "the", "message", "from", "A", "has", "been", "received", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/rpcc/stream_sync.go#L145-L215
19,253
mafredri/cdp
protocol/page/domain.go
AddScriptToEvaluateOnLoad
func (d *domainClient) AddScriptToEvaluateOnLoad(ctx context.Context, args *AddScriptToEvaluateOnLoadArgs) (reply *AddScriptToEvaluateOnLoadReply, err error) { reply = new(AddScriptToEvaluateOnLoadReply) if args != nil { err = rpcc.Invoke(ctx, "Page.addScriptToEvaluateOnLoad", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.addScriptToEvaluateOnLoad", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "AddScriptToEvaluateOnLoad", Err: err} } return }
go
func (d *domainClient) AddScriptToEvaluateOnLoad(ctx context.Context, args *AddScriptToEvaluateOnLoadArgs) (reply *AddScriptToEvaluateOnLoadReply, err error) { reply = new(AddScriptToEvaluateOnLoadReply) if args != nil { err = rpcc.Invoke(ctx, "Page.addScriptToEvaluateOnLoad", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.addScriptToEvaluateOnLoad", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "AddScriptToEvaluateOnLoad", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "AddScriptToEvaluateOnLoad", "(", "ctx", "context", ".", "Context", ",", "args", "*", "AddScriptToEvaluateOnLoadArgs", ")", "(", "reply", "*", "AddScriptToEvaluateOnLoadReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "AddScriptToEvaluateOnLoadReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// AddScriptToEvaluateOnLoad invokes the Page method. Deprecated, please use // addScriptToEvaluateOnNewDocument instead.
[ "AddScriptToEvaluateOnLoad", "invokes", "the", "Page", "method", ".", "Deprecated", "please", "use", "addScriptToEvaluateOnNewDocument", "instead", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L25-L36
19,254
mafredri/cdp
protocol/page/domain.go
CaptureScreenshot
func (d *domainClient) CaptureScreenshot(ctx context.Context, args *CaptureScreenshotArgs) (reply *CaptureScreenshotReply, err error) { reply = new(CaptureScreenshotReply) if args != nil { err = rpcc.Invoke(ctx, "Page.captureScreenshot", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.captureScreenshot", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "CaptureScreenshot", Err: err} } return }
go
func (d *domainClient) CaptureScreenshot(ctx context.Context, args *CaptureScreenshotArgs) (reply *CaptureScreenshotReply, err error) { reply = new(CaptureScreenshotReply) if args != nil { err = rpcc.Invoke(ctx, "Page.captureScreenshot", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.captureScreenshot", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "CaptureScreenshot", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "CaptureScreenshot", "(", "ctx", "context", ".", "Context", ",", "args", "*", "CaptureScreenshotArgs", ")", "(", "reply", "*", "CaptureScreenshotReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "CaptureScreenshotReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// CaptureScreenshot invokes the Page method. Capture page screenshot.
[ "CaptureScreenshot", "invokes", "the", "Page", "method", ".", "Capture", "page", "screenshot", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L63-L74
19,255
mafredri/cdp
protocol/page/domain.go
CreateIsolatedWorld
func (d *domainClient) CreateIsolatedWorld(ctx context.Context, args *CreateIsolatedWorldArgs) (reply *CreateIsolatedWorldReply, err error) { reply = new(CreateIsolatedWorldReply) if args != nil { err = rpcc.Invoke(ctx, "Page.createIsolatedWorld", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.createIsolatedWorld", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "CreateIsolatedWorld", Err: err} } return }
go
func (d *domainClient) CreateIsolatedWorld(ctx context.Context, args *CreateIsolatedWorldArgs) (reply *CreateIsolatedWorldReply, err error) { reply = new(CreateIsolatedWorldReply) if args != nil { err = rpcc.Invoke(ctx, "Page.createIsolatedWorld", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.createIsolatedWorld", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "CreateIsolatedWorld", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "CreateIsolatedWorld", "(", "ctx", "context", ".", "Context", ",", "args", "*", "CreateIsolatedWorldArgs", ")", "(", "reply", "*", "CreateIsolatedWorldReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "CreateIsolatedWorldReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// CreateIsolatedWorld invokes the Page method. Creates an isolated world for // the given frame.
[ "CreateIsolatedWorld", "invokes", "the", "Page", "method", ".", "Creates", "an", "isolated", "world", "for", "the", "given", "frame", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L94-L105
19,256
mafredri/cdp
protocol/page/domain.go
GetResourceContent
func (d *domainClient) GetResourceContent(ctx context.Context, args *GetResourceContentArgs) (reply *GetResourceContentReply, err error) { reply = new(GetResourceContentReply) if args != nil { err = rpcc.Invoke(ctx, "Page.getResourceContent", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.getResourceContent", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "GetResourceContent", Err: err} } return }
go
func (d *domainClient) GetResourceContent(ctx context.Context, args *GetResourceContentArgs) (reply *GetResourceContentReply, err error) { reply = new(GetResourceContentReply) if args != nil { err = rpcc.Invoke(ctx, "Page.getResourceContent", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.getResourceContent", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "GetResourceContent", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetResourceContent", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetResourceContentArgs", ")", "(", "reply", "*", "GetResourceContentReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetResourceContentReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetResourceContent invokes the Page method. Returns content of the given // resource.
[ "GetResourceContent", "invokes", "the", "Page", "method", ".", "Returns", "content", "of", "the", "given", "resource", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L189-L200
19,257
mafredri/cdp
protocol/page/domain.go
Navigate
func (d *domainClient) Navigate(ctx context.Context, args *NavigateArgs) (reply *NavigateReply, err error) { reply = new(NavigateReply) if args != nil { err = rpcc.Invoke(ctx, "Page.navigate", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.navigate", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "Navigate", Err: err} } return }
go
func (d *domainClient) Navigate(ctx context.Context, args *NavigateArgs) (reply *NavigateReply, err error) { reply = new(NavigateReply) if args != nil { err = rpcc.Invoke(ctx, "Page.navigate", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.navigate", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "Navigate", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "Navigate", "(", "ctx", "context", ".", "Context", ",", "args", "*", "NavigateArgs", ")", "(", "reply", "*", "NavigateReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "NavigateReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// Navigate invokes the Page method. Navigates current page to the given URL.
[ "Navigate", "invokes", "the", "Page", "method", ".", "Navigates", "current", "page", "to", "the", "given", "URL", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L228-L239
19,258
mafredri/cdp
protocol/page/domain.go
PrintToPDF
func (d *domainClient) PrintToPDF(ctx context.Context, args *PrintToPDFArgs) (reply *PrintToPDFReply, err error) { reply = new(PrintToPDFReply) if args != nil { err = rpcc.Invoke(ctx, "Page.printToPDF", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.printToPDF", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "PrintToPDF", Err: err} } return }
go
func (d *domainClient) PrintToPDF(ctx context.Context, args *PrintToPDFArgs) (reply *PrintToPDFReply, err error) { reply = new(PrintToPDFReply) if args != nil { err = rpcc.Invoke(ctx, "Page.printToPDF", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.printToPDF", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "PrintToPDF", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "PrintToPDF", "(", "ctx", "context", ".", "Context", ",", "args", "*", "PrintToPDFArgs", ")", "(", "reply", "*", "PrintToPDFReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "PrintToPDFReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// PrintToPDF invokes the Page method. Print page as PDF.
[ "PrintToPDF", "invokes", "the", "Page", "method", ".", "Print", "page", "as", "PDF", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L256-L267
19,259
mafredri/cdp
protocol/page/domain.go
SearchInResource
func (d *domainClient) SearchInResource(ctx context.Context, args *SearchInResourceArgs) (reply *SearchInResourceReply, err error) { reply = new(SearchInResourceReply) if args != nil { err = rpcc.Invoke(ctx, "Page.searchInResource", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.searchInResource", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "SearchInResource", Err: err} } return }
go
func (d *domainClient) SearchInResource(ctx context.Context, args *SearchInResourceArgs) (reply *SearchInResourceReply, err error) { reply = new(SearchInResourceReply) if args != nil { err = rpcc.Invoke(ctx, "Page.searchInResource", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Page.searchInResource", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Page", Op: "SearchInResource", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "SearchInResource", "(", "ctx", "context", ".", "Context", ",", "args", "*", "SearchInResourceArgs", ")", "(", "reply", "*", "SearchInResourceReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "SearchInResourceReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// SearchInResource invokes the Page method. Searches for given string in // resource content.
[ "SearchInResource", "invokes", "the", "Page", "method", ".", "Searches", "for", "given", "string", "in", "resource", "content", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/page/domain.go#L327-L338
19,260
mafredri/cdp
devtool/devtool.go
WithClient
func WithClient(client *http.Client) DevToolsOption { return func(d *DevTools) { d.client = client } }
go
func WithClient(client *http.Client) DevToolsOption { return func(d *DevTools) { d.client = client } }
[ "func", "WithClient", "(", "client", "*", "http", ".", "Client", ")", "DevToolsOption", "{", "return", "func", "(", "d", "*", "DevTools", ")", "{", "d", ".", "client", "=", "client", "\n", "}", "\n", "}" ]
// WithClient returns a DevToolsOption that sets the http Client used // for HTTP GET requests.
[ "WithClient", "returns", "a", "DevToolsOption", "that", "sets", "the", "http", "Client", "used", "for", "HTTP", "GET", "requests", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L22-L26
19,261
mafredri/cdp
devtool/devtool.go
New
func New(url string, opts ...DevToolsOption) *DevTools { devtools := &DevTools{url: url} for _, o := range opts { o(devtools) } if devtools.client == nil { devtools.client = &http.Client{} } return devtools }
go
func New(url string, opts ...DevToolsOption) *DevTools { devtools := &DevTools{url: url} for _, o := range opts { o(devtools) } if devtools.client == nil { devtools.client = &http.Client{} } return devtools }
[ "func", "New", "(", "url", "string", ",", "opts", "...", "DevToolsOption", ")", "*", "DevTools", "{", "devtools", ":=", "&", "DevTools", "{", "url", ":", "url", "}", "\n", "for", "_", ",", "o", ":=", "range", "opts", "{", "o", "(", "devtools", ")", "\n", "}", "\n", "if", "devtools", ".", "client", "==", "nil", "{", "devtools", ".", "client", "=", "&", "http", ".", "Client", "{", "}", "\n", "}", "\n", "return", "devtools", "\n", "}" ]
// New returns a DevTools instance that uses URL.
[ "New", "returns", "a", "DevTools", "instance", "that", "uses", "URL", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L39-L48
19,262
mafredri/cdp
devtool/devtool.go
Get
func (d *DevTools) Get(ctx context.Context, typ Type) (*Target, error) { list, err := d.List(ctx) if err != nil { return nil, err } for _, t := range list { if t.Type == typ { return t, nil } } return nil, errors.New("devtool: Get: could not find target of type: " + string(typ)) }
go
func (d *DevTools) Get(ctx context.Context, typ Type) (*Target, error) { list, err := d.List(ctx) if err != nil { return nil, err } for _, t := range list { if t.Type == typ { return t, nil } } return nil, errors.New("devtool: Get: could not find target of type: " + string(typ)) }
[ "func", "(", "d", "*", "DevTools", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "typ", "Type", ")", "(", "*", "Target", ",", "error", ")", "{", "list", ",", "err", ":=", "d", ".", "List", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "for", "_", ",", "t", ":=", "range", "list", "{", "if", "t", ".", "Type", "==", "typ", "{", "return", "t", ",", "nil", "\n", "}", "\n", "}", "\n\n", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", "+", "string", "(", "typ", ")", ")", "\n", "}" ]
// Get the first Target that matches Type.
[ "Get", "the", "first", "Target", "that", "matches", "Type", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L124-L137
19,263
mafredri/cdp
devtool/devtool.go
List
func (d *DevTools) List(ctx context.Context) ([]*Target, error) { resp, err := d.httpGet(ctx, "/json/list") if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, parseError("List", resp.Body) } var t []*Target return t, json.NewDecoder(resp.Body).Decode(&t) }
go
func (d *DevTools) List(ctx context.Context) ([]*Target, error) { resp, err := d.httpGet(ctx, "/json/list") if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, parseError("List", resp.Body) } var t []*Target return t, json.NewDecoder(resp.Body).Decode(&t) }
[ "func", "(", "d", "*", "DevTools", ")", "List", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "*", "Target", ",", "error", ")", "{", "resp", ",", "err", ":=", "d", ".", "httpGet", "(", "ctx", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n\n", "if", "resp", ".", "StatusCode", "!=", "http", ".", "StatusOK", "{", "return", "nil", ",", "parseError", "(", "\"", "\"", ",", "resp", ".", "Body", ")", "\n", "}", "\n\n", "var", "t", "[", "]", "*", "Target", "\n", "return", "t", ",", "json", ".", "NewDecoder", "(", "resp", ".", "Body", ")", ".", "Decode", "(", "&", "t", ")", "\n", "}" ]
// List returns a list with all devtools Targets.
[ "List", "returns", "a", "list", "with", "all", "devtools", "Targets", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L140-L153
19,264
mafredri/cdp
devtool/devtool.go
Activate
func (d *DevTools) Activate(ctx context.Context, t *Target) error { resp, err := d.httpGet(ctx, "/json/activate/"+t.ID) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return parseError("Activate", resp.Body) } return nil }
go
func (d *DevTools) Activate(ctx context.Context, t *Target) error { resp, err := d.httpGet(ctx, "/json/activate/"+t.ID) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return parseError("Activate", resp.Body) } return nil }
[ "func", "(", "d", "*", "DevTools", ")", "Activate", "(", "ctx", "context", ".", "Context", ",", "t", "*", "Target", ")", "error", "{", "resp", ",", "err", ":=", "d", ".", "httpGet", "(", "ctx", ",", "\"", "\"", "+", "t", ".", "ID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n\n", "if", "resp", ".", "StatusCode", "!=", "http", ".", "StatusOK", "{", "return", "parseError", "(", "\"", "\"", ",", "resp", ".", "Body", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Activate brings focus to the Target.
[ "Activate", "brings", "focus", "to", "the", "Target", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L156-L168
19,265
mafredri/cdp
devtool/devtool.go
Version
func (d *DevTools) Version(ctx context.Context) (*Version, error) { resp, err := d.httpGet(ctx, "/json/version") if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, parseError("Version", resp.Body) } v := new(Version) return v, json.NewDecoder(resp.Body).Decode(&v) }
go
func (d *DevTools) Version(ctx context.Context) (*Version, error) { resp, err := d.httpGet(ctx, "/json/version") if err != nil { return nil, err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return nil, parseError("Version", resp.Body) } v := new(Version) return v, json.NewDecoder(resp.Body).Decode(&v) }
[ "func", "(", "d", "*", "DevTools", ")", "Version", "(", "ctx", "context", ".", "Context", ")", "(", "*", "Version", ",", "error", ")", "{", "resp", ",", "err", ":=", "d", ".", "httpGet", "(", "ctx", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n\n", "if", "resp", ".", "StatusCode", "!=", "http", ".", "StatusOK", "{", "return", "nil", ",", "parseError", "(", "\"", "\"", ",", "resp", ".", "Body", ")", "\n", "}", "\n\n", "v", ":=", "new", "(", "Version", ")", "\n", "return", "v", ",", "json", ".", "NewDecoder", "(", "resp", ".", "Body", ")", ".", "Decode", "(", "&", "v", ")", "\n", "}" ]
// Version returns the version information for the DevTools endpoint.
[ "Version", "returns", "the", "version", "information", "for", "the", "DevTools", "endpoint", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/devtool/devtool.go#L204-L217
19,266
mafredri/cdp
protocol/css/command.go
NewAddRuleArgs
func NewAddRuleArgs(styleSheetID StyleSheetID, ruleText string, location SourceRange) *AddRuleArgs { args := new(AddRuleArgs) args.StyleSheetID = styleSheetID args.RuleText = ruleText args.Location = location return args }
go
func NewAddRuleArgs(styleSheetID StyleSheetID, ruleText string, location SourceRange) *AddRuleArgs { args := new(AddRuleArgs) args.StyleSheetID = styleSheetID args.RuleText = ruleText args.Location = location return args }
[ "func", "NewAddRuleArgs", "(", "styleSheetID", "StyleSheetID", ",", "ruleText", "string", ",", "location", "SourceRange", ")", "*", "AddRuleArgs", "{", "args", ":=", "new", "(", "AddRuleArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "args", ".", "RuleText", "=", "ruleText", "\n", "args", ".", "Location", "=", "location", "\n", "return", "args", "\n", "}" ]
// NewAddRuleArgs initializes AddRuleArgs with the required arguments.
[ "NewAddRuleArgs", "initializes", "AddRuleArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L18-L24
19,267
mafredri/cdp
protocol/css/command.go
NewCollectClassNamesArgs
func NewCollectClassNamesArgs(styleSheetID StyleSheetID) *CollectClassNamesArgs { args := new(CollectClassNamesArgs) args.StyleSheetID = styleSheetID return args }
go
func NewCollectClassNamesArgs(styleSheetID StyleSheetID) *CollectClassNamesArgs { args := new(CollectClassNamesArgs) args.StyleSheetID = styleSheetID return args }
[ "func", "NewCollectClassNamesArgs", "(", "styleSheetID", "StyleSheetID", ")", "*", "CollectClassNamesArgs", "{", "args", ":=", "new", "(", "CollectClassNamesArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "return", "args", "\n", "}" ]
// NewCollectClassNamesArgs initializes CollectClassNamesArgs with the required arguments.
[ "NewCollectClassNamesArgs", "initializes", "CollectClassNamesArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L37-L41
19,268
mafredri/cdp
protocol/css/command.go
NewCreateStyleSheetArgs
func NewCreateStyleSheetArgs(frameID page.FrameID) *CreateStyleSheetArgs { args := new(CreateStyleSheetArgs) args.FrameID = frameID return args }
go
func NewCreateStyleSheetArgs(frameID page.FrameID) *CreateStyleSheetArgs { args := new(CreateStyleSheetArgs) args.FrameID = frameID return args }
[ "func", "NewCreateStyleSheetArgs", "(", "frameID", "page", ".", "FrameID", ")", "*", "CreateStyleSheetArgs", "{", "args", ":=", "new", "(", "CreateStyleSheetArgs", ")", "\n", "args", ".", "FrameID", "=", "frameID", "\n", "return", "args", "\n", "}" ]
// NewCreateStyleSheetArgs initializes CreateStyleSheetArgs with the required arguments.
[ "NewCreateStyleSheetArgs", "initializes", "CreateStyleSheetArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L54-L58
19,269
mafredri/cdp
protocol/css/command.go
NewForcePseudoStateArgs
func NewForcePseudoStateArgs(nodeID dom.NodeID, forcedPseudoClasses []string) *ForcePseudoStateArgs { args := new(ForcePseudoStateArgs) args.NodeID = nodeID args.ForcedPseudoClasses = forcedPseudoClasses return args }
go
func NewForcePseudoStateArgs(nodeID dom.NodeID, forcedPseudoClasses []string) *ForcePseudoStateArgs { args := new(ForcePseudoStateArgs) args.NodeID = nodeID args.ForcedPseudoClasses = forcedPseudoClasses return args }
[ "func", "NewForcePseudoStateArgs", "(", "nodeID", "dom", ".", "NodeID", ",", "forcedPseudoClasses", "[", "]", "string", ")", "*", "ForcePseudoStateArgs", "{", "args", ":=", "new", "(", "ForcePseudoStateArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "args", ".", "ForcedPseudoClasses", "=", "forcedPseudoClasses", "\n", "return", "args", "\n", "}" ]
// NewForcePseudoStateArgs initializes ForcePseudoStateArgs with the required arguments.
[ "NewForcePseudoStateArgs", "initializes", "ForcePseudoStateArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L72-L77
19,270
mafredri/cdp
protocol/css/command.go
NewGetBackgroundColorsArgs
func NewGetBackgroundColorsArgs(nodeID dom.NodeID) *GetBackgroundColorsArgs { args := new(GetBackgroundColorsArgs) args.NodeID = nodeID return args }
go
func NewGetBackgroundColorsArgs(nodeID dom.NodeID) *GetBackgroundColorsArgs { args := new(GetBackgroundColorsArgs) args.NodeID = nodeID return args }
[ "func", "NewGetBackgroundColorsArgs", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetBackgroundColorsArgs", "{", "args", ":=", "new", "(", "GetBackgroundColorsArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "return", "args", "\n", "}" ]
// NewGetBackgroundColorsArgs initializes GetBackgroundColorsArgs with the required arguments.
[ "NewGetBackgroundColorsArgs", "initializes", "GetBackgroundColorsArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L85-L89
19,271
mafredri/cdp
protocol/css/command.go
NewGetComputedStyleForNodeArgs
func NewGetComputedStyleForNodeArgs(nodeID dom.NodeID) *GetComputedStyleForNodeArgs { args := new(GetComputedStyleForNodeArgs) args.NodeID = nodeID return args }
go
func NewGetComputedStyleForNodeArgs(nodeID dom.NodeID) *GetComputedStyleForNodeArgs { args := new(GetComputedStyleForNodeArgs) args.NodeID = nodeID return args }
[ "func", "NewGetComputedStyleForNodeArgs", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetComputedStyleForNodeArgs", "{", "args", ":=", "new", "(", "GetComputedStyleForNodeArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "return", "args", "\n", "}" ]
// NewGetComputedStyleForNodeArgs initializes GetComputedStyleForNodeArgs with the required arguments.
[ "NewGetComputedStyleForNodeArgs", "initializes", "GetComputedStyleForNodeArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L104-L108
19,272
mafredri/cdp
protocol/css/command.go
NewGetInlineStylesForNodeArgs
func NewGetInlineStylesForNodeArgs(nodeID dom.NodeID) *GetInlineStylesForNodeArgs { args := new(GetInlineStylesForNodeArgs) args.NodeID = nodeID return args }
go
func NewGetInlineStylesForNodeArgs(nodeID dom.NodeID) *GetInlineStylesForNodeArgs { args := new(GetInlineStylesForNodeArgs) args.NodeID = nodeID return args }
[ "func", "NewGetInlineStylesForNodeArgs", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetInlineStylesForNodeArgs", "{", "args", ":=", "new", "(", "GetInlineStylesForNodeArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "return", "args", "\n", "}" ]
// NewGetInlineStylesForNodeArgs initializes GetInlineStylesForNodeArgs with the required arguments.
[ "NewGetInlineStylesForNodeArgs", "initializes", "GetInlineStylesForNodeArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L121-L125
19,273
mafredri/cdp
protocol/css/command.go
NewGetMatchedStylesForNodeArgs
func NewGetMatchedStylesForNodeArgs(nodeID dom.NodeID) *GetMatchedStylesForNodeArgs { args := new(GetMatchedStylesForNodeArgs) args.NodeID = nodeID return args }
go
func NewGetMatchedStylesForNodeArgs(nodeID dom.NodeID) *GetMatchedStylesForNodeArgs { args := new(GetMatchedStylesForNodeArgs) args.NodeID = nodeID return args }
[ "func", "NewGetMatchedStylesForNodeArgs", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetMatchedStylesForNodeArgs", "{", "args", ":=", "new", "(", "GetMatchedStylesForNodeArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "return", "args", "\n", "}" ]
// NewGetMatchedStylesForNodeArgs initializes GetMatchedStylesForNodeArgs with the required arguments.
[ "NewGetMatchedStylesForNodeArgs", "initializes", "GetMatchedStylesForNodeArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L139-L143
19,274
mafredri/cdp
protocol/css/command.go
NewGetPlatformFontsForNodeArgs
func NewGetPlatformFontsForNodeArgs(nodeID dom.NodeID) *GetPlatformFontsForNodeArgs { args := new(GetPlatformFontsForNodeArgs) args.NodeID = nodeID return args }
go
func NewGetPlatformFontsForNodeArgs(nodeID dom.NodeID) *GetPlatformFontsForNodeArgs { args := new(GetPlatformFontsForNodeArgs) args.NodeID = nodeID return args }
[ "func", "NewGetPlatformFontsForNodeArgs", "(", "nodeID", "dom", ".", "NodeID", ")", "*", "GetPlatformFontsForNodeArgs", "{", "args", ":=", "new", "(", "GetPlatformFontsForNodeArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "return", "args", "\n", "}" ]
// NewGetPlatformFontsForNodeArgs initializes GetPlatformFontsForNodeArgs with the required arguments.
[ "NewGetPlatformFontsForNodeArgs", "initializes", "GetPlatformFontsForNodeArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L166-L170
19,275
mafredri/cdp
protocol/css/command.go
NewGetStyleSheetTextArgs
func NewGetStyleSheetTextArgs(styleSheetID StyleSheetID) *GetStyleSheetTextArgs { args := new(GetStyleSheetTextArgs) args.StyleSheetID = styleSheetID return args }
go
func NewGetStyleSheetTextArgs(styleSheetID StyleSheetID) *GetStyleSheetTextArgs { args := new(GetStyleSheetTextArgs) args.StyleSheetID = styleSheetID return args }
[ "func", "NewGetStyleSheetTextArgs", "(", "styleSheetID", "StyleSheetID", ")", "*", "GetStyleSheetTextArgs", "{", "args", ":=", "new", "(", "GetStyleSheetTextArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "return", "args", "\n", "}" ]
// NewGetStyleSheetTextArgs initializes GetStyleSheetTextArgs with the required arguments.
[ "NewGetStyleSheetTextArgs", "initializes", "GetStyleSheetTextArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L183-L187
19,276
mafredri/cdp
protocol/css/command.go
NewSetEffectivePropertyValueForNodeArgs
func NewSetEffectivePropertyValueForNodeArgs(nodeID dom.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeArgs { args := new(SetEffectivePropertyValueForNodeArgs) args.NodeID = nodeID args.PropertyName = propertyName args.Value = value return args }
go
func NewSetEffectivePropertyValueForNodeArgs(nodeID dom.NodeID, propertyName string, value string) *SetEffectivePropertyValueForNodeArgs { args := new(SetEffectivePropertyValueForNodeArgs) args.NodeID = nodeID args.PropertyName = propertyName args.Value = value return args }
[ "func", "NewSetEffectivePropertyValueForNodeArgs", "(", "nodeID", "dom", ".", "NodeID", ",", "propertyName", "string", ",", "value", "string", ")", "*", "SetEffectivePropertyValueForNodeArgs", "{", "args", ":=", "new", "(", "SetEffectivePropertyValueForNodeArgs", ")", "\n", "args", ".", "NodeID", "=", "nodeID", "\n", "args", ".", "PropertyName", "=", "propertyName", "\n", "args", ".", "Value", "=", "value", "\n", "return", "args", "\n", "}" ]
// NewSetEffectivePropertyValueForNodeArgs initializes SetEffectivePropertyValueForNodeArgs with the required arguments.
[ "NewSetEffectivePropertyValueForNodeArgs", "initializes", "SetEffectivePropertyValueForNodeArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L202-L208
19,277
mafredri/cdp
protocol/css/command.go
NewSetKeyframeKeyArgs
func NewSetKeyframeKeyArgs(styleSheetID StyleSheetID, rang SourceRange, keyText string) *SetKeyframeKeyArgs { args := new(SetKeyframeKeyArgs) args.StyleSheetID = styleSheetID args.Range = rang args.KeyText = keyText return args }
go
func NewSetKeyframeKeyArgs(styleSheetID StyleSheetID, rang SourceRange, keyText string) *SetKeyframeKeyArgs { args := new(SetKeyframeKeyArgs) args.StyleSheetID = styleSheetID args.Range = rang args.KeyText = keyText return args }
[ "func", "NewSetKeyframeKeyArgs", "(", "styleSheetID", "StyleSheetID", ",", "rang", "SourceRange", ",", "keyText", "string", ")", "*", "SetKeyframeKeyArgs", "{", "args", ":=", "new", "(", "SetKeyframeKeyArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "args", ".", "Range", "=", "rang", "\n", "args", ".", "KeyText", "=", "keyText", "\n", "return", "args", "\n", "}" ]
// NewSetKeyframeKeyArgs initializes SetKeyframeKeyArgs with the required arguments.
[ "NewSetKeyframeKeyArgs", "initializes", "SetKeyframeKeyArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L218-L224
19,278
mafredri/cdp
protocol/css/command.go
NewSetMediaTextArgs
func NewSetMediaTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetMediaTextArgs { args := new(SetMediaTextArgs) args.StyleSheetID = styleSheetID args.Range = rang args.Text = text return args }
go
func NewSetMediaTextArgs(styleSheetID StyleSheetID, rang SourceRange, text string) *SetMediaTextArgs { args := new(SetMediaTextArgs) args.StyleSheetID = styleSheetID args.Range = rang args.Text = text return args }
[ "func", "NewSetMediaTextArgs", "(", "styleSheetID", "StyleSheetID", ",", "rang", "SourceRange", ",", "text", "string", ")", "*", "SetMediaTextArgs", "{", "args", ":=", "new", "(", "SetMediaTextArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "args", ".", "Range", "=", "rang", "\n", "args", ".", "Text", "=", "text", "\n", "return", "args", "\n", "}" ]
// NewSetMediaTextArgs initializes SetMediaTextArgs with the required arguments.
[ "NewSetMediaTextArgs", "initializes", "SetMediaTextArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L239-L245
19,279
mafredri/cdp
protocol/css/command.go
NewSetRuleSelectorArgs
func NewSetRuleSelectorArgs(styleSheetID StyleSheetID, rang SourceRange, selector string) *SetRuleSelectorArgs { args := new(SetRuleSelectorArgs) args.StyleSheetID = styleSheetID args.Range = rang args.Selector = selector return args }
go
func NewSetRuleSelectorArgs(styleSheetID StyleSheetID, rang SourceRange, selector string) *SetRuleSelectorArgs { args := new(SetRuleSelectorArgs) args.StyleSheetID = styleSheetID args.Range = rang args.Selector = selector return args }
[ "func", "NewSetRuleSelectorArgs", "(", "styleSheetID", "StyleSheetID", ",", "rang", "SourceRange", ",", "selector", "string", ")", "*", "SetRuleSelectorArgs", "{", "args", ":=", "new", "(", "SetRuleSelectorArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "args", ".", "Range", "=", "rang", "\n", "args", ".", "Selector", "=", "selector", "\n", "return", "args", "\n", "}" ]
// NewSetRuleSelectorArgs initializes SetRuleSelectorArgs with the required arguments.
[ "NewSetRuleSelectorArgs", "initializes", "SetRuleSelectorArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L260-L266
19,280
mafredri/cdp
protocol/css/command.go
NewSetStyleSheetTextArgs
func NewSetStyleSheetTextArgs(styleSheetID StyleSheetID, text string) *SetStyleSheetTextArgs { args := new(SetStyleSheetTextArgs) args.StyleSheetID = styleSheetID args.Text = text return args }
go
func NewSetStyleSheetTextArgs(styleSheetID StyleSheetID, text string) *SetStyleSheetTextArgs { args := new(SetStyleSheetTextArgs) args.StyleSheetID = styleSheetID args.Text = text return args }
[ "func", "NewSetStyleSheetTextArgs", "(", "styleSheetID", "StyleSheetID", ",", "text", "string", ")", "*", "SetStyleSheetTextArgs", "{", "args", ":=", "new", "(", "SetStyleSheetTextArgs", ")", "\n", "args", ".", "StyleSheetID", "=", "styleSheetID", "\n", "args", ".", "Text", "=", "text", "\n", "return", "args", "\n", "}" ]
// NewSetStyleSheetTextArgs initializes SetStyleSheetTextArgs with the required arguments.
[ "NewSetStyleSheetTextArgs", "initializes", "SetStyleSheetTextArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L280-L285
19,281
mafredri/cdp
protocol/css/command.go
NewSetStyleTextsArgs
func NewSetStyleTextsArgs(edits []StyleDeclarationEdit) *SetStyleTextsArgs { args := new(SetStyleTextsArgs) args.Edits = edits return args }
go
func NewSetStyleTextsArgs(edits []StyleDeclarationEdit) *SetStyleTextsArgs { args := new(SetStyleTextsArgs) args.Edits = edits return args }
[ "func", "NewSetStyleTextsArgs", "(", "edits", "[", "]", "StyleDeclarationEdit", ")", "*", "SetStyleTextsArgs", "{", "args", ":=", "new", "(", "SetStyleTextsArgs", ")", "\n", "args", ".", "Edits", "=", "edits", "\n", "return", "args", "\n", "}" ]
// NewSetStyleTextsArgs initializes SetStyleTextsArgs with the required arguments.
[ "NewSetStyleTextsArgs", "initializes", "SetStyleTextsArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/css/command.go#L298-L302
19,282
mafredri/cdp
protocol/browser/domain.go
GetHistograms
func (d *domainClient) GetHistograms(ctx context.Context, args *GetHistogramsArgs) (reply *GetHistogramsReply, err error) { reply = new(GetHistogramsReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getHistograms", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getHistograms", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetHistograms", Err: err} } return }
go
func (d *domainClient) GetHistograms(ctx context.Context, args *GetHistogramsArgs) (reply *GetHistogramsReply, err error) { reply = new(GetHistogramsReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getHistograms", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getHistograms", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetHistograms", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetHistograms", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetHistogramsArgs", ")", "(", "reply", "*", "GetHistogramsReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetHistogramsReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetHistograms invokes the Browser method. Get Chrome histograms.
[ "GetHistograms", "invokes", "the", "Browser", "method", ".", "Get", "Chrome", "histograms", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/domain.go#L101-L112
19,283
mafredri/cdp
protocol/browser/domain.go
GetHistogram
func (d *domainClient) GetHistogram(ctx context.Context, args *GetHistogramArgs) (reply *GetHistogramReply, err error) { reply = new(GetHistogramReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getHistogram", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getHistogram", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetHistogram", Err: err} } return }
go
func (d *domainClient) GetHistogram(ctx context.Context, args *GetHistogramArgs) (reply *GetHistogramReply, err error) { reply = new(GetHistogramReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getHistogram", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getHistogram", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetHistogram", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetHistogram", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetHistogramArgs", ")", "(", "reply", "*", "GetHistogramReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetHistogramReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetHistogram invokes the Browser method. Get a Chrome histogram by name.
[ "GetHistogram", "invokes", "the", "Browser", "method", ".", "Get", "a", "Chrome", "histogram", "by", "name", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/domain.go#L115-L126
19,284
mafredri/cdp
protocol/browser/domain.go
GetWindowBounds
func (d *domainClient) GetWindowBounds(ctx context.Context, args *GetWindowBoundsArgs) (reply *GetWindowBoundsReply, err error) { reply = new(GetWindowBoundsReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getWindowBounds", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getWindowBounds", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetWindowBounds", Err: err} } return }
go
func (d *domainClient) GetWindowBounds(ctx context.Context, args *GetWindowBoundsArgs) (reply *GetWindowBoundsReply, err error) { reply = new(GetWindowBoundsReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getWindowBounds", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getWindowBounds", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetWindowBounds", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetWindowBounds", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetWindowBoundsArgs", ")", "(", "reply", "*", "GetWindowBoundsReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetWindowBoundsReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetWindowBounds invokes the Browser method. Get position and size of the // browser window.
[ "GetWindowBounds", "invokes", "the", "Browser", "method", ".", "Get", "position", "and", "size", "of", "the", "browser", "window", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/domain.go#L130-L141
19,285
mafredri/cdp
protocol/browser/domain.go
GetWindowForTarget
func (d *domainClient) GetWindowForTarget(ctx context.Context, args *GetWindowForTargetArgs) (reply *GetWindowForTargetReply, err error) { reply = new(GetWindowForTargetReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getWindowForTarget", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getWindowForTarget", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetWindowForTarget", Err: err} } return }
go
func (d *domainClient) GetWindowForTarget(ctx context.Context, args *GetWindowForTargetArgs) (reply *GetWindowForTargetReply, err error) { reply = new(GetWindowForTargetReply) if args != nil { err = rpcc.Invoke(ctx, "Browser.getWindowForTarget", args, reply, d.conn) } else { err = rpcc.Invoke(ctx, "Browser.getWindowForTarget", nil, reply, d.conn) } if err != nil { err = &internal.OpError{Domain: "Browser", Op: "GetWindowForTarget", Err: err} } return }
[ "func", "(", "d", "*", "domainClient", ")", "GetWindowForTarget", "(", "ctx", "context", ".", "Context", ",", "args", "*", "GetWindowForTargetArgs", ")", "(", "reply", "*", "GetWindowForTargetReply", ",", "err", "error", ")", "{", "reply", "=", "new", "(", "GetWindowForTargetReply", ")", "\n", "if", "args", "!=", "nil", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "args", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "else", "{", "err", "=", "rpcc", ".", "Invoke", "(", "ctx", ",", "\"", "\"", ",", "nil", ",", "reply", ",", "d", ".", "conn", ")", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "err", "=", "&", "internal", ".", "OpError", "{", "Domain", ":", "\"", "\"", ",", "Op", ":", "\"", "\"", ",", "Err", ":", "err", "}", "\n", "}", "\n", "return", "\n", "}" ]
// GetWindowForTarget invokes the Browser method. Get the browser window that // contains the devtools target.
[ "GetWindowForTarget", "invokes", "the", "Browser", "method", ".", "Get", "the", "browser", "window", "that", "contains", "the", "devtools", "target", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/browser/domain.go#L145-L156
19,286
mafredri/cdp
protocol/tethering/command.go
NewBindArgs
func NewBindArgs(port int) *BindArgs { args := new(BindArgs) args.Port = port return args }
go
func NewBindArgs(port int) *BindArgs { args := new(BindArgs) args.Port = port return args }
[ "func", "NewBindArgs", "(", "port", "int", ")", "*", "BindArgs", "{", "args", ":=", "new", "(", "BindArgs", ")", "\n", "args", ".", "Port", "=", "port", "\n", "return", "args", "\n", "}" ]
// NewBindArgs initializes BindArgs with the required arguments.
[ "NewBindArgs", "initializes", "BindArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/tethering/command.go#L11-L15
19,287
mafredri/cdp
protocol/tethering/command.go
NewUnbindArgs
func NewUnbindArgs(port int) *UnbindArgs { args := new(UnbindArgs) args.Port = port return args }
go
func NewUnbindArgs(port int) *UnbindArgs { args := new(UnbindArgs) args.Port = port return args }
[ "func", "NewUnbindArgs", "(", "port", "int", ")", "*", "UnbindArgs", "{", "args", ":=", "new", "(", "UnbindArgs", ")", "\n", "args", ".", "Port", "=", "port", "\n", "return", "args", "\n", "}" ]
// NewUnbindArgs initializes UnbindArgs with the required arguments.
[ "NewUnbindArgs", "initializes", "UnbindArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/tethering/command.go#L23-L27
19,288
mafredri/cdp
protocol/heapprofiler/command.go
NewAddInspectedHeapObjectArgs
func NewAddInspectedHeapObjectArgs(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectArgs { args := new(AddInspectedHeapObjectArgs) args.HeapObjectID = heapObjectID return args }
go
func NewAddInspectedHeapObjectArgs(heapObjectID HeapSnapshotObjectID) *AddInspectedHeapObjectArgs { args := new(AddInspectedHeapObjectArgs) args.HeapObjectID = heapObjectID return args }
[ "func", "NewAddInspectedHeapObjectArgs", "(", "heapObjectID", "HeapSnapshotObjectID", ")", "*", "AddInspectedHeapObjectArgs", "{", "args", ":=", "new", "(", "AddInspectedHeapObjectArgs", ")", "\n", "args", ".", "HeapObjectID", "=", "heapObjectID", "\n", "return", "args", "\n", "}" ]
// NewAddInspectedHeapObjectArgs initializes AddInspectedHeapObjectArgs with the required arguments.
[ "NewAddInspectedHeapObjectArgs", "initializes", "AddInspectedHeapObjectArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L15-L19
19,289
mafredri/cdp
protocol/heapprofiler/command.go
NewGetHeapObjectIDArgs
func NewGetHeapObjectIDArgs(objectID runtime.RemoteObjectID) *GetHeapObjectIDArgs { args := new(GetHeapObjectIDArgs) args.ObjectID = objectID return args }
go
func NewGetHeapObjectIDArgs(objectID runtime.RemoteObjectID) *GetHeapObjectIDArgs { args := new(GetHeapObjectIDArgs) args.ObjectID = objectID return args }
[ "func", "NewGetHeapObjectIDArgs", "(", "objectID", "runtime", ".", "RemoteObjectID", ")", "*", "GetHeapObjectIDArgs", "{", "args", ":=", "new", "(", "GetHeapObjectIDArgs", ")", "\n", "args", ".", "ObjectID", "=", "objectID", "\n", "return", "args", "\n", "}" ]
// NewGetHeapObjectIDArgs initializes GetHeapObjectIDArgs with the required arguments.
[ "NewGetHeapObjectIDArgs", "initializes", "GetHeapObjectIDArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L27-L31
19,290
mafredri/cdp
protocol/heapprofiler/command.go
NewGetObjectByHeapObjectIDArgs
func NewGetObjectByHeapObjectIDArgs(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDArgs { args := new(GetObjectByHeapObjectIDArgs) args.ObjectID = objectID return args }
go
func NewGetObjectByHeapObjectIDArgs(objectID HeapSnapshotObjectID) *GetObjectByHeapObjectIDArgs { args := new(GetObjectByHeapObjectIDArgs) args.ObjectID = objectID return args }
[ "func", "NewGetObjectByHeapObjectIDArgs", "(", "objectID", "HeapSnapshotObjectID", ")", "*", "GetObjectByHeapObjectIDArgs", "{", "args", ":=", "new", "(", "GetObjectByHeapObjectIDArgs", ")", "\n", "args", ".", "ObjectID", "=", "objectID", "\n", "return", "args", "\n", "}" ]
// NewGetObjectByHeapObjectIDArgs initializes GetObjectByHeapObjectIDArgs with the required arguments.
[ "NewGetObjectByHeapObjectIDArgs", "initializes", "GetObjectByHeapObjectIDArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L45-L49
19,291
mafredri/cdp
protocol/heapprofiler/command.go
SetSamplingInterval
func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval float64) *StartSamplingArgs { a.SamplingInterval = &samplingInterval return a }
go
func (a *StartSamplingArgs) SetSamplingInterval(samplingInterval float64) *StartSamplingArgs { a.SamplingInterval = &samplingInterval return a }
[ "func", "(", "a", "*", "StartSamplingArgs", ")", "SetSamplingInterval", "(", "samplingInterval", "float64", ")", "*", "StartSamplingArgs", "{", "a", ".", "SamplingInterval", "=", "&", "samplingInterval", "\n", "return", "a", "\n", "}" ]
// SetSamplingInterval sets the SamplingInterval optional argument. // Average sample interval in bytes. Poisson distribution is used for // the intervals. The default value is 32768 bytes.
[ "SetSamplingInterval", "sets", "the", "SamplingInterval", "optional", "argument", ".", "Average", "sample", "interval", "in", "bytes", ".", "Poisson", "distribution", "is", "used", "for", "the", "intervals", ".", "The", "default", "value", "is", "32768", "bytes", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L83-L86
19,292
mafredri/cdp
protocol/heapprofiler/command.go
SetTrackAllocations
func (a *StartTrackingHeapObjectsArgs) SetTrackAllocations(trackAllocations bool) *StartTrackingHeapObjectsArgs { a.TrackAllocations = &trackAllocations return a }
go
func (a *StartTrackingHeapObjectsArgs) SetTrackAllocations(trackAllocations bool) *StartTrackingHeapObjectsArgs { a.TrackAllocations = &trackAllocations return a }
[ "func", "(", "a", "*", "StartTrackingHeapObjectsArgs", ")", "SetTrackAllocations", "(", "trackAllocations", "bool", ")", "*", "StartTrackingHeapObjectsArgs", "{", "a", ".", "TrackAllocations", "=", "&", "trackAllocations", "\n", "return", "a", "\n", "}" ]
// SetTrackAllocations sets the TrackAllocations optional argument.
[ "SetTrackAllocations", "sets", "the", "TrackAllocations", "optional", "argument", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L101-L104
19,293
mafredri/cdp
protocol/heapprofiler/command.go
SetReportProgress
func (a *StopTrackingHeapObjectsArgs) SetReportProgress(reportProgress bool) *StopTrackingHeapObjectsArgs { a.ReportProgress = &reportProgress return a }
go
func (a *StopTrackingHeapObjectsArgs) SetReportProgress(reportProgress bool) *StopTrackingHeapObjectsArgs { a.ReportProgress = &reportProgress return a }
[ "func", "(", "a", "*", "StopTrackingHeapObjectsArgs", ")", "SetReportProgress", "(", "reportProgress", "bool", ")", "*", "StopTrackingHeapObjectsArgs", "{", "a", ".", "ReportProgress", "=", "&", "reportProgress", "\n", "return", "a", "\n", "}" ]
// SetReportProgress sets the ReportProgress optional argument. If // true 'reportHeapSnapshotProgress' events will be generated while // snapshot is being taken when the tracking is stopped.
[ "SetReportProgress", "sets", "the", "ReportProgress", "optional", "argument", ".", "If", "true", "reportHeapSnapshotProgress", "events", "will", "be", "generated", "while", "snapshot", "is", "being", "taken", "when", "the", "tracking", "is", "stopped", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L126-L129
19,294
mafredri/cdp
protocol/heapprofiler/command.go
SetReportProgress
func (a *TakeHeapSnapshotArgs) SetReportProgress(reportProgress bool) *TakeHeapSnapshotArgs { a.ReportProgress = &reportProgress return a }
go
func (a *TakeHeapSnapshotArgs) SetReportProgress(reportProgress bool) *TakeHeapSnapshotArgs { a.ReportProgress = &reportProgress return a }
[ "func", "(", "a", "*", "TakeHeapSnapshotArgs", ")", "SetReportProgress", "(", "reportProgress", "bool", ")", "*", "TakeHeapSnapshotArgs", "{", "a", ".", "ReportProgress", "=", "&", "reportProgress", "\n", "return", "a", "\n", "}" ]
// SetReportProgress sets the ReportProgress optional argument. If // true 'reportHeapSnapshotProgress' events will be generated while // snapshot is being taken.
[ "SetReportProgress", "sets", "the", "ReportProgress", "optional", "argument", ".", "If", "true", "reportHeapSnapshotProgress", "events", "will", "be", "generated", "while", "snapshot", "is", "being", "taken", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/heapprofiler/command.go#L146-L149
19,295
mafredri/cdp
protocol/target/command.go
NewActivateTargetArgs
func NewActivateTargetArgs(targetID ID) *ActivateTargetArgs { args := new(ActivateTargetArgs) args.TargetID = targetID return args }
go
func NewActivateTargetArgs(targetID ID) *ActivateTargetArgs { args := new(ActivateTargetArgs) args.TargetID = targetID return args }
[ "func", "NewActivateTargetArgs", "(", "targetID", "ID", ")", "*", "ActivateTargetArgs", "{", "args", ":=", "new", "(", "ActivateTargetArgs", ")", "\n", "args", ".", "TargetID", "=", "targetID", "\n", "return", "args", "\n", "}" ]
// NewActivateTargetArgs initializes ActivateTargetArgs with the required arguments.
[ "NewActivateTargetArgs", "initializes", "ActivateTargetArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/target/command.go#L11-L15
19,296
mafredri/cdp
protocol/target/command.go
NewAttachToTargetArgs
func NewAttachToTargetArgs(targetID ID) *AttachToTargetArgs { args := new(AttachToTargetArgs) args.TargetID = targetID return args }
go
func NewAttachToTargetArgs(targetID ID) *AttachToTargetArgs { args := new(AttachToTargetArgs) args.TargetID = targetID return args }
[ "func", "NewAttachToTargetArgs", "(", "targetID", "ID", ")", "*", "AttachToTargetArgs", "{", "args", ":=", "new", "(", "AttachToTargetArgs", ")", "\n", "args", ".", "TargetID", "=", "targetID", "\n", "return", "args", "\n", "}" ]
// NewAttachToTargetArgs initializes AttachToTargetArgs with the required arguments.
[ "NewAttachToTargetArgs", "initializes", "AttachToTargetArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/target/command.go#L28-L32
19,297
mafredri/cdp
protocol/target/command.go
NewCloseTargetArgs
func NewCloseTargetArgs(targetID ID) *CloseTargetArgs { args := new(CloseTargetArgs) args.TargetID = targetID return args }
go
func NewCloseTargetArgs(targetID ID) *CloseTargetArgs { args := new(CloseTargetArgs) args.TargetID = targetID return args }
[ "func", "NewCloseTargetArgs", "(", "targetID", "ID", ")", "*", "CloseTargetArgs", "{", "args", ":=", "new", "(", "CloseTargetArgs", ")", "\n", "args", ".", "TargetID", "=", "targetID", "\n", "return", "args", "\n", "}" ]
// NewCloseTargetArgs initializes CloseTargetArgs with the required arguments.
[ "NewCloseTargetArgs", "initializes", "CloseTargetArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/target/command.go#L60-L64
19,298
mafredri/cdp
protocol/target/command.go
NewExposeDevToolsProtocolArgs
func NewExposeDevToolsProtocolArgs(targetID ID) *ExposeDevToolsProtocolArgs { args := new(ExposeDevToolsProtocolArgs) args.TargetID = targetID return args }
go
func NewExposeDevToolsProtocolArgs(targetID ID) *ExposeDevToolsProtocolArgs { args := new(ExposeDevToolsProtocolArgs) args.TargetID = targetID return args }
[ "func", "NewExposeDevToolsProtocolArgs", "(", "targetID", "ID", ")", "*", "ExposeDevToolsProtocolArgs", "{", "args", ":=", "new", "(", "ExposeDevToolsProtocolArgs", ")", "\n", "args", ".", "TargetID", "=", "targetID", "\n", "return", "args", "\n", "}" ]
// NewExposeDevToolsProtocolArgs initializes ExposeDevToolsProtocolArgs with the required arguments.
[ "NewExposeDevToolsProtocolArgs", "initializes", "ExposeDevToolsProtocolArgs", "with", "the", "required", "arguments", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/target/command.go#L78-L82
19,299
mafredri/cdp
protocol/target/command.go
SetBindingName
func (a *ExposeDevToolsProtocolArgs) SetBindingName(bindingName string) *ExposeDevToolsProtocolArgs { a.BindingName = &bindingName return a }
go
func (a *ExposeDevToolsProtocolArgs) SetBindingName(bindingName string) *ExposeDevToolsProtocolArgs { a.BindingName = &bindingName return a }
[ "func", "(", "a", "*", "ExposeDevToolsProtocolArgs", ")", "SetBindingName", "(", "bindingName", "string", ")", "*", "ExposeDevToolsProtocolArgs", "{", "a", ".", "BindingName", "=", "&", "bindingName", "\n", "return", "a", "\n", "}" ]
// SetBindingName sets the BindingName optional argument. Binding // name, 'cdp' if not specified.
[ "SetBindingName", "sets", "the", "BindingName", "optional", "argument", ".", "Binding", "name", "cdp", "if", "not", "specified", "." ]
a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514
https://github.com/mafredri/cdp/blob/a3cd6cc58c0b7537b9614e7fa5da84bdd3c18514/protocol/target/command.go#L86-L89