Documentation
¶
Overview ¶
Package wshub provides a websocket server and client using gorilla/websocket for package hub.
Index ¶
- Variables
- func WSURL(url string) string
- type Backoff
- type Client
- func (c *Client) Chan() chan<- *hub.Msg
- func (c *Client) Ctx() context.Context
- func (c *Client) ID() int64
- func (c *Client) Run(r chan<- *hub.Msg) error
- func (c *Client) RunWithBackoff(r chan<- *hub.Msg, bof Backoff) error
- func (c *Client) Start(r chan<- *hub.Msg) error
- func (c *Client) User() string
- type Config
- type Server
- type TokenProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var AsBinary msgKind = websocket.BinaryMessage
Functions ¶
Types ¶
type Client ¶
type Client struct { Config // contains filtered or unexported fields }
Client is connection to a hub served over websockets.
func (*Client) Run ¶
Run connects the client and blocks while sending incoming messages to r and returns an error.
func (*Client) RunWithBackoff ¶
RunWithBackoff blocks while running and reconnecting using a backoff function.
Click to show internal directories.
Click to hide internal directories.