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"` // RegistrationID string `json:"registrationId"` // Data string `json:"data"` // }
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"` // RegistrationID string `json:"registrationId"` // Tag string `json:"tag"` // LastChance bool `json:"lastChance"` // }
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"` // RegistrationID string `json:"registrationId"` // VersionID string `json:"versionId"` // SourceURL string `json:"sourceURL"` // LineNumber int `json:"lineNumber"` // ColumnNumber int `json:"columnNumber"` // }
ErrorMessage ServiceWorker error message.
type InspectWorkerArgs ¶
type InspectWorkerArgs struct {
VersionID string `json:"versionId"` //
}
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"` // ScopeURL string `json:"scopeURL"` // IsDeleted bool `json:"isDeleted"` // }
Registration ServiceWorker registration.
type SetForceUpdateOnPageLoadArgs ¶
type SetForceUpdateOnPageLoadArgs struct {
ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"` //
}
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"` //
}
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"` //
}
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"` //
}
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"` //
}
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"` //
}
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"` // RegistrationID string `json:"registrationId"` // ScriptURL string `json:"scriptURL"` // RunningStatus VersionRunningStatus `json:"runningStatus"` // Status VersionStatus `json:"status"` // 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"` // TargetID *target.ID `json:"targetId,omitempty"` // }
Version ServiceWorker version.
type VersionRunningStatus ¶
type VersionRunningStatus int
VersionRunningStatus
const ( VersionRunningStatusNotSet VersionRunningStatus = iota VersionRunningStatusStopped VersionRunningStatusStarting VersionRunningStatusRunning VersionRunningStatusStopping )
VersionRunningStatus as enums.
func (VersionRunningStatus) MarshalJSON ¶
func (e VersionRunningStatus) MarshalJSON() ([]byte, error)
MarshalJSON encodes enum into a string or null when not set.
func (VersionRunningStatus) String ¶
func (e VersionRunningStatus) String() string
func (*VersionRunningStatus) UnmarshalJSON ¶
func (e *VersionRunningStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a string value into a enum.
func (VersionRunningStatus) Valid ¶
func (e VersionRunningStatus) Valid() bool
Valid returns true if enum is set.
type VersionStatus ¶
type VersionStatus int
VersionStatus
const ( VersionStatusNotSet VersionStatus = iota VersionStatusNew VersionStatusInstalling VersionStatusInstalled VersionStatusActivating VersionStatusActivated VersionStatusRedundant )
VersionStatus as enums.
func (VersionStatus) MarshalJSON ¶
func (e VersionStatus) MarshalJSON() ([]byte, error)
MarshalJSON encodes enum into a string or null when not set.
func (VersionStatus) String ¶
func (e VersionStatus) String() string
func (*VersionStatus) UnmarshalJSON ¶
func (e *VersionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes a string value into a enum.
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"` //
}
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"` //
}
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"` //
}
WorkerVersionUpdatedReply is the reply for WorkerVersionUpdated events.