Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerContext ¶
type ServerContext struct {
persistence.UserRepository
routing.Switchboard
}
ServerContext maintains the map of controller IDs and their corresponding channels linked to the active websocket
func NewServerContext ¶
func NewServerContext(persistenceBackend persistence.Backend) *ServerContext
NewServerContext returns a pointer to a new instance
func (*ServerContext) HTTPConn ¶
func (sCtx *ServerContext) HTTPConn(w http.ResponseWriter, r *http.Request)
HTTPConn receives requests via http and routes them to the correct Raspberry Pi websocket connection
func (*ServerContext) WebsocketConn ¶
func (sCtx *ServerContext) WebsocketConn(ws *websocket.Conn)
WebsocketConn manages websocket connections coming from the Raspberry Pis and user devices
Click to show internal directories.
Click to hide internal directories.