forked from chromedp/chromedp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tethering.go
57 lines (48 loc) · 1.37 KB
/
tethering.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Package tethering provides the Chrome Debugging Protocol
// commands, types, and events for the Tethering domain.
//
// The Tethering domain defines methods and events for browser port binding.
//
// Generated by the chromedp-gen command.
package tethering
// Code generated by chromedp-gen. DO NOT EDIT.
import (
"context"
cdp "github.com/knq/chromedp/cdp"
)
// BindParams request browser port binding.
type BindParams struct {
Port int64 `json:"port"` // Port number to bind.
}
// Bind request browser port binding.
//
// parameters:
// port - Port number to bind.
func Bind(port int64) *BindParams {
return &BindParams{
Port: port,
}
}
// Do executes Tethering.bind against the provided context and
// target handler.
func (p *BindParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandTetheringBind, p, nil)
}
// UnbindParams request browser port unbinding.
type UnbindParams struct {
Port int64 `json:"port"` // Port number to unbind.
}
// Unbind request browser port unbinding.
//
// parameters:
// port - Port number to unbind.
func Unbind(port int64) *UnbindParams {
return &UnbindParams{
Port: port,
}
}
// Do executes Tethering.unbind against the provided context and
// target handler.
func (p *UnbindParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandTetheringUnbind, p, nil)
}