MCPcopy Create free account
hub / github.com/OpenFunction/samples / hello

Function hello

functions/knative/path-parameters-function-go/http.go:30–38  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

28}
29
30func hello(w http.ResponseWriter, r *http.Request) {
31 vars := ofctx.VarsFromCtx(r.Context())
32 response := map[string]string{
33 "hello": vars["name"],
34 }
35 responseBytes, _ := json.Marshal(response)
36 w.Header().Set("Content-type", "application/json")
37 w.Write(responseBytes)
38}
39
40func foo(ctx context.Context, ce cloudevents.Event) error {
41 vars := ofctx.VarsFromCtx(ctx)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected