From aae1ca83fcbd876be1adcc427d1d76e51bf44208 Mon Sep 17 00:00:00 2001 From: Heikki Uljas Date: Fri, 18 Nov 2016 09:19:02 +0200 Subject: [PATCH] Use generic params --- melody.go | 2 +- session.go | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/melody.go b/melody.go index 040a1e3..0a502d4 100644 --- a/melody.go +++ b/melody.go @@ -80,7 +80,7 @@ func (m *Melody) HandleRequest(w http.ResponseWriter, r *http.Request) { session := &Session{ Request: r, - params: make(map[string]string), + Params: make(map[string]interface{}), conn: conn, output: make(chan *envelope, m.Config.MessageBufferSize), melody: m, diff --git a/session.go b/session.go index 1373bb8..f7fe15c 100644 --- a/session.go +++ b/session.go @@ -10,7 +10,7 @@ import ( // A melody session. type Session struct { Request *http.Request - params map[string]interface{} + Params map[string]interface{} conn *websocket.Conn output chan *envelope melody *Melody @@ -118,13 +118,3 @@ func (s *Session) WriteBinary(msg []byte) { func (s *Session) Close() { s.writeMessage(&envelope{t: websocket.CloseMessage, msg: []byte{}}) } - -// Set session param -func (s *Session) SetParam(key string, value interface{}) { - s.params[key] = value -} - -// Get session param -func (s *Session) GetParam(key string) (bool, interface{}) { - return s.params[key] -}