add controller into client
This commit is contained in:
parent
756bbca0b1
commit
844bdf14c6
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
// Represents a websocket controller callback function
|
||||
type ControllerFunc func(Client, Frame)
|
||||
type ControllerFunc func(*Client, *Frame)
|
||||
|
||||
// Represents a websocket controller
|
||||
type Controller struct {
|
||||
|
@ -21,6 +21,8 @@ type Client struct {
|
|||
soc net.Conn // communication socket
|
||||
pro string // choosen protocol (Sec-WebSocket-Protocol)
|
||||
arg [][]string // URI parameters, index 0 is full URI, then matching groups
|
||||
|
||||
ctl *Controller // assigned controller
|
||||
Dat interface{} // store (for client implementation-specific data)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue