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
- type ClearEventsParams
- func (p *ClearEventsParams) Do(ctx context.Context) (err error)
- func (v ClearEventsParams) MarshalEasyJSON(w *jwriter.Writer)
- func (v ClearEventsParams) MarshalJSON() ([]byte, error)
- func (v *ClearEventsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ClearEventsParams) UnmarshalJSON(data []byte) error
- type Event
- type EventBackgroundServiceEventReceived
- func (v EventBackgroundServiceEventReceived) MarshalEasyJSON(w *jwriter.Writer)
- func (v EventBackgroundServiceEventReceived) MarshalJSON() ([]byte, error)
- func (v *EventBackgroundServiceEventReceived) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *EventBackgroundServiceEventReceived) UnmarshalJSON(data []byte) error
- type EventMetadata
- type EventRecordingStateChanged
- type ServiceName
- type SetRecordingParams
- func (p *SetRecordingParams) Do(ctx context.Context) (err error)
- func (v SetRecordingParams) MarshalEasyJSON(w *jwriter.Writer)
- func (v SetRecordingParams) MarshalJSON() ([]byte, error)
- func (v *SetRecordingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *SetRecordingParams) UnmarshalJSON(data []byte) error
- type StartObservingParams
- func (p *StartObservingParams) Do(ctx context.Context) (err error)
- func (v StartObservingParams) MarshalEasyJSON(w *jwriter.Writer)
- func (v StartObservingParams) MarshalJSON() ([]byte, error)
- func (v *StartObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *StartObservingParams) UnmarshalJSON(data []byte) error
- type StopObservingParams
- func (p *StopObservingParams) Do(ctx context.Context) (err error)
- func (v StopObservingParams) MarshalEasyJSON(w *jwriter.Writer)
- func (v StopObservingParams) MarshalJSON() ([]byte, error)
- func (v *StopObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *StopObservingParams) UnmarshalJSON(data []byte) error
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
func (*ClearEventsParams) Do ¶
func (p *ClearEventsParams) Do(ctx context.Context) (err error)
Do executes BackgroundService.clearEvents against the provided context.
func (ClearEventsParams) MarshalEasyJSON ¶
func (v ClearEventsParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ClearEventsParams) MarshalJSON ¶
func (v ClearEventsParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ClearEventsParams) UnmarshalEasyJSON ¶
func (v *ClearEventsParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ClearEventsParams) UnmarshalJSON ¶
func (v *ClearEventsParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (Event) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Event) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Event) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Event) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
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.
func (EventBackgroundServiceEventReceived) MarshalEasyJSON ¶
func (v EventBackgroundServiceEventReceived) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventBackgroundServiceEventReceived) MarshalJSON ¶
func (v EventBackgroundServiceEventReceived) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EventBackgroundServiceEventReceived) UnmarshalEasyJSON ¶
func (v *EventBackgroundServiceEventReceived) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventBackgroundServiceEventReceived) UnmarshalJSON ¶
func (v *EventBackgroundServiceEventReceived) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (EventMetadata) MarshalEasyJSON ¶
func (v EventMetadata) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventMetadata) MarshalJSON ¶
func (v EventMetadata) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EventMetadata) UnmarshalEasyJSON ¶
func (v *EventMetadata) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventMetadata) UnmarshalJSON ¶
func (v *EventMetadata) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (EventRecordingStateChanged) MarshalEasyJSON ¶
func (v EventRecordingStateChanged) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (EventRecordingStateChanged) MarshalJSON ¶
func (v EventRecordingStateChanged) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*EventRecordingStateChanged) UnmarshalEasyJSON ¶
func (v *EventRecordingStateChanged) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*EventRecordingStateChanged) UnmarshalJSON ¶
func (v *EventRecordingStateChanged) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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) MarshalEasyJSON ¶
func (t ServiceName) MarshalEasyJSON(out *jwriter.Writer)
MarshalEasyJSON satisfies easyjson.Marshaler.
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) UnmarshalEasyJSON ¶
func (t *ServiceName) UnmarshalEasyJSON(in *jlexer.Lexer)
UnmarshalEasyJSON satisfies easyjson.Unmarshaler.
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
func (*SetRecordingParams) Do ¶
func (p *SetRecordingParams) Do(ctx context.Context) (err error)
Do executes BackgroundService.setRecording against the provided context.
func (SetRecordingParams) MarshalEasyJSON ¶
func (v SetRecordingParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SetRecordingParams) MarshalJSON ¶
func (v SetRecordingParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SetRecordingParams) UnmarshalEasyJSON ¶
func (v *SetRecordingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SetRecordingParams) UnmarshalJSON ¶
func (v *SetRecordingParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (*StartObservingParams) Do ¶
func (p *StartObservingParams) Do(ctx context.Context) (err error)
Do executes BackgroundService.startObserving against the provided context.
func (StartObservingParams) MarshalEasyJSON ¶
func (v StartObservingParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StartObservingParams) MarshalJSON ¶
func (v StartObservingParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StartObservingParams) UnmarshalEasyJSON ¶
func (v *StartObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StartObservingParams) UnmarshalJSON ¶
func (v *StartObservingParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
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
func (*StopObservingParams) Do ¶
func (p *StopObservingParams) Do(ctx context.Context) (err error)
Do executes BackgroundService.stopObserving against the provided context.
func (StopObservingParams) MarshalEasyJSON ¶
func (v StopObservingParams) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (StopObservingParams) MarshalJSON ¶
func (v StopObservingParams) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*StopObservingParams) UnmarshalEasyJSON ¶
func (v *StopObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*StopObservingParams) UnmarshalJSON ¶
func (v *StopObservingParams) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface