Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnClosed = errors.New("Connection is closed")
View Source
var (
ErrNoUrlProvided = errors.New("No URL provided")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Connection ¶
type Conn ¶
type Conn struct { ID string ReceiveChan chan []byte ClientAddr net.Addr // contains filtered or unexported fields }
Conn wraps a websocket.Conn to provide channels for reading and writing
func (*Conn) LocalAddrStr ¶
type NewConnHandler ¶
type NewConnHandler func(*Conn)
NewConnHandler is called whenever a new connection to this WebSocket server is created. It receives the relevant Conn, allowing for easy access to its ReceiveChan and SendChan.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a WebSocket server.
func NewServer ¶
func NewServer(newConnHandler NewConnHandler) (*Server, error)
NewServer creates and returns a new WebSocket server.
func (*Server) Connection ¶
func (*Server) Connections ¶
Click to show internal directories.
Click to hide internal directories.