summaryrefslogtreecommitdiff
path: root/service/http/attributes
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-07-26 16:32:27 +0300
committerWolfy-J <[email protected]>2018-07-26 16:32:27 +0300
commitbcef5b36bb50b2fecd4db4ca8e01640347300bea (patch)
treeb6db6954063dd3288a80f24aa714e8799664d909 /service/http/attributes
parent0f8e2bab6888f1b27ed2bd1b91ac6b2677f03450 (diff)
- added support for custom env provider
- new config section "env" to share env variables with php process - container can resolve interfaces now
Diffstat (limited to 'service/http/attributes')
-rw-r--r--service/http/attributes/attributes.go8
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)