Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Time allowed to write a message to the peer. WriteWait = 10 * time.Second // Time allowed to read the next pong message from the peer. PongWait = 60 * time.Second // Send pings to peer with this period. Must be less than pongWait. PingPeriod = (PongWait * 9) / 10 // Maximum message size allowed from peer. MaxMessageSize = 512 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
func NewCommand ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(id ID, hub *Hub, socket *websocket.Conn) *Connection
func (*Connection) Broadcast ¶
func (c *Connection) Broadcast(cmd *Command)
func (*Connection) ID ¶
func (c *Connection) ID() ID
func (*Connection) Log ¶
func (c *Connection) Log(log string)
func (*Connection) RegisterCloseHandler ¶
func (c *Connection) RegisterCloseHandler(name string, handler Handler)
func (*Connection) Send ¶
func (c *Connection) Send(to ID, cmd *Command)
func (*Connection) UnregisterCloseHandler ¶
func (c *Connection) UnregisterCloseHandler(name string)
type Handler ¶
type Handler func(*Connection, *Command)
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
func (*Hub) RegisterHandler ¶
Click to show internal directories.
Click to hide internal directories.