Skip to content
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

web 框架还需要增加 golang 的示例 #94

Open
rsonghuster opened this issue Feb 6, 2023 · 4 comments
Open

web 框架还需要增加 golang 的示例 #94

rsonghuster opened this issue Feb 6, 2023 · 4 comments

Comments

@rsonghuster
Copy link
Contributor

web 框架还需要增加 golang 的示例

  • gin

  • beego

和之前的 fun 对齐, 有国际站的用户找过来,还是 funcraft 的示例

@rsonghuster
Copy link
Contributor Author

@yiGmMk
Copy link

yiGmMk commented Jul 11, 2023

web 框架还需要增加 golang 的示例

  • gin
  • beego

和之前的 fun 对齐, 有国际站的用户找过来,还是 funcraft 的示例

请问在这些框架类如何实现生命周期回调函数?文档只看到用fc这个的
// 注册Initializer回调方法
fc.RegisterInitializerFunction(initialize)
// 注册PreStop回调方法
fc.RegisterPreStopFunction(preStop)
// 注册PreFreeze回调方法
fc.RegisterPreFreezeFunction(preFreeze)

还是说必须用控制台设置(实现几个api,比如/initialize)
image

@nasa1024
Copy link

image
hi, @rsonghuster 这两个部分有什么关系吗?他们分别的作用是什么,按照你的示例去修改已有项目出现以下错误

{
    "ErrorCode": "InvalidArgument",
    "ErrorMessage": "Failed to start function, Code: 1, msg: function not ready:timed out after 30000 millis.:[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.\n\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:\texport GIN_MODE=release\n - using code:\tgin.SetMode(gin.ReleaseMode)\n\n[GIN-debug] GET    /ping                     --> main.main.func1 (3 handlers)\n[GIN-debug] GET    /                         --> main.main.func2 (3 handlers)\n[GIN-debug] [WARNING] You trusted all proxies, this is NOT safe. We recommend you to set a value.\nPlease check https://pkg.go.dev/github.com/gin-gonic/gin#readme-don-t-trust-all-proxies for details.\n[GIN-debug] Environment variable PORT is undefined. Using port :8080 by default\n[GIN-debug] Listening and serving HTTP on :8080\n\n"
}

@nasa1024
Copy link

and this

{
    "ErrorCode": "CAFileNotFound",
    "ErrorMessage": "The function cannot be started. Failed to start function instance. Error: the file /code/cmd/app/app is not exist"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants