/
log.go
96 lines (78 loc) · 2.85 KB
/
log.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Package log provides the Chrome Debugging Protocol
// commands, types, and events for the Log domain.
//
// Provides access to log entries.
//
// Generated by the chromedp-gen command.
package log
// Code generated by chromedp-gen. DO NOT EDIT.
import (
"context"
cdp "github.com/knq/chromedp/cdp"
)
// EnableParams enables log domain, sends the entries collected so far to the
// client by means of the entryAdded notification.
type EnableParams struct{}
// Enable enables log domain, sends the entries collected so far to the
// client by means of the entryAdded notification.
func Enable() *EnableParams {
return &EnableParams{}
}
// Do executes Log.enable against the provided context and
// target handler.
func (p *EnableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandLogEnable, nil, nil)
}
// DisableParams disables log domain, prevents further log entries from being
// reported to the client.
type DisableParams struct{}
// Disable disables log domain, prevents further log entries from being
// reported to the client.
func Disable() *DisableParams {
return &DisableParams{}
}
// Do executes Log.disable against the provided context and
// target handler.
func (p *DisableParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandLogDisable, nil, nil)
}
// ClearParams clears the log.
type ClearParams struct{}
// Clear clears the log.
func Clear() *ClearParams {
return &ClearParams{}
}
// Do executes Log.clear against the provided context and
// target handler.
func (p *ClearParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandLogClear, nil, nil)
}
// StartViolationsReportParams start violation reporting.
type StartViolationsReportParams struct {
Config []*ViolationSetting `json:"config"` // Configuration for violations.
}
// StartViolationsReport start violation reporting.
//
// parameters:
// config - Configuration for violations.
func StartViolationsReport(config []*ViolationSetting) *StartViolationsReportParams {
return &StartViolationsReportParams{
Config: config,
}
}
// Do executes Log.startViolationsReport against the provided context and
// target handler.
func (p *StartViolationsReportParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandLogStartViolationsReport, p, nil)
}
// StopViolationsReportParams stop violation reporting.
type StopViolationsReportParams struct{}
// StopViolationsReport stop violation reporting.
func StopViolationsReport() *StopViolationsReportParams {
return &StopViolationsReportParams{}
}
// Do executes Log.stopViolationsReport against the provided context and
// target handler.
func (p *StopViolationsReportParams) Do(ctxt context.Context, h cdp.Handler) (err error) {
return h.Execute(ctxt, cdp.CommandLogStopViolationsReport, nil, nil)
}