cdproto: github.com/chromedp/cdproto/backgroundservice Index | Files

package backgroundservice

import "github.com/chromedp/cdproto/backgroundservice"

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

Package Files

backgroundservice.go easyjson.go events.go types.go

Constants

const (
    CommandStartObserving = "BackgroundService.startObserving"
    CommandStopObserving  = "BackgroundService.stopObserving"
    CommandSetRecording   = "BackgroundService.setRecording"
    CommandClearEvents    = "BackgroundService.clearEvents"
)

Command names.

type ClearEventsParams Uses

type ClearEventsParams struct {
    Service ServiceName `json:"service"`
}

ClearEventsParams clears all stored data for the service.

func ClearEvents Uses

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 Uses

func (p *ClearEventsParams) Do(ctx context.Context) (err error)

Do executes BackgroundService.clearEvents against the provided context.

func (ClearEventsParams) MarshalEasyJSON Uses

func (v ClearEventsParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ClearEventsParams) MarshalJSON Uses

func (v ClearEventsParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ClearEventsParams) UnmarshalEasyJSON Uses

func (v *ClearEventsParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ClearEventsParams) UnmarshalJSON Uses

func (v *ClearEventsParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Event Uses

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.
}

Event [no description].

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#type-BackgroundServiceEvent

func (Event) MarshalEasyJSON Uses

func (v Event) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Event) MarshalJSON Uses

func (v Event) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Event) UnmarshalEasyJSON Uses

func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Event) UnmarshalJSON Uses

func (v *Event) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventBackgroundServiceEventReceived Uses

type EventBackgroundServiceEventReceived struct {
    BackgroundServiceEvent *Event `json:"backgroundServiceEvent"`
}

EventBackgroundServiceEventReceived called with all existing backgroundServiceEvents when enabled, and all new events afterwards if enabled and recording.

See: https://chromedevtools.github.io/devtools-protocol/tot/BackgroundService#event-backgroundServiceEventReceived

func (EventBackgroundServiceEventReceived) MarshalEasyJSON Uses

func (v EventBackgroundServiceEventReceived) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventBackgroundServiceEventReceived) MarshalJSON Uses

func (v EventBackgroundServiceEventReceived) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventBackgroundServiceEventReceived) UnmarshalEasyJSON Uses

func (v *EventBackgroundServiceEventReceived) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventBackgroundServiceEventReceived) UnmarshalJSON Uses

func (v *EventBackgroundServiceEventReceived) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventMetadata Uses

type EventMetadata struct {
    Key   string `json:"key"`
    Value string `json:"value"`
}

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 Uses

func (v EventMetadata) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventMetadata) MarshalJSON Uses

func (v EventMetadata) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventMetadata) UnmarshalEasyJSON Uses

func (v *EventMetadata) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventMetadata) UnmarshalJSON Uses

func (v *EventMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type EventRecordingStateChanged Uses

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 Uses

func (v EventRecordingStateChanged) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (EventRecordingStateChanged) MarshalJSON Uses

func (v EventRecordingStateChanged) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*EventRecordingStateChanged) UnmarshalEasyJSON Uses

func (v *EventRecordingStateChanged) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*EventRecordingStateChanged) UnmarshalJSON Uses

func (v *EventRecordingStateChanged) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ServiceName Uses

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 Uses

func (t ServiceName) MarshalEasyJSON(out *jwriter.Writer)

MarshalEasyJSON satisfies easyjson.Marshaler.

func (ServiceName) MarshalJSON Uses

func (t ServiceName) MarshalJSON() ([]byte, error)

MarshalJSON satisfies json.Marshaler.

func (ServiceName) String Uses

func (t ServiceName) String() string

String returns the ServiceName as string value.

func (*ServiceName) UnmarshalEasyJSON Uses

func (t *ServiceName) UnmarshalEasyJSON(in *jlexer.Lexer)

UnmarshalEasyJSON satisfies easyjson.Unmarshaler.

func (*ServiceName) UnmarshalJSON Uses

func (t *ServiceName) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies json.Unmarshaler.

type SetRecordingParams Uses

type SetRecordingParams struct {
    ShouldRecord bool        `json:"shouldRecord"`
    Service      ServiceName `json:"service"`
}

SetRecordingParams set the recording state for the service.

func SetRecording Uses

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 Uses

func (p *SetRecordingParams) Do(ctx context.Context) (err error)

Do executes BackgroundService.setRecording against the provided context.

func (SetRecordingParams) MarshalEasyJSON Uses

func (v SetRecordingParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (SetRecordingParams) MarshalJSON Uses

func (v SetRecordingParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*SetRecordingParams) UnmarshalEasyJSON Uses

func (v *SetRecordingParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*SetRecordingParams) UnmarshalJSON Uses

func (v *SetRecordingParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StartObservingParams Uses

type StartObservingParams struct {
    Service ServiceName `json:"service"`
}

StartObservingParams enables event updates for the service.

func StartObserving Uses

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 Uses

func (p *StartObservingParams) Do(ctx context.Context) (err error)

Do executes BackgroundService.startObserving against the provided context.

func (StartObservingParams) MarshalEasyJSON Uses

func (v StartObservingParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StartObservingParams) MarshalJSON Uses

func (v StartObservingParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StartObservingParams) UnmarshalEasyJSON Uses

func (v *StartObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StartObservingParams) UnmarshalJSON Uses

func (v *StartObservingParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type StopObservingParams Uses

type StopObservingParams struct {
    Service ServiceName `json:"service"`
}

StopObservingParams disables event updates for the service.

func StopObserving Uses

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 Uses

func (p *StopObservingParams) Do(ctx context.Context) (err error)

Do executes BackgroundService.stopObserving against the provided context.

func (StopObservingParams) MarshalEasyJSON Uses

func (v StopObservingParams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (StopObservingParams) MarshalJSON Uses

func (v StopObservingParams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*StopObservingParams) UnmarshalEasyJSON Uses

func (v *StopObservingParams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*StopObservingParams) UnmarshalJSON Uses

func (v *StopObservingParams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Package backgroundservice imports 8 packages (graph) and is imported by 2 packages. Updated 2021-01-08. Refresh now. Tools for package owners.