Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(conn *websocket.Conn, pool *Pool) *Connection
func (*Connection) Close ¶
func (c *Connection) Close(status websocket.StatusCode, reason string)
func (*Connection) WriteBinary ¶
func (c *Connection) WriteBinary(body []byte) error
func (*Connection) WriteJSON ¶
func (c *Connection) WriteJSON(body interface{}) error
func (*Connection) WriteText ¶
func (c *Connection) WriteText(body []byte) error
type Message ¶
type Message struct { Type websocket.MessageType `json:"type"` Body string `json:"body"` }
type Pool ¶
type Pool struct { Register chan *Connection Unregister chan *Connection Connections map[*Connection]bool BroadcastJSON chan interface{} }
Click to show internal directories.
Click to hide internal directories.