Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SocketChannel is the main channel where all chat messages are aggregated and passed to open web sockets SocketChannel = make(chan *SocketMessage, 10000) )
Functions ¶
func HandleWebSocketConnections ¶
func HandleWebSocketConnections() echo.HandlerFunc
HandleWebSocketConnections sets up handling websocket connections for echo
func WriteToWebSocket ¶
WriteToWebSocket is a quick helper function to write to an open web socket
Types ¶
type SocketMessage ¶
type SocketMessage struct { Message string `json:"message"` Source string `json:"source"` User string `json:"user"` }
SocketMessage is used to submit a message entry back to websocket listeners. easyjson:json
func (SocketMessage) MarshalEasyJSON ¶
func (v SocketMessage) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SocketMessage) MarshalJSON ¶
func (v SocketMessage) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SocketMessage) UnmarshalEasyJSON ¶
func (v *SocketMessage) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SocketMessage) UnmarshalJSON ¶
func (v *SocketMessage) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.