{"modulePath":"github.com/xgodev/boost","version":"v1.11.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package function\n\n## Constants\n\n```go\nconst (\n\tBSFunctionAdaptersGroupKey = \"boostrap.function.adapters\"\n\n\t// MiddlewaresName names the optional []middleware.AnyErrorMiddleware[T]\n\t// the function runs after the middlewares given to Module, in order.\n\t// builder provides it for @Function(middlewares=[...]).\n\tMiddlewaresName = \"bootstrap.function.middlewares\"\n)\n```\n\n```go\nconst (\n\tRoot = bootstrap.Root + \".function\"\n)\n```\n\n## Functions\n\n```go\nfunc Module[T any](m []middleware.AnyErrorMiddleware[T]) fx.Option\n```\nModule fx module for bootstrap function. The function runs from the app's OnStart and its context is cancelled on OnStop, so app.Run handles SIGTERM gracefully; when the function ends on its own the app shuts down, with exit code 1 if it failed. The function runs m, then the middlewares named MiddlewaresName when the app provides them.\n\n","path":"github.com/xgodev/boost/fx/modules/bootstrap/function","name":"function","synopsis":"","isRedistributable":true}
