overflow_server_app/server/context.go
2017-08-23 18:19:21 +09:00

20 lines
378 B
Go

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
}