2017-05-11 13:04:43 +00:00
|
|
|
// +build no_ws
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2017-06-10 07:58:15 +00:00
|
|
|
import "errors"
|
2017-05-11 13:04:43 +00:00
|
|
|
import "net/http"
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
// TODO: Disable WebSockets on high load? Add a Control Panel interface for disabling it?
|
|
|
|
var enableWebsockets = false // Put this in caps for consistency with the other constants?
|
|
|
|
|
|
|
|
var wsHub WSHub
|
2017-09-10 16:57:22 +00:00
|
|
|
var errWsNouser = errors.New("This user isn't connected via WebSockets")
|
2017-05-11 13:04:43 +00:00
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
type WSHub struct {
|
2017-05-11 13:04:43 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (_ *WSHub) guestCount() int {
|
2017-05-11 13:04:43 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (_ *WSHub) userCount() int {
|
2017-05-11 13:04:43 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (hub *WSHub) broadcastMessage(_ string) error {
|
2017-06-10 07:58:15 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (hub *WSHub) pushMessage(_ int, _ string) error {
|
2017-09-10 16:57:22 +00:00
|
|
|
return errWsNouser
|
2017-06-10 07:58:15 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (hub *WSHub) pushAlert(_ int, _ int, _ string, _ string, _ int, _ int, _ int) error {
|
2017-09-10 16:57:22 +00:00
|
|
|
return errWsNouser
|
2017-06-10 07:58:15 +00:00
|
|
|
}
|
|
|
|
|
2017-09-13 15:09:13 +00:00
|
|
|
func (hub *WSHub) pushAlerts(_ []int, _ int, _ string, _ string, _ int, _ int, _ int) error {
|
2017-09-10 16:57:22 +00:00
|
|
|
return errWsNouser
|
2017-06-12 09:03:14 +00:00
|
|
|
}
|
|
|
|
|
2017-09-11 10:24:03 +00:00
|
|
|
func routeWebsockets(_ http.ResponseWriter, _ *http.Request, _ User) {
|
2017-05-11 13:04:43 +00:00
|
|
|
}
|