Changed session params to be generic type
This commit is contained in:
+3
-3
@@ -10,7 +10,7 @@ import (
|
|||||||
// A melody session.
|
// A melody session.
|
||||||
type Session struct {
|
type Session struct {
|
||||||
Request *http.Request
|
Request *http.Request
|
||||||
params map[string]string
|
params map[string]interface{}
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
output chan *envelope
|
output chan *envelope
|
||||||
melody *Melody
|
melody *Melody
|
||||||
@@ -120,11 +120,11 @@ func (s *Session) Close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set session param
|
// Set session param
|
||||||
func (s *Session) SetParam(key string, value string) {
|
func (s *Session) SetParam(key string, value interface{}) {
|
||||||
s.params[key] = value
|
s.params[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get session param
|
// Get session param
|
||||||
func (s *Session) GetParam(key string) string {
|
func (s *Session) GetParam(key string) (bool, interface{}) {
|
||||||
return s.params[key]
|
return s.params[key]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user