Documentation ¶
Index ¶
- Constants
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (n int, err error)
- func (c *Conn) ReadMessage(buf []byte) (p []byte, err error)
- func (c *Conn) ReadTextMessage() (p string, err error)
- func (c *Conn) ReceiveMessage(v interface{}) (err error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SendMessage(v interface{}) (err error)
- func (c *Conn) SetConcurrency(concurrency func() int)
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (n int, err error)
- func (c *Conn) WriteMessage(b []byte) (err error)
- func (c *Conn) WriteTextMessage(b string) (err error)
- type Handler
Constants ¶
const ( // ContinuationFrame represents a WebSocket continuation frame. ContinuationFrame = 0x0 // TextFrame represents a WebSocket text frame. TextFrame = 0x1 // BinaryFrame represents a WebSocket binary frame. BinaryFrame = 0x2 // CloseFrame represents a WebSocket close frame. CloseFrame = 0x8 // PingFrame represents a WebSocket ping frame. PingFrame = 0x9 // PongFrame represents a WebSocket pong frame. PongFrame = 0xA )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a WebSocket connection.
func UpgradeHTTP ¶
UpgradeHTTP upgrades the HTTP server connection to the WebSocket protocol.
func (*Conn) LocalAddr ¶
LocalAddr returns the local network address. The Addr returned is shared by all invocations of LocalAddr, so do not modify it.
func (*Conn) ReadMessage ¶
ReadMessage reads single message from ws.
func (*Conn) ReadTextMessage ¶
ReadTextMessage reads single text message from ws.
func (*Conn) ReceiveMessage ¶
ReceiveMessage receives single frame from ws, unmarshaled and stores in v.
func (*Conn) RemoteAddr ¶
RemoteAddr returns the remote network address. The Addr returned is shared by all invocations of RemoteAddr, so do not modify it.
func (*Conn) SendMessage ¶
SendMessage sends v marshaled as single frame to ws.
func (*Conn) SetConcurrency ¶
SetConcurrency sets a callback func concurrency for writer.
func (*Conn) SetDeadline ¶
SetDeadline implements the Conn SetDeadline method.
func (*Conn) SetReadDeadline ¶
SetReadDeadline implements the Conn SetReadDeadline method.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline implements the Conn SetWriteDeadline method.
func (*Conn) WriteMessage ¶
WriteMessage writes single message to ws.
func (*Conn) WriteTextMessage ¶
WriteTextMessage writes single text message to ws.