Documentation
¶
Overview ¶
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.
Index ¶
Constants ¶
const ( CommandStartObserving = "BackgroundService.startObserving" CommandStopObserving = "BackgroundService.stopObserving" CommandSetRecording = "BackgroundService.setRecording" CommandClearEvents = "BackgroundService.clearEvents" )
Command names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearEventsParams ¶
type ClearEventsParams struct {
Service ServiceName `json:"service"`
}
ClearEventsParams clears all stored data for the service.
func ClearEvents ¶
func ClearEvents(service ServiceName) *ClearEventsParams
ClearEvents clears all stored data for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-clearEvents
parameters:
service
type Event ¶
type Event struct {
Timestamp *cdp.TimeSinceEpoch `json:"timestamp"` // Timestamp of the event (in seconds).
Origin string `json:"origin"` // The origin this event belongs to.
ServiceWorkerRegistrationID serviceworker.RegistrationID `json:"serviceWorkerRegistrationId"` // The Service Worker ID that initiated the event.
Service ServiceName `json:"service"` // The Background Service this event belongs to.
EventName string `json:"eventName"` // A description of the event.
InstanceID string `json:"instanceId"` // An identifier that groups related events together.
EventMetadata []*EventMetadata `json:"eventMetadata"` // A list of event-specific information.
StorageKey string `json:"storageKey"` // Storage key this event belongs to.
}
Event [no description].
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-BackgroundServiceEvent
type EventBackgroundServiceEventReceived ¶
type EventBackgroundServiceEventReceived struct {
BackgroundServiceEvent *Event `json:"backgroundServiceEvent"`
}
EventBackgroundServiceEventReceived called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.
type EventMetadata ¶
EventMetadata a key-value pair for additional event information to pass along.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-EventMetadata
type EventRecordingStateChanged ¶
type EventRecordingStateChanged struct {
IsRecording bool `json:"isRecording"`
Service ServiceName `json:"service"`
}
EventRecordingStateChanged called when the recording state for the service has been updated.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-recordingStateChanged
type ServiceName ¶
type ServiceName string
ServiceName the Background Service that will be associated with the commands/events. Every Background Service operates independently, but they share the same API.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-ServiceName
const ( ServiceNameBackgroundFetch ServiceName = "backgroundFetch" ServiceNameBackgroundSync ServiceName = "backgroundSync" ServiceNamePushMessaging ServiceName = "pushMessaging" ServiceNameNotifications ServiceName = "notifications" ServiceNamePaymentHandler ServiceName = "paymentHandler" ServiceNamePeriodicBackgroundSync ServiceName = "periodicBackgroundSync" )
ServiceName values.
func (ServiceName) MarshalJSON ¶
func (t ServiceName) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler.
func (ServiceName) String ¶
func (t ServiceName) String() string
String returns the ServiceName as string value.
func (*ServiceName) UnmarshalJSON ¶
func (t *ServiceName) UnmarshalJSON(buf []byte) error
UnmarshalJSON satisfies json.Unmarshaler.
type SetRecordingParams ¶
type SetRecordingParams struct {
ShouldRecord bool `json:"shouldRecord"`
Service ServiceName `json:"service"`
}
SetRecordingParams set the recording state for the service.
func SetRecording ¶
func SetRecording(shouldRecord bool, service ServiceName) *SetRecordingParams
SetRecording set the recording state for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-setRecording
parameters:
shouldRecord service
type StartObservingParams ¶
type StartObservingParams struct {
Service ServiceName `json:"service"`
}
StartObservingParams enables event updates for the service.
func StartObserving ¶
func StartObserving(service ServiceName) *StartObservingParams
StartObserving enables event updates for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-startObserving
parameters:
service
type StopObservingParams ¶
type StopObservingParams struct {
Service ServiceName `json:"service"`
}
StopObservingParams disables event updates for the service.
func StopObserving ¶
func StopObserving(service ServiceName) *StopObservingParams
StopObserving disables event updates for the service.
See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#method-stopObserving
parameters:
service