Documentation ¶
Overview ¶
Package serviceworker implements the ServiceWorker domain.
Index ¶
- func NewClient(conn *rpcc.Conn) *domainClient
- type DeliverPushMessageArgs
- type DispatchSyncEventArgs
- type ErrorMessage
- type InspectWorkerArgs
- type Registration
- type SetForceUpdateOnPageLoadArgs
- type SkipWaitingArgs
- type StartWorkerArgs
- type StopWorkerArgs
- type UnregisterArgs
- type UpdateRegistrationArgs
- type Version
- type VersionRunningStatus
- type VersionStatus
- type WorkerErrorReportedClient
- type WorkerErrorReportedReply
- type WorkerRegistrationUpdatedClient
- type WorkerRegistrationUpdatedReply
- type WorkerVersionUpdatedClient
- type WorkerVersionUpdatedReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DeliverPushMessageArgs ¶
type DeliverPushMessageArgs struct { Origin string `json:"origin"` // No description. RegistrationID string `json:"registrationId"` // No description. Data string `json:"data"` // No description. }
DeliverPushMessageArgs represents the arguments for DeliverPushMessage in the ServiceWorker domain.
func NewDeliverPushMessageArgs ¶
func NewDeliverPushMessageArgs(origin string, registrationID string, data string) *DeliverPushMessageArgs
NewDeliverPushMessageArgs initializes DeliverPushMessageArgs with the required arguments.
type DispatchSyncEventArgs ¶
type DispatchSyncEventArgs struct { Origin string `json:"origin"` // No description. RegistrationID string `json:"registrationId"` // No description. Tag string `json:"tag"` // No description. LastChance bool `json:"lastChance"` // No description. }
DispatchSyncEventArgs represents the arguments for DispatchSyncEvent in the ServiceWorker domain.
func NewDispatchSyncEventArgs ¶
func NewDispatchSyncEventArgs(origin string, registrationID string, tag string, lastChance bool) *DispatchSyncEventArgs
NewDispatchSyncEventArgs initializes DispatchSyncEventArgs with the required arguments.
type ErrorMessage ¶
type ErrorMessage struct { ErrorMessage string `json:"errorMessage"` // No description. RegistrationID string `json:"registrationId"` // No description. VersionID string `json:"versionId"` // No description. SourceURL string `json:"sourceURL"` // No description. LineNumber int `json:"lineNumber"` // No description. ColumnNumber int `json:"columnNumber"` // No description. }
ErrorMessage ServiceWorker error message.
type InspectWorkerArgs ¶
type InspectWorkerArgs struct {
VersionID string `json:"versionId"` // No description.
}
InspectWorkerArgs represents the arguments for InspectWorker in the ServiceWorker domain.
func NewInspectWorkerArgs ¶
func NewInspectWorkerArgs(versionID string) *InspectWorkerArgs
NewInspectWorkerArgs initializes InspectWorkerArgs with the required arguments.
type Registration ¶
type Registration struct { RegistrationID string `json:"registrationId"` // No description. ScopeURL string `json:"scopeURL"` // No description. IsDeleted bool `json:"isDeleted"` // No description. }
Registration ServiceWorker registration.
type SetForceUpdateOnPageLoadArgs ¶
type SetForceUpdateOnPageLoadArgs struct {
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"` // No description.
}
SetForceUpdateOnPageLoadArgs represents the arguments for SetForceUpdateOnPageLoad in the ServiceWorker domain.
func NewSetForceUpdateOnPageLoadArgs ¶
func NewSetForceUpdateOnPageLoadArgs(forceUpdateOnPageLoad bool) *SetForceUpdateOnPageLoadArgs
NewSetForceUpdateOnPageLoadArgs initializes SetForceUpdateOnPageLoadArgs with the required arguments.
type SkipWaitingArgs ¶
type SkipWaitingArgs struct {
ScopeURL string `json:"scopeURL"` // No description.
}
SkipWaitingArgs represents the arguments for SkipWaiting in the ServiceWorker domain.
func NewSkipWaitingArgs ¶
func NewSkipWaitingArgs(scopeURL string) *SkipWaitingArgs
NewSkipWaitingArgs initializes SkipWaitingArgs with the required arguments.
type StartWorkerArgs ¶
type StartWorkerArgs struct {
ScopeURL string `json:"scopeURL"` // No description.
}
StartWorkerArgs represents the arguments for StartWorker in the ServiceWorker domain.
func NewStartWorkerArgs ¶
func NewStartWorkerArgs(scopeURL string) *StartWorkerArgs
NewStartWorkerArgs initializes StartWorkerArgs with the required arguments.
type StopWorkerArgs ¶
type StopWorkerArgs struct {
VersionID string `json:"versionId"` // No description.
}
StopWorkerArgs represents the arguments for StopWorker in the ServiceWorker domain.
func NewStopWorkerArgs ¶
func NewStopWorkerArgs(versionID string) *StopWorkerArgs
NewStopWorkerArgs initializes StopWorkerArgs with the required arguments.
type UnregisterArgs ¶
type UnregisterArgs struct {
ScopeURL string `json:"scopeURL"` // No description.
}
UnregisterArgs represents the arguments for Unregister in the ServiceWorker domain.
func NewUnregisterArgs ¶
func NewUnregisterArgs(scopeURL string) *UnregisterArgs
NewUnregisterArgs initializes UnregisterArgs with the required arguments.
type UpdateRegistrationArgs ¶
type UpdateRegistrationArgs struct {
ScopeURL string `json:"scopeURL"` // No description.
}
UpdateRegistrationArgs represents the arguments for UpdateRegistration in the ServiceWorker domain.
func NewUpdateRegistrationArgs ¶
func NewUpdateRegistrationArgs(scopeURL string) *UpdateRegistrationArgs
NewUpdateRegistrationArgs initializes UpdateRegistrationArgs with the required arguments.
type Version ¶
type Version struct { VersionID string `json:"versionId"` // No description. RegistrationID string `json:"registrationId"` // No description. ScriptURL string `json:"scriptURL"` // No description. RunningStatus VersionRunningStatus `json:"runningStatus"` // No description. Status VersionStatus `json:"status"` // No description. ScriptLastModified *float64 `json:"scriptLastModified,omitempty"` // The Last-Modified header value of the main script. ScriptResponseTime *float64 `json:"scriptResponseTime,omitempty"` // 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. ControlledClients []target.ID `json:"controlledClients,omitempty"` // No description. TargetID *target.ID `json:"targetId,omitempty"` // No description. }
Version ServiceWorker version.
type VersionRunningStatus ¶
type VersionRunningStatus string
VersionRunningStatus
const ( VersionRunningStatusNotSet VersionRunningStatus = "" VersionRunningStatusStopped VersionRunningStatus = "stopped" VersionRunningStatusStarting VersionRunningStatus = "starting" VersionRunningStatusRunning VersionRunningStatus = "running" VersionRunningStatusStopping VersionRunningStatus = "stopping" )
VersionRunningStatus as enums.
func (VersionRunningStatus) String ¶
func (e VersionRunningStatus) String() string
func (VersionRunningStatus) Valid ¶
func (e VersionRunningStatus) Valid() bool
type VersionStatus ¶
type VersionStatus string
VersionStatus
const ( VersionStatusNotSet VersionStatus = "" VersionStatusNew VersionStatus = "new" VersionStatusInstalling VersionStatus = "installing" VersionStatusInstalled VersionStatus = "installed" VersionStatusActivating VersionStatus = "activating" VersionStatusActivated VersionStatus = "activated" VersionStatusRedundant VersionStatus = "redundant" )
VersionStatus as enums.
func (VersionStatus) String ¶
func (e VersionStatus) String() string
func (VersionStatus) Valid ¶
func (e VersionStatus) Valid() bool
type WorkerErrorReportedClient ¶
type WorkerErrorReportedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*WorkerErrorReportedReply, error) rpcc.Stream }
WorkerErrorReportedClient is a client for WorkerErrorReported events.
type WorkerErrorReportedReply ¶
type WorkerErrorReportedReply struct {
ErrorMessage ErrorMessage `json:"errorMessage"` // No description.
}
WorkerErrorReportedReply is the reply for WorkerErrorReported events.
type WorkerRegistrationUpdatedClient ¶
type WorkerRegistrationUpdatedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*WorkerRegistrationUpdatedReply, error) rpcc.Stream }
WorkerRegistrationUpdatedClient is a client for WorkerRegistrationUpdated events.
type WorkerRegistrationUpdatedReply ¶
type WorkerRegistrationUpdatedReply struct {
Registrations []Registration `json:"registrations"` // No description.
}
WorkerRegistrationUpdatedReply is the reply for WorkerRegistrationUpdated events.
type WorkerVersionUpdatedClient ¶
type WorkerVersionUpdatedClient interface { // Recv calls RecvMsg on rpcc.Stream, blocks until the event is // triggered, context canceled or connection closed. Recv() (*WorkerVersionUpdatedReply, error) rpcc.Stream }
WorkerVersionUpdatedClient is a client for WorkerVersionUpdated events.
type WorkerVersionUpdatedReply ¶
type WorkerVersionUpdatedReply struct {
Versions []Version `json:"versions"` // No description.
}
WorkerVersionUpdatedReply is the reply for WorkerVersionUpdated events.