Documentation ¶
Index ¶
- func Listen(port int32) error
- type Client
- type ClientListener
- type ClientManager
- type Publisher
- type Websocket
- type WebsocketClientConnection
- type WebsocketClientListener
- type WebsocketClientManager
- func (c *WebsocketClientManager) AddClient(conn Client)
- func (c *WebsocketClientManager) AddClientRouting(id string, conn Client)
- func (c *WebsocketClientManager) CloseAllClients()
- func (c *WebsocketClientManager) GetClientRouting(id string) (Client, error)
- func (c *WebsocketClientManager) Process(ctx context.Context, conn Websocket)
- func (c *WebsocketClientManager) RemoveClientRouting(id string)
- type WebsocketServer
- type WebsocketServerWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientListener ¶
type ClientListener interface {
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
func NewWebsocketClientListener ¶
func NewWebsocketClientListener(websocketServer WebsocketServer, clientManager ClientManager) ClientListener
type ClientManager ¶
type WebsocketClientConnection ¶
type WebsocketClientConnection struct {
// contains filtered or unexported fields
}
func NewWebsocketClient ¶
func NewWebsocketClient(conn Websocket) *WebsocketClientConnection
func (*WebsocketClientConnection) Close ¶
func (c *WebsocketClientConnection) Close() error
func (*WebsocketClientConnection) HandleMessage ¶
type WebsocketClientListener ¶
type WebsocketClientListener struct {
// contains filtered or unexported fields
}
func (WebsocketClientListener) ServeHTTP ¶
func (c WebsocketClientListener) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type WebsocketClientManager ¶
type WebsocketClientManager struct {
// contains filtered or unexported fields
}
func NewWebsocketClientManager ¶
func NewWebsocketClientManager() *WebsocketClientManager
func (*WebsocketClientManager) AddClient ¶
func (c *WebsocketClientManager) AddClient(conn Client)
func (*WebsocketClientManager) AddClientRouting ¶
func (c *WebsocketClientManager) AddClientRouting(id string, conn Client)
func (*WebsocketClientManager) CloseAllClients ¶
func (c *WebsocketClientManager) CloseAllClients()
func (*WebsocketClientManager) GetClientRouting ¶
func (c *WebsocketClientManager) GetClientRouting(id string) (Client, error)
func (*WebsocketClientManager) Process ¶
func (c *WebsocketClientManager) Process(ctx context.Context, conn Websocket)
RegisterClient waits for a subscribe message from the client (required) and then registers a client to the client manager.
func (*WebsocketClientManager) RemoveClientRouting ¶
func (c *WebsocketClientManager) RemoveClientRouting(id string)
type WebsocketServer ¶
type WebsocketServer interface {
Accept(w http.ResponseWriter, r *http.Request, opts *ws.AcceptOptions) (Websocket, error)
}
type WebsocketServerWrapper ¶
type WebsocketServerWrapper struct{}
func (*WebsocketServerWrapper) Accept ¶
func (w *WebsocketServerWrapper) Accept(rw http.ResponseWriter, r *http.Request, opts *ws.AcceptOptions) (Websocket, error)
Click to show internal directories.
Click to hide internal directories.