add controller into client

This commit is contained in:
xdrm-brackets 2018-04-26 23:39:20 +02:00
parent 756bbca0b1
commit 844bdf14c6
1 changed files with 3 additions and 1 deletions

View File

@ -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)
}