Documentation
¶
Index ¶
- Variables
- func Broadcast(msg []byte, ringID int) error
- func CloseConnection(id string)
- func ConstructMessage(action Action, params []interface{}) ([]byte, error)
- func Notify(msg []byte, id string) (err error)
- func NotifyCompetitorChange(ringID int) error
- func NotifyHeadJudge(msg []byte, ringID int) error
- func WSServer(w http.ResponseWriter, r *http.Request, msgCB OnMessage)
- type Action
- type Connection
- type Message
- type OnMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidAction = fmt.Errorf("invalid API action")
View Source
var (
Manager *websocket.Manager
)
Functions ¶
func CloseConnection ¶
func CloseConnection(id string)
func ConstructMessage ¶
func NotifyCompetitorChange ¶
func NotifyHeadJudge ¶
Types ¶
type Action ¶
type Action int
const ( // Client actions AdjustScore Action = iota // adjust-score CalculateScore // calculate-score ChangeCompetitor // change-competitor ChangeEvent // change-event FinalizeScore // finalize-score RegisterDisplay // register-display RegisterJudge // register-judge StartTimer // start-timer StopTimer // stop-timer SubmitDeductions // submit-deductions SubmitNandu // submit-nandu SubmitScore // submit-score // Server actions ClientInit // init ListCompetitors // list-competitors ListEvents // list-events NotifyCompetitor // notify-competitor NotifyEvent // notify-event NotifyFinalScore // notify-final-score Rescore // rescore RingStatus // ring-status RingUpdate // ring-update Score // score StartEvent // start-event StopEvent // stop-event LastDisplay // last-display LiveDisplay // live-display // Error InvalidAction // invalid )
type Connection ¶
type Connection struct { ID string // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(ws *gorilla.Conn) *Connection
type OnMessage ¶
type OnMessage func(*Connection, Message)
Click to show internal directories.
Click to hide internal directories.