{"modulePath":"github.com/BetterToPractice/go-echo-setup","version":"v0.0.0-20231017113254-bbcf6c5b90cc","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controllers\n\n## Variables\n\n```go\nvar Module = fx.Options(\n\tfx.Provide(NewMainController),\n\tfx.Provide(NewUserController),\n\tfx.Provide(NewAuthController),\n\tfx.Provide(NewPostController),\n)\n```\n\n## Types\n\n```go\ntype AuthController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewAuthController(authService services.AuthService) AuthController\n```\n\n```go\nfunc (c AuthController) Login(ctx echo.Context) error\n```\nLogin godoc\n\n\t@Summary\t\tLogin a User\n\t@Description\tLogin as user to application\n\t@Tags\t\t\tauth\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Param \t\t\tdata body dto.LoginRequest true \"Post\"\n\t@Router\t\t\t/login [post]\n\t@Success\t\t200  {object}  response.Response{data=dto.LoginResponse}  \"ok\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\n```go\nfunc (c AuthController) Register(ctx echo.Context) error\n```\nRegister godoc\n\n\t@Summary\t\tRegister a new User\n\t@Description\tregister a new user\n\t@Tags\t\t\tauth\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Param \t\t\tdata body dto.RegisterRequest true \"Post\"\n\t@Router\t\t\t/register [post]\n\t@Success\t\t200  {object}  response.Response{data=dto.RegisterResponse}  \"ok\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\n```go\ntype MainController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewMainController(config lib.Config) MainController\n```\n\n```go\nfunc (c MainController) Index(ctx echo.Context) error\n```\n\n```go\ntype PostController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPostController(postService services.PostService, postPolicy policies.PostPolicy, authService services.AuthService) PostController\n```\n\n```go\nfunc (c PostController) Create(ctx echo.Context) error\n```\nCreate godoc\n\n\t@Summary\t\tCreate a post\n\t@Description\tCreate a post\n\t@Tags\t\t\tpost\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Security \t\tBearerAuth\n\t@Param \t\t\tdata body dto.PostRequest true \"Post\"\n\t@Router\t\t\t/posts [post]\n\t@Success\t\t201  {object}  response.Response{data=dto.PostResponse}  \"created\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\t@Failure\t\t404  {object}  response.Response  \"not found\"\n\t@Failure\t\t401  {object}  response.Response  \"unauthorized\"\n\t@Failure\t\t403  {object}  response.Response  \"forbidden\"\n\n```go\nfunc (c PostController) Destroy(ctx echo.Context) error\n```\nDestroy godoc\n\n\t@summary\t\tDelete a post\n\t@Description\tperform delete a post\n\t@Param \t\t\tid path string true \"post id\"\n\t@Tags\t\t\tpost\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Security \t\tBearerAuth\n\t@Router\t\t\t/posts/{id} [delete]\n\t@Success\t\t204  {object}  nil  \"no content\"\n\t@Failure\t\t404  {object}  response.Response  \"not found\"\n\t@Failure\t\t401  {object}  response.Response  \"unauthorized\"\n\t@Failure\t\t403  {object}  response.Response  \"forbidden\"\n\n```go\nfunc (c PostController) Detail(ctx echo.Context) error\n```\nDetail godoc\n\n\t@Summary\t\tDetail a post\n\t@Description\tget detail a post\n\t@Param \t\t\tid path string true \"post id\"\n\t@Tags\t\t\tpost\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Router\t\t\t/posts/{id} [get]\n\t@Success\t\t200  {object}  response.Response{data=dto.PostResponse}  \"ok\"\n\t@Failure\t\t404  {object}  response.Response{}  \"not found\"\n\n```go\nfunc (c PostController) List(ctx echo.Context) error\n```\nList godoc\n\n\t@Summary\t\tList several posts\n\t@Description\tget list several posts\n\t@Tags\t\t\tpost\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Router\t\t\t/posts [get]\n\t@Success\t\t200  {object}  response.Response{data=dto.PostPaginationResponse}  \"ok\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\n```go\nfunc (c PostController) Update(ctx echo.Context) error\n```\nUpdate godoc\n\n\t@Summary\t\tUpdate a post\n\t@Description\tUpdate a post\n\t@Tags\t\t\tpost\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Security \t\tBearerAuth\n\t@Param \t\t\tdata body dto.PostRequest true \"Post\"\n\t@Router\t\t\t/posts/{id} [patch]\n\t@Success\t\t200  {object}  response.Response  \"ok\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\t@Failure\t\t404  {object}  response.Response  \"not found\"\n\t@Failure\t\t401  {object}  response.Response  \"unauthorized\"\n\t@Failure\t\t403  {object}  response.Response  \"forbidden\"\n\n```go\ntype UserController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewUserController(userService services.UserService, authService services.AuthService, userPolicy policies.UserPolicy) UserController\n```\n\n```go\nfunc (c UserController) Destroy(ctx echo.Context) error\n```\nDestroy godoc\n\n\t@Summary\t\tDelete a User\n\t@Description\tperform delete a user by username\n\t@Tags\t\t\tuser\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Security \t\tBearerAuth\n\t@Param\t\t\tusername  path  string  true  \"Username\"\n\t@Router\t\t\t/users/{username} [delete]\n\t@Success\t\t204  {object}  nil  \"no content\"\n\t@Failure\t\t404  {object}  response.Response  \"not found\"\n\t@Failure\t\t401  {object}  response.Response  \"unauthorized\"\n\t@Failure\t\t403  {object}  response.Response  \"forbidden\"\n\n```go\nfunc (c UserController) Detail(ctx echo.Context) error\n```\nDetail godoc\n\n\t@Summary\t\tGet a User\n\t@Description\tget a user by username\n\t@Tags\t\t\tuser\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Param\t\t\tusername  path  string  true  \"Username\"\n\t@Router\t\t\t/users/{username} [get]\n\t@Success\t\t200  {object}  response.Response{data=dto.UserResponse}  \"ok\"\n\t@Failure\t\t404  {object}  response.Response  \"not found\"\n\n```go\nfunc (c UserController) List(ctx echo.Context) error\n```\nList godoc\n\n\t@Summary\t\tList several users\n\t@Description\tget list several users\n\t@Tags\t\t\tuser\n\t@Accept\t\t\tapplication/json\n\t@Produce\t\tapplication/json\n\t@Router\t\t\t/users [get]\n\t@Success\t\t200  {object}  response.Response{data=dto.UserPaginationResponse}  \"ok\"\n\t@Failure\t\t400  {object}  response.Response{data=[]response.ValidationErrors}  \"bad request\"\n\n","path":"github.com/BetterToPractice/go-echo-setup/api/controllers","name":"controllers","synopsis":"","isRedistributable":true}
