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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
// Package backgroundservice provides the Chrome DevTools Protocol
// commands, types, and events for the BackgroundService domain.
//
// Defines events for background web platform features.
//
// Generated by the cdproto-gen command.
package backgroundservice
// Code generated by cdproto-gen. DO NOT EDIT.
import (
"context"
"github.com/chromedp/cdproto/cdp"
)
// StartObservingParams enables event updates for the service.
type StartObservingParams struct {
Service ServiceName `json:"service"`
}
// StartObserving enables event updates for the service.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-startObserving
//
// parameters:
//
// service
func StartObserving(service ServiceName) *StartObservingParams {
return &StartObservingParams{
Service: service,
}
}
// Do executes BackgroundService.startObserving against the provided context.
func (p *StartObservingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStartObserving, p, nil)
}
// StopObservingParams disables event updates for the service.
type StopObservingParams struct {
Service ServiceName `json:"service"`
}
// StopObserving disables event updates for the service.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-stopObserving
//
// parameters:
//
// service
func StopObserving(service ServiceName) *StopObservingParams {
return &StopObservingParams{
Service: service,
}
}
// Do executes BackgroundService.stopObserving against the provided context.
func (p *StopObservingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandStopObserving, p, nil)
}
// SetRecordingParams set the recording state for the service.
type SetRecordingParams struct {
ShouldRecord bool `json:"shouldRecord"`
Service ServiceName `json:"service"`
}
// SetRecording set the recording state for the service.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-setRecording
//
// parameters:
//
// shouldRecord
// service
func SetRecording(shouldRecord bool, service ServiceName) *SetRecordingParams {
return &SetRecordingParams{
ShouldRecord: shouldRecord,
Service: service,
}
}
// Do executes BackgroundService.setRecording against the provided context.
func (p *SetRecordingParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandSetRecording, p, nil)
}
// ClearEventsParams clears all stored data for the service.
type ClearEventsParams struct {
Service ServiceName `json:"service"`
}
// ClearEvents clears all stored data for the service.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-clearEvents
//
// parameters:
//
// service
func ClearEvents(service ServiceName) *ClearEventsParams {
return &ClearEventsParams{
Service: service,
}
}
// Do executes BackgroundService.clearEvents against the provided context.
func (p *ClearEventsParams) Do(ctx context.Context) (err error) {
return cdp.Execute(ctx, CommandClearEvents, p, nil)
}
// Command names.
const (
CommandStartObserving = "BackgroundService.startObserving"
CommandStopObserving = "BackgroundService.stopObserving"
CommandSetRecording = "BackgroundService.setRecording"
CommandClearEvents = "BackgroundService.clearEvents"
)
|