Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Provide(func(game *game.Game) *Server { return NewServer(game, "8000") })
Module ... fx module export
Functions ¶
This section is empty.
Types ¶
type DisplayRoom ¶
DisplayRoom ...
func NewDisplayRoom ¶
func NewDisplayRoom(room *game.Room) *DisplayRoom
NewDisplayRoom ... creates new display room message
type Message ¶
type Message struct { Type string `json:"type"` Username string `json:"username"` Message string `json:"message"` }
Message ... Define our message object
func NewWebSocketMessage ¶
NewWebSocketMessage ... creates a new Websocket message
type MessageHandler ¶
type MessageHandler struct {
// contains filtered or unexported fields
}
MessageHandler ... tcp ..
func NewMessageHandler ¶
func NewMessageHandler(server *Server) *MessageHandler
NewMessageHandler ... creates a new message handler
func (*MessageHandler) OnMessage ¶
func (messageHandler *MessageHandler) OnMessage(message interface{})
OnMessage .. broadcast receiver
type Server ¶
type Server struct { Clients map[*websocket.Conn]bool Users map[string]*websocket.Conn Broadcast chan Message MessageHandler *MessageHandler // contains filtered or unexported fields }
Server ... Define our message object
func (*Server) OnSystemMessage ¶
OnSystemMessage .. broadcast receiver
Click to show internal directories.
Click to hide internal directories.