serviceworker

package
v0.0.0-...-076f285 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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 (*DeliverPushMessageCommandFn) Store

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 (*DispatchSyncEventCommandFn) Store

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 (*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 ServiceWorkerErrorMessage

type ServiceWorkerErrorMessage struct {
	ErrorMessage   string `json:"errorMessage"`
	RegistrationId string `json:"registrationId"`
	VersionId      string `json:"versionId"`
	SourceURL      string `json:"sourceURL"`
	LineNumber     int64  `json:"lineNumber"`
	ColumnNumber   int64  `json:"columnNumber"`
}

type ServiceWorkerRegistration

type ServiceWorkerRegistration struct {
	RegistrationId string `json:"registrationId"`
	ScopeURL       string `json:"scopeURL"`
	IsDeleted      bool   `json:"isDeleted"`
}

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 (*SetForceUpdateOnPageLoadCommandFn) Store

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 (*UpdateRegistrationCommandFn) Store

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL