This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
JISQueueing/server/socket/display.go

24 lines
441 B
Go

package socket
import (
"github.com/gorilla/websocket"
)
var displays = make(map[*websocket.Conn]bool)
func onNewDisplay(who *websocket.Conn) {
displays[who] = true
}
func onDisplayMessage(who *websocket.Conn, msg string) {
}
func onDisplayDisconnect(who *websocket.Conn) {
delete(displays, who)
}
func sendDisplayMessage(msg string) {
for display := range displays {
display.WriteMessage(websocket.TextMessage, []byte(msg))
}
}