Documentation
¶
Index ¶
- Constants
- func NewSRPCServiceWorkerHostHandler(impl SRPCServiceWorkerHostServer, serviceID string) srpc.Handler
- func NewServiceWorkerHost(handler ServiceWorkerHandler) *serviceWorkerHost
- func SRPCRegisterServiceWorkerHost(mux srpc.Mux, impl SRPCServiceWorkerHostServer) error
- type SRPCServiceWorkerHostClient
- type SRPCServiceWorkerHostHandler
- func (SRPCServiceWorkerHostHandler) GetMethodIDs() []string
- func (d *SRPCServiceWorkerHostHandler) GetServiceID() string
- func (d *SRPCServiceWorkerHostHandler) InvokeMethod(serviceID, methodID string, strm srpc.Stream) (bool, error)
- func (SRPCServiceWorkerHostHandler) InvokeMethod_Fetch(impl SRPCServiceWorkerHostServer, strm srpc.Stream) error
- type SRPCServiceWorkerHostServer
- type SRPCServiceWorkerHost_FetchClient
- type SRPCServiceWorkerHost_FetchStream
- type ServiceWorkerHandler
Constants ¶
View Source
const SRPCServiceWorkerHostServiceID = "web.runtime.sw.ServiceWorkerHost"
Variables ¶
This section is empty.
Functions ¶
func NewSRPCServiceWorkerHostHandler ¶
func NewSRPCServiceWorkerHostHandler(impl SRPCServiceWorkerHostServer, serviceID string) srpc.Handler
NewSRPCServiceWorkerHostHandler constructs a new RPC handler. serviceID: if empty, uses default: web.runtime.sw.ServiceWorkerHost
func NewServiceWorkerHost ¶
func NewServiceWorkerHost(handler ServiceWorkerHandler) *serviceWorkerHost
NewServiceWorkerHost builds the ServiceWorkerHost bound to the Handler.
func SRPCRegisterServiceWorkerHost ¶
func SRPCRegisterServiceWorkerHost(mux srpc.Mux, impl SRPCServiceWorkerHostServer) error
SRPCRegisterServiceWorkerHost registers the implementation with the mux. Uses the default serviceID: web.runtime.sw.ServiceWorkerHost
Types ¶
type SRPCServiceWorkerHostClient ¶
type SRPCServiceWorkerHostClient interface {
// SRPCClient returns the underlying SRPC client.
SRPCClient() srpc.Client
// Fetch proxies a Fetch request with a streaming response.
Fetch(ctx context.Context) (SRPCServiceWorkerHost_FetchClient, error)
}
func NewSRPCServiceWorkerHostClient ¶
func NewSRPCServiceWorkerHostClient(cc srpc.Client) SRPCServiceWorkerHostClient
func NewSRPCServiceWorkerHostClientWithServiceID ¶
func NewSRPCServiceWorkerHostClientWithServiceID(cc srpc.Client, serviceID string) SRPCServiceWorkerHostClient
type SRPCServiceWorkerHostHandler ¶
type SRPCServiceWorkerHostHandler struct {
// contains filtered or unexported fields
}
func (SRPCServiceWorkerHostHandler) GetMethodIDs ¶
func (SRPCServiceWorkerHostHandler) GetMethodIDs() []string
func (*SRPCServiceWorkerHostHandler) GetServiceID ¶
func (d *SRPCServiceWorkerHostHandler) GetServiceID() string
func (*SRPCServiceWorkerHostHandler) InvokeMethod ¶
func (SRPCServiceWorkerHostHandler) InvokeMethod_Fetch ¶
func (SRPCServiceWorkerHostHandler) InvokeMethod_Fetch(impl SRPCServiceWorkerHostServer, strm srpc.Stream) error
type SRPCServiceWorkerHostServer ¶
type SRPCServiceWorkerHostServer interface {
// Fetch proxies a Fetch request with a streaming response.
Fetch(SRPCServiceWorkerHost_FetchStream) error
}
type SRPCServiceWorkerHost_FetchClient ¶
type SRPCServiceWorkerHost_FetchClient interface {
srpc.Stream
Send(*web_fetch.FetchRequest) error
Recv() (*web_fetch.FetchResponse, error)
RecvTo(*web_fetch.FetchResponse) error
}
type SRPCServiceWorkerHost_FetchStream ¶
type SRPCServiceWorkerHost_FetchStream interface {
srpc.Stream
Send(*web_fetch.FetchResponse) error
SendAndClose(*web_fetch.FetchResponse) error
Recv() (*web_fetch.FetchRequest, error)
RecvTo(*web_fetch.FetchRequest) error
}
type ServiceWorkerHandler ¶
type ServiceWorkerHandler interface {
// HandleFetch handles an incoming Fetch request from the ServiceWorker.
// The Client ID can be used to distinguish between windows / browser tabs.
HandleFetch(strm fetch.SRPCFetchService_FetchStream) error
}
ServiceWorkerHandler is the handler for the ServiceWorker.
Click to show internal directories.
Click to hide internal directories.