func Clear(r *http.Request)
Clear removes all values stored for a given request.
This is usually called by a handler wrapper to clean up request variables at the end of a request lifetime. See ClearHandler().
func ClearHandler(h http.Handler) http.Handler
ClearHandler wraps an http.Handler and clears request values at the end of a request lifetime.
func Delete(r *http.Request, key interface{})
Delete removes a value stored for a given key in a given request.
func Get(r *http.Request, key interface{}) interface{}
Get returns a value stored for a given key in a given request.
func GetAll(r *http.Request) map[interface{}]interface{}
GetAll returns all stored values for the request as a map. Nil is returned for invalid requests.
func GetAllOk(r *http.Request) (map[interface{}]interface{}, bool)
GetAllOk returns all stored values for the request as a map and a boolean value that indicates if the request was registered.
func GetOk(r *http.Request, key interface{}) (interface{}, bool)
GetOk returns stored value and presence state like multi-value return of map access.
func Purge(maxAge int) int
Purge removes request data stored for longer than maxAge, in seconds. It returns the amount of requests removed.
If maxAge <= 0, all request data is removed.
This is only used for sanity check: in case context cleaning was not properly set some request data can be kept forever, consuming an increasing amount of memory. In case this is detected, Purge() must be called periodically until the problem is fixed.
func Set(r *http.Request, key, val interface{})
Set stores a value for a given key in a given request.