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

Function foo

functions/knative/path-parameters-function-go/http.go:40–48  ·  view source on GitHub ↗
(ctx context.Context, ce cloudevents.Event)

Source from the content-addressed store, hash-verified

38}
39
40func foo(ctx context.Context, ce cloudevents.Event) error {
41 vars := ofctx.VarsFromCtx(ctx)
42 response := map[string]string{
43 string(ce.Data()): vars["name"],
44 }
45 responseBytes, _ := json.Marshal(response)
46 klog.Infof("cloudevent - Data: %s", string(responseBytes))
47 return nil
48}
49
50func bar(ctx ofctx.Context, in []byte) (ofctx.Out, error) {
51 vars := ofctx.VarsFromCtx(ctx.GetNativeContext())

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected