Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Set func(r *http.Request, key, val interface{}) = context.Set Get func(r *http.Request, key interface{}) interface{} = context.Get GetOk func(r *http.Request, key interface{}) (interface{}, bool) = context.GetOk GetAll func(r *http.Request) map[interface{}]interface{} = context.GetAll GetAllOk func(r *http.Request) (map[interface{}]interface{}, bool) = context.GetAllOk Delete func(r *http.Request, key interface{}) = context.Delete Clear func(r *http.Request) = context.Clear Purge func(maxAge int) int = context.Purge // ClearHandler !!!: 能有效避免内存泄露. ClearHandler func(h http.Handler) http.Handler = context.ClearHandler )
Functions ¶
func AttachKeyValue ¶
AttachKeyValue 在现有的上下文 (context) 中存储 1个 键值对,并返回一个新的上下文.
PS: (1) 同一个Context实例,多次调用此方法 且 key相同,则覆盖之前的值. (2) 对于同一个Context实例,不推荐调用太多次此方法,因为: 每调用一次就是嵌套一层,会嵌套太多层.
@param ctx 不能为nil
func AttachKeyValueMap
deprecated
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.