{"modulePath":"github.com/sysatom/framework","version":"v0.0.0-20250603095622-116c032940b7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controller\n\n## Variables\n\n```go\nvar Modules = fx.Options(\n\tservice.Modules,\n\tfx.Provide(NewHelloController, NewValidateController, NewUserController),\n\tfx.Invoke(BindHelloRoutes, BindValidateRoutes, BindAdminRoutes),\n)\n```\n\n## Functions\n\n```go\nfunc BindAdminRoutes(_ config.Type, e *echo.Echo, c *UserController)\n```\n\n```go\nfunc BindHelloRoutes(e *echo.Echo, c *HelloController)\n```\n\n```go\nfunc BindValidateRoutes(e *echo.Echo, c *ValidateController)\n```\n\n## Types\n\n```go\ntype Address struct {\n\tStreet string `validate:\"required\"`\n\tCity   string `validate:\"required\"`\n\tPlanet string `validate:\"required\"`\n\tPhone  string `validate:\"required\"`\n}\n```\nAddress houses a users address information\n\n```go\ntype HelloController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewHelloController(logger *zap.Logger, helloService *service.HelloService) *HelloController\n```\n\n```go\nfunc (controller HelloController) Ent(c echo.Context) error\n```\n\n```go\nfunc (controller HelloController) Hello(c echo.Context) error\n```\nShowAccount godoc\n\n\t@Summary\t\tShow an account\n\t@Description\tget string by ID\n\t@Tags\t\t\taccounts\n\t@Accept\t\t\tjson\n\t@Produce\t\tjson\n\t@Param\t\t\tid\tpath\t\tint\ttrue\t\"Account ID\"\n\t@Success\t\t200\t{object}\ttypes.FileDef\n\t@Router\t\t\t/hello/{id} [get]\n\n```go\ntype User struct {\n\tFirstName      string     `validate:\"required\"`\n\tLastName       string     `validate:\"required\"`\n\tAge            uint8      `validate:\"gte=0,lte=130\"`\n\tEmail          string     `validate:\"required,email\"`\n\tGender         string     `validate:\"oneof=male female prefer_not_to\"`\n\tFavouriteColor string     `validate:\"iscolor\"`                // alias for 'hexcolor|rgb|rgba|hsl|hsla'\n\tAddresses      []*Address `validate:\"required,dive,required\"` // a person can have a home and cottage...\n}\n```\nUser contains user information\n\n```go\ntype UserController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewUserController(logger *zap.Logger, userService *service.UserService) *UserController\n```\n\n```go\nfunc (controller UserController) Info(c echo.Context) error\n```\nInfo godoc\n\n\t@Summary\t\tUser info\n\t@Description\tUser info\n\t@Tags\t\t\tuser\n\t@Accept\t\t\tjson\n\t@Produce\t\tjson\n\t@Success\t\t200\t{object}\tprotocol.Response{data=types.KV}\n\t@Router\t\t\t/user/info [get]\n\n```go\nfunc (controller UserController) Login(c echo.Context) error\n```\nLogin godoc\n\n\t@Summary\t\tUser login\n\t@Description\tUser login with username and password\n\t@Tags\t\t\tuser\n\t@Accept\t\t\tjson\n\t@Produce\t\tjson\n\t@Param\t\t\tbody\tbody\t\ttypes.UserLoginRequest\ttrue\t\"Login credentials\"\n\t@Success\t\t200\t\t{object}\tprotocol.Response{data=types.UserLoginResponse}\n\t@Router\t\t\t/user/login [post]\n\n```go\ntype ValidateController struct {\n}\n```\n\n```go\nfunc NewValidateController() *ValidateController\n```\n\n```go\nfunc (controller ValidateController) Validate(c echo.Context) error\n```\n\n","path":"github.com/sysatom/framework/internal/controller","name":"controller","synopsis":"","isRedistributable":true}
