Giter Site home page Giter Site logo

Comments (4)

rsonghuster avatar rsonghuster commented on August 15, 2024

gin 已经完成: https://github.com/devsapp/start-web-framework/tree/master/web-framework/go/gin/src

from start-web-framework.

yiGmMk avatar yiGmMk commented on August 15, 2024

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

  • gin
  • beego

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

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

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

from start-web-framework.

nasa1024 avatar nasa1024 commented on August 15, 2024

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"
}

from start-web-framework.

nasa1024 avatar nasa1024 commented on August 15, 2024

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"
}

from start-web-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.