diff options
Diffstat (limited to 'service/http/attributes/attributes.go')
-rw-r--r-- | service/http/attributes/attributes.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/service/http/attributes/attributes.go b/service/http/attributes/attributes.go index 94d0e9c1..77d6ea69 100644 --- a/service/http/attributes/attributes.go +++ b/service/http/attributes/attributes.go @@ -6,7 +6,9 @@ import ( "net/http" ) -const contextKey = "psr:attributes" +type attrKey int + +const contextKey attrKey = iota type attrs map[string]interface{} @@ -41,7 +43,7 @@ func All(r *http.Request) map[string]interface{} { return v.(attrs) } -// get gets the value from request context. It replaces any existing +// Get gets the value from request context. It replaces any existing // values. func Get(r *http.Request, key string) interface{} { v := r.Context().Value(contextKey) @@ -52,7 +54,7 @@ func Get(r *http.Request, key string) interface{} { return v.(attrs).get(key) } -// set sets the key to value. It replaces any existing +// Set sets the key to value. It replaces any existing // values. Context specific. func Set(r *http.Request, key string, value interface{}) error { v := r.Context().Value(contextKey) |