Documentation
¶
Overview ¶
Package worker provides type definitions for use with the Chrome ServiceWorker protocol
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/
Index ¶
- Variables
- type DeliverPushMessageParams
- type DeliverPushMessageResult
- type DisableResult
- type DispatchSyncEventParams
- type DispatchSyncEventResult
- type EnableResult
- type ErrorMessage
- type ErrorReportedEvent
- type InspectWorkerParams
- type InspectWorkerResult
- type Registration
- type RegistrationUpdatedEvent
- type SetForceUpdateOnPageLoadParams
- type SetForceUpdateOnPageLoadResult
- type SkipWaitingParams
- type SkipWaitingResult
- type StartWorkerParams
- type StartWorkerResult
- type StopAllWorkersResult
- type StopWorkerParams
- type StopWorkerResult
- type UnregisterParams
- type UnregisterResult
- type UpdateRegistrationParams
- type UpdateRegistrationResult
- type Version
- type VersionRunningStatusEnum
- type VersionStatusEnum
- type VersionUpdatedEvent
Constants ¶
This section is empty.
Variables ¶
var VersionRunningStatus = versionRunningStatusEnum{
Stopped: versionRunningStatusStopped,
Starting: versionRunningStatusStarting,
Running: versionRunningStatusRunning,
Stopping: versionRunningStatusStopping,
}
VersionRunningStatus provides named acces to the VersionRunningStatusEnum values.
var VersionStatus = versionStatusEnum{
New: versionStatusNew,
Installing: versionStatusInstalling,
Installed: versionStatusInstalled,
Activating: versionStatusActivating,
Activated: versionStatusActivated,
Redundant: versionStatusRedundant,
}
VersionStatus provides named acces to the VersionStatusEnum values.
Functions ¶
This section is empty.
Types ¶
type DeliverPushMessageParams ¶
type DeliverPushMessageParams struct {
// Origin.
Origin string `json:"origin"`
// Registration ID.
RegistrationID string `json:"registrationId"`
// Data.
Data string `json:"data"`
}
DeliverPushMessageParams represents ServiceWorker.deliverPushMessage parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-deliverPushMessage
type DeliverPushMessageResult ¶
type DeliverPushMessageResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
DeliverPushMessageResult represents the result of calls to ServiceWorker.deliverPushMessage.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-deliverPushMessage
type DisableResult ¶
type DisableResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
DisableResult represents the result of calls to ServiceWorker.disable.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-disable
type DispatchSyncEventParams ¶
type DispatchSyncEventParams struct {
// Origin.
Origin string `json:"origin"`
// Registration ID.
RegistrationID string `json:"registrationId"`
// Tag.
Tag string `json:"tag"`
// Last chance.
LastChance bool `json:"lastChance"`
}
DispatchSyncEventParams represents ServiceWorker.dispatchSyncEvent parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-dispatchSyncEvent
type DispatchSyncEventResult ¶
type DispatchSyncEventResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
DispatchSyncEventResult represents the result of calls to ServiceWorker.dispatchSyncEvent.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-dispatchSyncEvent
type EnableResult ¶
type EnableResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
EnableResult represents the result of calls to ServiceWorker.enable.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-enable
type ErrorMessage ¶
type ErrorMessage struct {
// desc.
ErrorMessage string `json:"errorMessage"`
// desc.
RegistrationID string `json:"registrationId"`
// desc.
VersionID string `json:"versionId"`
// desc.
SourceURL string `json:"sourceURL"`
// desc.
LineNumber int `json:"lineNumber"`
// desc.
ColumnNumber int `json:"columnNumber"`
}
ErrorMessage is a ServiceWorker error message.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#type-ServiceWorkerErrorMessage
type ErrorReportedEvent ¶
type ErrorReportedEvent struct {
// Error message.
ErrorMessage *ErrorMessage `json:"errorMessage"`
// Error information related to this event
Err error `json:"-"`
}
ErrorReportedEvent represents ServiceWorker.workerErrorReported event data.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#event-workerErrorReported
type InspectWorkerParams ¶
type InspectWorkerParams struct {
// Version ID.
VersionID string `json:"versionId"`
}
InspectWorkerParams represents ServiceWorker.inspectWorker parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-inspectWorker
type InspectWorkerResult ¶
type InspectWorkerResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
InspectWorkerResult represents the result of calls to ServiceWorker.inspectWorker.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-inspectWorker
type Registration ¶
type Registration struct {
// desc.
RegistrationID string `json:"registrationId"`
// desc.
ScopeURL string `json:"scopeURL"`
// desc.
IsDeleted bool `json:"isDeleted"`
}
Registration is a ServiceWorker registration.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#type-ServiceWorkerRegistration
type RegistrationUpdatedEvent ¶
type RegistrationUpdatedEvent struct {
// Registrations.
Registrations []*Registration `json:"registrations"`
// Error information related to this event
Err error `json:"-"`
}
RegistrationUpdatedEvent represents ServiceWorker.workerRegistrationUpdated event data.
type SetForceUpdateOnPageLoadParams ¶
type SetForceUpdateOnPageLoadParams struct {
// Force update on page load.
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"`
}
SetForceUpdateOnPageLoadParams represents ServiceWorker.setForceUpdateOnPageLoad parameters.
type SetForceUpdateOnPageLoadResult ¶
type SetForceUpdateOnPageLoadResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SetForceUpdateOnPageLoadResult represents the result of calls to ServiceWorker.setForceUpdateOnPageLoad.
type SkipWaitingParams ¶
type SkipWaitingParams struct {
// Scope URL.
ScopeURL string `json:"scopeURL"`
}
SkipWaitingParams represents ServiceWorker.skipWaiting parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-skipWaiting
type SkipWaitingResult ¶
type SkipWaitingResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
SkipWaitingResult represents the result of calls to ServiceWorker.skipWaiting.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-skipWaiting
type StartWorkerParams ¶
type StartWorkerParams struct {
// Scope URL.
ScopeURL string `json:"scopeURL"`
}
StartWorkerParams represents ServiceWorker.startWorker parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-startWorker
type StartWorkerResult ¶
type StartWorkerResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
StartWorkerResult represents the result of calls to ServiceWorker.startWorker.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-startWorker
type StopAllWorkersResult ¶
type StopAllWorkersResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
StopAllWorkersResult represents the result of calls to ServiceWorker.stopAllWorkers.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-stopAllWorkers
type StopWorkerParams ¶
type StopWorkerParams struct {
// Version ID.
VersionID string `json:"versionId"`
}
StopWorkerParams represents ServiceWorker.stopWorker parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-stopWorker
type StopWorkerResult ¶
type StopWorkerResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
StopWorkerResult represents the result of calls to ServiceWorker.stopWorker.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-stopWorker
type UnregisterParams ¶
type UnregisterParams struct {
// Scope URL.
ScopeURL string `json:"scopeURL"`
}
UnregisterParams represents ServiceWorker.unregister parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-unregister
type UnregisterResult ¶
type UnregisterResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
UnregisterResult represents the result of calls to ServiceWorker.unregister.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-unregister
type UpdateRegistrationParams ¶
type UpdateRegistrationParams struct {
// Scope URL.
ScopeURL string `json:"scopeURL"`
}
UpdateRegistrationParams represents ServiceWorker.updateRegistration parameters.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-updateRegistration
type UpdateRegistrationResult ¶
type UpdateRegistrationResult struct {
// Error information related to executing this method
Err error `json:"-"`
}
UpdateRegistrationResult represents the result of calls to ServiceWorker.updateRegistration.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#method-updateRegistration
type Version ¶
type Version struct {
// versionId.
VersionID string `json:"versionId"`
// registrationId.
RegistrationID string `json:"registrationId"`
// scriptURL.
ScriptURL string `json:"scriptURL"`
// runningStatus.
RunningStatus VersionRunningStatusEnum `json:"runningStatus"`
// status.
Status VersionStatusEnum `json:"status"`
// Optional. The Last-Modified header value of the main script.
ScriptLastModified int64 `json:"scriptLastModified,omitempty"`
// Optional. The time at which the response headers of the main script were
// received from the server. For cached script it is the last time the cache
// entry was validated.
ScriptResponseTime int64 `json:"scriptResponseTime,omitempty"`
// Optional. controlledClients.
ControlledClients []target.ID `json:"controlledClients,omitempty"`
// Optional. targetId.
TargetID target.ID `json:"targetId,omitempty"`
}
Version is the ServiceWorker version.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#type-ServiceWorkerVersion
type VersionRunningStatusEnum ¶
type VersionRunningStatusEnum int
VersionRunningStatusEnum is the version running status. Allowed values:
- VersionRunningStatus.Stopped "stopped"
- VersionRunningStatus.Starting "starting"
- VersionRunningStatus.Running "running"
- VersionRunningStatus.Stopping "stopping"
func (VersionRunningStatusEnum) MarshalJSON ¶
func (enum VersionRunningStatusEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (VersionRunningStatusEnum) String ¶
func (enum VersionRunningStatusEnum) String() string
String implements Stringer
func (*VersionRunningStatusEnum) UnmarshalJSON ¶
func (enum *VersionRunningStatusEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type VersionStatusEnum ¶
type VersionStatusEnum int
VersionStatusEnum is the version status. Allowed values:
- VersionStatus.New "new"
- VersionStatus.Installing "installing"
- VersionStatus.Installed "installed"
- VersionStatus.Activating "activating"
- VersionStatus.Activated "activated"
- VersionStatus.Redundant "redundant"
func (VersionStatusEnum) MarshalJSON ¶
func (enum VersionStatusEnum) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (VersionStatusEnum) String ¶
func (enum VersionStatusEnum) String() string
String implements Stringer
func (*VersionStatusEnum) UnmarshalJSON ¶
func (enum *VersionStatusEnum) UnmarshalJSON(bytes []byte) error
UnmarshalJSON implements json.Unmarshaler
type VersionUpdatedEvent ¶
type VersionUpdatedEvent struct {
// Versions.
Versions []*Version `json:"versions"`
// Error information related to this event
Err error `json:"-"`
}
VersionUpdatedEvent represents ServiceWorker.workerVersionUpdated event data.
https://chromedevtools.github.io/devtools-protocol/tot/ServiceWorker/#event-workerVersionUpdated