Documentation
¶
Index ¶
- func WSHTTPHandler(w http.ResponseWriter, r *http.Request, wsl *WSListener)
- func WSHandle(c *websocket.Conn, wsl *WSListener)
- type UpdateListener
- type WSDialer
- type WSListener
- func (wsl *WSListener) AddListener(l UpdateListener)
- func (wsl *WSListener) Receive(w http.ResponseWriter, r *http.Request)
- func (wsl *WSListener) RemoveListener(l UpdateListener)
- func (wsl *WSListener) Run(url string, dialer *WSDialer)
- func (wsl *WSListener) Status() (time.Time, int, map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WSHTTPHandler ¶
func WSHTTPHandler(w http.ResponseWriter, r *http.Request, wsl *WSListener)
wsHandler handles an inbound HTTP WS connection.
func WSHandle ¶
func WSHandle(c *websocket.Conn, wsl *WSListener)
wsHandler handles an inbound WS connection.
Types ¶
type UpdateListener ¶
type UpdateListener interface {
// What just changed and the new full state.
Update(update, full map[string]interface{})
}
type WSDialer ¶
type WSDialer struct {
// contains filtered or unexported fields
}
func NewWSDialer ¶
type WSListener ¶
type WSListener struct {
// contains filtered or unexported fields
}
A WSListener represents a connection to a Scoreboard, which listens to WS updates and forwards them on.
func NewWSListener ¶
func NewWSListener(kf *keyfilter.KeyFilter) *WSListener
func (*WSListener) AddListener ¶
func (wsl *WSListener) AddListener(l UpdateListener)
AddListener adds a listener.
The initial update will be in the same thread.
func (*WSListener) Receive ¶
func (wsl *WSListener) Receive(w http.ResponseWriter, r *http.Request)
Receive uses an inbound WS connection. This is an alternative to Run.
func (*WSListener) RemoveListener ¶
func (wsl *WSListener) RemoveListener(l UpdateListener)
AddListener removes a listener.
func (*WSListener) Run ¶
func (wsl *WSListener) Run(url string, dialer *WSDialer)
Run keeps a WS connection open to the given URL.
Click to show internal directories.
Click to hide internal directories.