{"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\tRoot = bootstrap.Root + \".function\"\n)\n```\n\n## Functions\n\n```go\nfunc Default() string\n```\nDefault returns the default cmd name from config.\n\n```go\nfunc Name() string\n```\nName returns func name\n\n## Types\n\n```go\ntype CmdFunc[T any] func(fn Handler[T]) *co.Command\n```\nCmdFunc defines a function that return a command.\n\n```go\ntype Function[T any] struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New[T any](m ...middleware.AnyErrorMiddleware[T]) (*Function[T], error)\n```\n\n```go\nfunc (f *Function[T]) Run(ctx context.Context, fn Handler[T], c ...CmdFunc[T]) error\n```\nRun runs fn through the adapter command the first argument names. With no command named, it runs the one boost.bootstrap.function.default names, or the only adapter given: an app wires the one adapter config chose, so it runs without arguments. It fails with NotValid when there is no adapter, or more than one and none is chosen, instead of printing the usage.\n\n```go\ntype Handler[T any] func(context.Context, cloudevents.Event) (T, error)\n```\n\n```go\nfunc Wrapper[T any](wrp *middleware.AnyErrorWrapper[T], fn Handler[T]) Handler[T]\n```\n\n","path":"github.com/xgodev/boost/bootstrap/function","name":"function","synopsis":"","isRedistributable":true}
