{"modulePath":"github.com/phcp-tech/common-library-golang","version":"v0.1.31","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package componentwithlambda\n\nPackage componentwithlambda provides HTTP server lifecycle integration for bootstrap, with AWS Lambda support.\n\nUse this package instead of httpserver/component when the service may be deployed on AWS Lambda. It reads app.runmode from env during Init() and selects the appropriate runner:\n\n  - \"aws\\_lambda\" → httpserver/lambda.NewHttpServer()\n  - anything else → httpserver.NewHttpServer() (plain HTTP/HTTPS)\n\nImporting this package pulls in the AWS Lambda SDK. Services that never run on Lambda should use httpserver/component to keep their binary free of unnecessary dependencies.\n\n## Functions\n\n```go\nfunc Component(handler func() http.Handler) bootstrap.IComponent\n```\nComponent wraps the HTTP server as a bootstrap.IComponent with Lambda support.\n\nhandler is a lazy provider called during Init() to obtain the http.Handler (typically \\*gin.Engine). The runner is selected at Init() time based on the app.runmode env key.\n\nTypical usage with a bridge variable in main:\n\n\tvar router *gin.Engine\n\tAdd(ginComp.Component(func(r *gin.Engine) {\n\t    router = r\n\t    adapter.Mount(r)\n\t})).\n\tAdd(httpComp.Component(func() http.Handler { return router }))\n\n","path":"github.com/phcp-tech/common-library-golang/httpserver/componentwithlambda","name":"componentwithlambda","synopsis":"Package componentwithlambda provides HTTP server lifecycle integration for bootstrap, with AWS Lambda support.","isRedistributable":true}
