-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support defining variables and methods and fix some issues #52
Conversation
…fine some features. fix some issues. add tests. close OpenFunction#51 Signed-off-by: Lize Cai <lize.cai@sap.com>
a9592c6
to
f2daea2
Compare
Signed-off-by: Lize Cai <lize.cai@sap.com>
f2daea2
to
0c56a30
Compare
defer RecoverPanicHTTP(w, "Function panic") | ||
rm.FunctionRunWrapperWithHooks(rf.GetOpenFunctionFunction()) | ||
|
||
switch rm.FuncOut.GetCode() { | ||
case ofctx.Success: | ||
w.Header().Set(functionStatusHeader, successStatus) | ||
w.WriteHeader(rm.FuncOut.GetCode()) | ||
w.Write(rm.FuncOut.GetData()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tpiperatgod do we need to w.Write(rm.FuncOut.GetData())
here?
we don't have this previously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to refer to the mechanism of the ResponseWriter in the http package: https://pkg.go.dev/net/http#ResponseWriter
This is a big enhancement to current go ff. |
Sure. I will add samples and update the docs in other PRs. I will update the code with the above comments later. For the function context, as multi user functions feature is only in knative runtime now which don't have input binding and pubsub. For the output bindings, we will leave it open for all the user functions so the user can access all the output binding in ctx.send(...). However, for the plugins, I am not sure how to handle it now. As the plugin is in the framework level, it will apply to all user functions.
maybe we need to clearly define the usecase of the plugins. cc @tpiperatgod |
We can use annotations in function's crd to provide additional context for plugins as we discussed in yesterday's meeting |
…oud event Signed-off-by: Lize Cai <lize.cai@sap.com>
Thanks for the PR! |
cloudevent
as other methods are disabled by default in the current implementation).openfunction
function type, pass theuserdata
to the function if the request is a cloud event, which matches the behavior in async.find example here
close #51
Signed-off-by: Lize Cai lize.cai@sap.com