mirror of
https://github.com/openfaas/faasd.git
synced 2025-06-09 00:16:46 +00:00
This patch completes part of the work in #20 by porting the code for faas-containerd in-tree. When tested, I was able to deploy and then remove figlet from the store on `x86_64`. In a follow-up PR, duplication will be removed where possible and consolidated with updated documentation. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
19 lines
315 B
Go
19 lines
315 B
Go
package mux
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
func contextGet(r *http.Request, key interface{}) interface{} {
|
|
return r.Context().Value(key)
|
|
}
|
|
|
|
func contextSet(r *http.Request, key, val interface{}) *http.Request {
|
|
if val == nil {
|
|
return r
|
|
}
|
|
|
|
return r.WithContext(context.WithValue(r.Context(), key, val))
|
|
}
|