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

Function init

functions/knative/path-parameters-function-go/http.go:14–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12)
13
14func init() {
15 functions.HTTP("Hello", hello,
16 functions.WithFunctionPath("/hello/{name}"),
17 functions.WithFunctionMethods("GET", "POST"),
18 )
19
20 functions.CloudEvent("Foo", foo,
21 functions.WithFunctionPath("/foo/{name}"),
22 )
23
24 functions.OpenFunction("Bar", bar,
25 functions.WithFunctionPath("/bar/{name}"),
26 functions.WithFunctionMethods("GET", "POST"),
27 )
28}
29
30func hello(w http.ResponseWriter, r *http.Request) {
31 vars := ofctx.VarsFromCtx(r.Context())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected