Documentation ¶
Index ¶
Constants ¶
View Source
const (
MessageDecodeError = `message decoding failed`
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server is our websocket server.
func (*Server) Listener ¶
Listener method listens to new messages from the user who has established a ws connection with server.
func (*Server) SendToAll ¶
SendToAll method broadcasts a message to all users connected to the server.
func (*Server) WebsocketHandler ¶
func (s *Server) WebsocketHandler(w http.ResponseWriter, r *http.Request)
WebsocketHandler handles a websocket conn initiation and starts a listener.
Click to show internal directories.
Click to hide internal directories.