From fad38bc8b3918203a842e30e76e5e0169cfc1fb9 Mon Sep 17 00:00:00 2001 From: Heikki Uljas Date: Fri, 18 Nov 2016 09:14:19 +0200 Subject: [PATCH] Changed session params to be generic type --- session.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/session.go b/session.go index 35dc223..1373bb8 100644 --- a/session.go +++ b/session.go @@ -10,7 +10,7 @@ import ( // A melody session. type Session struct { Request *http.Request - params map[string]string + params map[string]interface{} conn *websocket.Conn output chan *envelope melody *Melody @@ -120,11 +120,11 @@ func (s *Session) Close() { } // Set session param -func (s *Session) SetParam(key string, value string) { +func (s *Session) SetParam(key string, value interface{}) { s.params[key] = value } // Get session param -func (s *Session) GetParam(key string) string { +func (s *Session) GetParam(key string) (bool, interface{}) { return s.params[key] }