From 844bdf14c603f409cbb603c39b2002855e581053 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 26 Apr 2018 23:39:20 +0200 Subject: [PATCH] add controller into client --- ws/types.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ws/types.go b/ws/types.go index 1216029..1a467e8 100644 --- a/ws/types.go +++ b/ws/types.go @@ -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) }