overflow_server_app/server/context.go

20 lines
378 B
Go
Raw Normal View History

2017-08-23 09:19:21 +00:00
package server
type ServerContext struct {
values map[interface{}]interface{}
}
func (c *ServerContext) Value(key interface{}) interface{} {
if nil == c.values {
return nil
}
return c.values[key]
}
func (c *ServerContext) setValue(key interface{}, value interface{}) {
if nil == c.values {
c.values = make(map[interface{}]interface{}, 1)
}
c.values[key] = value
}