Documentation ¶
Index ¶
- type DeliverPushMessageCommand
- type DeliverPushMessageCommandFn
- type DeliverPushMessageReturn
- type DisableCommand
- type DisableCommandFn
- type DisableReturn
- type DispatchSyncEventCommand
- type DispatchSyncEventCommandFn
- type DispatchSyncEventReturn
- type EnableCommand
- type EnableCommandFn
- type EnableReturn
- type InspectWorkerCommand
- type InspectWorkerCommandFn
- type InspectWorkerReturn
- type ServiceWorkerAgent
- func (agent *ServiceWorkerAgent) FireWorkerErrorReported(event WorkerErrorReportedEvent)
- func (agent *ServiceWorkerAgent) FireWorkerErrorReportedOnTarget(targetId string, event WorkerErrorReportedEvent)
- func (agent *ServiceWorkerAgent) FireWorkerRegistrationUpdated(event WorkerRegistrationUpdatedEvent)
- func (agent *ServiceWorkerAgent) FireWorkerRegistrationUpdatedOnTarget(targetId string, event WorkerRegistrationUpdatedEvent)
- func (agent *ServiceWorkerAgent) FireWorkerVersionUpdated(event WorkerVersionUpdatedEvent)
- func (agent *ServiceWorkerAgent) FireWorkerVersionUpdatedOnTarget(targetId string, event WorkerVersionUpdatedEvent)
- func (agent *ServiceWorkerAgent) Name() string
- func (agent *ServiceWorkerAgent) ProcessCommand(id int64, targetId string, funcName string, data *json.RawMessage)
- func (agent *ServiceWorkerAgent) SetDeliverPushMessageHandler(handler func(DeliverPushMessageCommand))
- func (agent *ServiceWorkerAgent) SetDisableHandler(handler func(DisableCommand))
- func (agent *ServiceWorkerAgent) SetDispatchSyncEventHandler(handler func(DispatchSyncEventCommand))
- func (agent *ServiceWorkerAgent) SetEnableHandler(handler func(EnableCommand))
- func (agent *ServiceWorkerAgent) SetInspectWorkerHandler(handler func(InspectWorkerCommand))
- func (agent *ServiceWorkerAgent) SetSetForceUpdateOnPageLoadHandler(handler func(SetForceUpdateOnPageLoadCommand))
- func (agent *ServiceWorkerAgent) SetSkipWaitingHandler(handler func(SkipWaitingCommand))
- func (agent *ServiceWorkerAgent) SetStartWorkerHandler(handler func(StartWorkerCommand))
- func (agent *ServiceWorkerAgent) SetStopWorkerHandler(handler func(StopWorkerCommand))
- func (agent *ServiceWorkerAgent) SetUnregisterHandler(handler func(UnregisterCommand))
- func (agent *ServiceWorkerAgent) SetUpdateRegistrationHandler(handler func(UpdateRegistrationCommand))
- type ServiceWorkerErrorMessage
- type ServiceWorkerRegistration
- type ServiceWorkerVersion
- type ServiceWorkerVersionRunningStatus
- type ServiceWorkerVersionStatus
- type SetForceUpdateOnPageLoadCommand
- type SetForceUpdateOnPageLoadCommandFn
- type SetForceUpdateOnPageLoadReturn
- type SkipWaitingCommand
- type SkipWaitingCommandFn
- type SkipWaitingReturn
- type StartWorkerCommand
- type StartWorkerCommandFn
- type StartWorkerReturn
- type StopWorkerCommand
- type StopWorkerCommandFn
- type StopWorkerReturn
- type UnregisterCommand
- type UnregisterCommandFn
- type UnregisterReturn
- type UpdateRegistrationCommand
- type UpdateRegistrationCommandFn
- type UpdateRegistrationReturn
- type WorkerErrorReportedEvent
- type WorkerRegistrationUpdatedEvent
- type WorkerVersionUpdatedEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliverPushMessageCommand ¶
type DeliverPushMessageCommand struct { DestinationTargetID string Origin string `json:"origin"` RegistrationId string `json:"registrationId"` Data string `json:"data"` // contains filtered or unexported fields }
func (*DeliverPushMessageCommand) Initalize ¶
func (c *DeliverPushMessageCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*DeliverPushMessageCommand) Respond ¶
func (c *DeliverPushMessageCommand) Respond()
func (*DeliverPushMessageCommand) RespondWithError ¶
func (c *DeliverPushMessageCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type DeliverPushMessageCommandFn ¶
type DeliverPushMessageCommandFn struct {
// contains filtered or unexported fields
}
func (*DeliverPushMessageCommandFn) Load ¶
func (a *DeliverPushMessageCommandFn) Load() func(DeliverPushMessageCommand)
func (*DeliverPushMessageCommandFn) Store ¶
func (a *DeliverPushMessageCommandFn) Store(fn func(DeliverPushMessageCommand))
type DeliverPushMessageReturn ¶
type DeliverPushMessageReturn struct { }
type DisableCommand ¶
type DisableCommand struct { DestinationTargetID string // contains filtered or unexported fields }
func (*DisableCommand) Initalize ¶
func (c *DisableCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*DisableCommand) Respond ¶
func (c *DisableCommand) Respond()
func (*DisableCommand) RespondWithError ¶
func (c *DisableCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type DisableCommandFn ¶
type DisableCommandFn struct {
// contains filtered or unexported fields
}
func (*DisableCommandFn) Load ¶
func (a *DisableCommandFn) Load() func(DisableCommand)
func (*DisableCommandFn) Store ¶
func (a *DisableCommandFn) Store(fn func(DisableCommand))
type DisableReturn ¶
type DisableReturn struct { }
type DispatchSyncEventCommand ¶
type DispatchSyncEventCommand struct { DestinationTargetID string Origin string `json:"origin"` RegistrationId string `json:"registrationId"` Tag string `json:"tag"` LastChance bool `json:"lastChance"` // contains filtered or unexported fields }
func (*DispatchSyncEventCommand) Initalize ¶
func (c *DispatchSyncEventCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*DispatchSyncEventCommand) Respond ¶
func (c *DispatchSyncEventCommand) Respond()
func (*DispatchSyncEventCommand) RespondWithError ¶
func (c *DispatchSyncEventCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type DispatchSyncEventCommandFn ¶
type DispatchSyncEventCommandFn struct {
// contains filtered or unexported fields
}
func (*DispatchSyncEventCommandFn) Load ¶
func (a *DispatchSyncEventCommandFn) Load() func(DispatchSyncEventCommand)
func (*DispatchSyncEventCommandFn) Store ¶
func (a *DispatchSyncEventCommandFn) Store(fn func(DispatchSyncEventCommand))
type DispatchSyncEventReturn ¶
type DispatchSyncEventReturn struct { }
type EnableCommand ¶
type EnableCommand struct { DestinationTargetID string // contains filtered or unexported fields }
func (*EnableCommand) Initalize ¶
func (c *EnableCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*EnableCommand) Respond ¶
func (c *EnableCommand) Respond()
func (*EnableCommand) RespondWithError ¶
func (c *EnableCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type EnableCommandFn ¶
type EnableCommandFn struct {
// contains filtered or unexported fields
}
func (*EnableCommandFn) Load ¶
func (a *EnableCommandFn) Load() func(EnableCommand)
func (*EnableCommandFn) Store ¶
func (a *EnableCommandFn) Store(fn func(EnableCommand))
type EnableReturn ¶
type EnableReturn struct { }
type InspectWorkerCommand ¶
type InspectWorkerCommand struct { DestinationTargetID string VersionId string `json:"versionId"` // contains filtered or unexported fields }
func (*InspectWorkerCommand) Initalize ¶
func (c *InspectWorkerCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*InspectWorkerCommand) Respond ¶
func (c *InspectWorkerCommand) Respond()
func (*InspectWorkerCommand) RespondWithError ¶
func (c *InspectWorkerCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type InspectWorkerCommandFn ¶
type InspectWorkerCommandFn struct {
// contains filtered or unexported fields
}
func (*InspectWorkerCommandFn) Load ¶
func (a *InspectWorkerCommandFn) Load() func(InspectWorkerCommand)
func (*InspectWorkerCommandFn) Store ¶
func (a *InspectWorkerCommandFn) Store(fn func(InspectWorkerCommand))
type InspectWorkerReturn ¶
type InspectWorkerReturn struct { }
type ServiceWorkerAgent ¶
type ServiceWorkerAgent struct {
// contains filtered or unexported fields
}
func NewAgent ¶
func NewAgent(conn *shared.Connection) *ServiceWorkerAgent
func (*ServiceWorkerAgent) FireWorkerErrorReported ¶
func (agent *ServiceWorkerAgent) FireWorkerErrorReported(event WorkerErrorReportedEvent)
func (*ServiceWorkerAgent) FireWorkerErrorReportedOnTarget ¶
func (agent *ServiceWorkerAgent) FireWorkerErrorReportedOnTarget(targetId string, event WorkerErrorReportedEvent)
func (*ServiceWorkerAgent) FireWorkerRegistrationUpdated ¶
func (agent *ServiceWorkerAgent) FireWorkerRegistrationUpdated(event WorkerRegistrationUpdatedEvent)
Dispatchable Events
func (*ServiceWorkerAgent) FireWorkerRegistrationUpdatedOnTarget ¶
func (agent *ServiceWorkerAgent) FireWorkerRegistrationUpdatedOnTarget(targetId string, event WorkerRegistrationUpdatedEvent)
func (*ServiceWorkerAgent) FireWorkerVersionUpdated ¶
func (agent *ServiceWorkerAgent) FireWorkerVersionUpdated(event WorkerVersionUpdatedEvent)
func (*ServiceWorkerAgent) FireWorkerVersionUpdatedOnTarget ¶
func (agent *ServiceWorkerAgent) FireWorkerVersionUpdatedOnTarget(targetId string, event WorkerVersionUpdatedEvent)
func (*ServiceWorkerAgent) Name ¶
func (agent *ServiceWorkerAgent) Name() string
func (*ServiceWorkerAgent) ProcessCommand ¶
func (agent *ServiceWorkerAgent) ProcessCommand(id int64, targetId string, funcName string, data *json.RawMessage)
func (*ServiceWorkerAgent) SetDeliverPushMessageHandler ¶
func (agent *ServiceWorkerAgent) SetDeliverPushMessageHandler(handler func(DeliverPushMessageCommand))
func (*ServiceWorkerAgent) SetDisableHandler ¶
func (agent *ServiceWorkerAgent) SetDisableHandler(handler func(DisableCommand))
func (*ServiceWorkerAgent) SetDispatchSyncEventHandler ¶
func (agent *ServiceWorkerAgent) SetDispatchSyncEventHandler(handler func(DispatchSyncEventCommand))
func (*ServiceWorkerAgent) SetEnableHandler ¶
func (agent *ServiceWorkerAgent) SetEnableHandler(handler func(EnableCommand))
Commands Sent From Frontend
func (*ServiceWorkerAgent) SetInspectWorkerHandler ¶
func (agent *ServiceWorkerAgent) SetInspectWorkerHandler(handler func(InspectWorkerCommand))
func (*ServiceWorkerAgent) SetSetForceUpdateOnPageLoadHandler ¶
func (agent *ServiceWorkerAgent) SetSetForceUpdateOnPageLoadHandler(handler func(SetForceUpdateOnPageLoadCommand))
func (*ServiceWorkerAgent) SetSkipWaitingHandler ¶
func (agent *ServiceWorkerAgent) SetSkipWaitingHandler(handler func(SkipWaitingCommand))
func (*ServiceWorkerAgent) SetStartWorkerHandler ¶
func (agent *ServiceWorkerAgent) SetStartWorkerHandler(handler func(StartWorkerCommand))
func (*ServiceWorkerAgent) SetStopWorkerHandler ¶
func (agent *ServiceWorkerAgent) SetStopWorkerHandler(handler func(StopWorkerCommand))
func (*ServiceWorkerAgent) SetUnregisterHandler ¶
func (agent *ServiceWorkerAgent) SetUnregisterHandler(handler func(UnregisterCommand))
func (*ServiceWorkerAgent) SetUpdateRegistrationHandler ¶
func (agent *ServiceWorkerAgent) SetUpdateRegistrationHandler(handler func(UpdateRegistrationCommand))
type ServiceWorkerVersion ¶
type ServiceWorkerVersion struct { VersionId string `json:"versionId"` RegistrationId string `json:"registrationId"` ScriptURL string `json:"scriptURL"` RunningStatus ServiceWorkerVersionRunningStatus `json:"runningStatus"` Status ServiceWorkerVersionStatus `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.TargetID `json:"controlledClients,omitempty"` TargetId *target.TargetID `json:"targetId,omitempty"` }
type ServiceWorkerVersionRunningStatus ¶
type ServiceWorkerVersionRunningStatus string
const ( ServiceWorkerVersionRunningStatusStopped ServiceWorkerVersionRunningStatus = "stopped" ServiceWorkerVersionRunningStatusStarting ServiceWorkerVersionRunningStatus = "starting" ServiceWorkerVersionRunningStatusRunning ServiceWorkerVersionRunningStatus = "running" ServiceWorkerVersionRunningStatusStopping ServiceWorkerVersionRunningStatus = "stopping" )
type ServiceWorkerVersionStatus ¶
type ServiceWorkerVersionStatus string
const ( ServiceWorkerVersionStatusNew ServiceWorkerVersionStatus = "new" ServiceWorkerVersionStatusInstalling ServiceWorkerVersionStatus = "installing" ServiceWorkerVersionStatusInstalled ServiceWorkerVersionStatus = "installed" ServiceWorkerVersionStatusActivating ServiceWorkerVersionStatus = "activating" ServiceWorkerVersionStatusActivated ServiceWorkerVersionStatus = "activated" ServiceWorkerVersionStatusRedundant ServiceWorkerVersionStatus = "redundant" )
type SetForceUpdateOnPageLoadCommand ¶
type SetForceUpdateOnPageLoadCommand struct { DestinationTargetID string ForceUpdateOnPageLoad bool `json:"forceUpdateOnPageLoad"` // contains filtered or unexported fields }
func (*SetForceUpdateOnPageLoadCommand) Initalize ¶
func (c *SetForceUpdateOnPageLoadCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*SetForceUpdateOnPageLoadCommand) Respond ¶
func (c *SetForceUpdateOnPageLoadCommand) Respond()
func (*SetForceUpdateOnPageLoadCommand) RespondWithError ¶
func (c *SetForceUpdateOnPageLoadCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type SetForceUpdateOnPageLoadCommandFn ¶
type SetForceUpdateOnPageLoadCommandFn struct {
// contains filtered or unexported fields
}
func (*SetForceUpdateOnPageLoadCommandFn) Load ¶
func (a *SetForceUpdateOnPageLoadCommandFn) Load() func(SetForceUpdateOnPageLoadCommand)
func (*SetForceUpdateOnPageLoadCommandFn) Store ¶
func (a *SetForceUpdateOnPageLoadCommandFn) Store(fn func(SetForceUpdateOnPageLoadCommand))
type SetForceUpdateOnPageLoadReturn ¶
type SetForceUpdateOnPageLoadReturn struct { }
type SkipWaitingCommand ¶
type SkipWaitingCommand struct { DestinationTargetID string ScopeURL string `json:"scopeURL"` // contains filtered or unexported fields }
func (*SkipWaitingCommand) Initalize ¶
func (c *SkipWaitingCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*SkipWaitingCommand) Respond ¶
func (c *SkipWaitingCommand) Respond()
func (*SkipWaitingCommand) RespondWithError ¶
func (c *SkipWaitingCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type SkipWaitingCommandFn ¶
type SkipWaitingCommandFn struct {
// contains filtered or unexported fields
}
func (*SkipWaitingCommandFn) Load ¶
func (a *SkipWaitingCommandFn) Load() func(SkipWaitingCommand)
func (*SkipWaitingCommandFn) Store ¶
func (a *SkipWaitingCommandFn) Store(fn func(SkipWaitingCommand))
type SkipWaitingReturn ¶
type SkipWaitingReturn struct { }
type StartWorkerCommand ¶
type StartWorkerCommand struct { DestinationTargetID string ScopeURL string `json:"scopeURL"` // contains filtered or unexported fields }
func (*StartWorkerCommand) Initalize ¶
func (c *StartWorkerCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*StartWorkerCommand) Respond ¶
func (c *StartWorkerCommand) Respond()
func (*StartWorkerCommand) RespondWithError ¶
func (c *StartWorkerCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type StartWorkerCommandFn ¶
type StartWorkerCommandFn struct {
// contains filtered or unexported fields
}
func (*StartWorkerCommandFn) Load ¶
func (a *StartWorkerCommandFn) Load() func(StartWorkerCommand)
func (*StartWorkerCommandFn) Store ¶
func (a *StartWorkerCommandFn) Store(fn func(StartWorkerCommand))
type StartWorkerReturn ¶
type StartWorkerReturn struct { }
type StopWorkerCommand ¶
type StopWorkerCommand struct { DestinationTargetID string VersionId string `json:"versionId"` // contains filtered or unexported fields }
func (*StopWorkerCommand) Initalize ¶
func (c *StopWorkerCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*StopWorkerCommand) Respond ¶
func (c *StopWorkerCommand) Respond()
func (*StopWorkerCommand) RespondWithError ¶
func (c *StopWorkerCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type StopWorkerCommandFn ¶
type StopWorkerCommandFn struct {
// contains filtered or unexported fields
}
func (*StopWorkerCommandFn) Load ¶
func (a *StopWorkerCommandFn) Load() func(StopWorkerCommand)
func (*StopWorkerCommandFn) Store ¶
func (a *StopWorkerCommandFn) Store(fn func(StopWorkerCommand))
type StopWorkerReturn ¶
type StopWorkerReturn struct { }
type UnregisterCommand ¶
type UnregisterCommand struct { DestinationTargetID string ScopeURL string `json:"scopeURL"` // contains filtered or unexported fields }
func (*UnregisterCommand) Initalize ¶
func (c *UnregisterCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*UnregisterCommand) Respond ¶
func (c *UnregisterCommand) Respond()
func (*UnregisterCommand) RespondWithError ¶
func (c *UnregisterCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type UnregisterCommandFn ¶
type UnregisterCommandFn struct {
// contains filtered or unexported fields
}
func (*UnregisterCommandFn) Load ¶
func (a *UnregisterCommandFn) Load() func(UnregisterCommand)
func (*UnregisterCommandFn) Store ¶
func (a *UnregisterCommandFn) Store(fn func(UnregisterCommand))
type UnregisterReturn ¶
type UnregisterReturn struct { }
type UpdateRegistrationCommand ¶
type UpdateRegistrationCommand struct { DestinationTargetID string ScopeURL string `json:"scopeURL"` // contains filtered or unexported fields }
func (*UpdateRegistrationCommand) Initalize ¶
func (c *UpdateRegistrationCommand) Initalize(targetId string, responseId int64, conn *shared.Connection)
func (*UpdateRegistrationCommand) Respond ¶
func (c *UpdateRegistrationCommand) Respond()
func (*UpdateRegistrationCommand) RespondWithError ¶
func (c *UpdateRegistrationCommand) RespondWithError(code shared.ResponseErrorCodes, message string)
type UpdateRegistrationCommandFn ¶
type UpdateRegistrationCommandFn struct {
// contains filtered or unexported fields
}
func (*UpdateRegistrationCommandFn) Load ¶
func (a *UpdateRegistrationCommandFn) Load() func(UpdateRegistrationCommand)
func (*UpdateRegistrationCommandFn) Store ¶
func (a *UpdateRegistrationCommandFn) Store(fn func(UpdateRegistrationCommand))
type UpdateRegistrationReturn ¶
type UpdateRegistrationReturn struct { }
type WorkerErrorReportedEvent ¶
type WorkerErrorReportedEvent struct {
ErrorMessage ServiceWorkerErrorMessage `json:"errorMessage"`
}
type WorkerRegistrationUpdatedEvent ¶
type WorkerRegistrationUpdatedEvent struct {
Registrations []ServiceWorkerRegistration `json:"registrations"`
}
type WorkerVersionUpdatedEvent ¶
type WorkerVersionUpdatedEvent struct {
Versions []ServiceWorkerVersion `json:"versions"`
}
Click to show internal directories.
Click to hide internal directories.