Documentation ¶
Index ¶
- func HandleAllTodos(c *fiber.Ctx) error
- func HandleCreateTodo(c *fiber.Ctx) error
- func HandleDeleteTodo(c *fiber.Ctx) error
- func HandleGetOneTodo(c *fiber.Ctx) error
- func HandleHealthCheck(c *fiber.Ctx) error
- func HandleUpdateTodo(c *fiber.Ctx) error
- type CreateTodoDTO
- type CreateTodoResDTO
- type DeleteTodoResDTO
- type UpdateTodoDTO
- type UpdateTodoResDTO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAllTodos ¶
func HandleAllTodos(c *fiber.Ctx) error
@Summary Get all todos. @Description fetch every todo available. @Tags todos @Accept */* @Produce json @Success 200 {object} []models.Todo @Router /todos [get]
func HandleCreateTodo ¶
func HandleCreateTodo(c *fiber.Ctx) error
@Summary Create a todo. @Description create a single todo. @Tags todos @Accept json @Param todo body CreateTodoDTO true "Todo to create" @Produce json @Success 200 {object} CreateTodoResDTO @Router /todos [post]
func HandleDeleteTodo ¶
func HandleDeleteTodo(c *fiber.Ctx) error
@Summary Delete a single todo. @Description delete a single todo by id. @Tags todos @Param id path string true "Todo ID" @Produce json @Success 200 {object} DeleteTodoResDTO @Router /todos/:id [delete]
func HandleGetOneTodo ¶
func HandleGetOneTodo(c *fiber.Ctx) error
@Summary Get a single todo. @Description fetch a single todo. @Tags todos @Param id path string true "Todo ID" @Produce json @Success 200 {object} models.Todo @Router /todos/:id [get]
func HandleHealthCheck ¶
func HandleHealthCheck(c *fiber.Ctx) error
@Summary Show the status of server. @Description get the status of server. @Tags health @Accept */* @Produce plain @Success 200 "OK" @Router /health [get]
func HandleUpdateTodo ¶
func HandleUpdateTodo(c *fiber.Ctx) error
@Summary Update a todo. @Description update a single todo. @Tags todos @Accept json @Param todo body UpdateTodoDTO true "Todo update data" @Param id path string true "Todo ID" @Produce json @Success 200 {object} UpdateTodoResDTO @Router /todos/:id [put]
Types ¶
type CreateTodoDTO ¶
type CreateTodoResDTO ¶
type DeleteTodoResDTO ¶
type DeleteTodoResDTO struct {
DeletedCount int64 `json:"deleted_count" bson:"deleted_count"`
}
type UpdateTodoDTO ¶
type UpdateTodoResDTO ¶
type UpdateTodoResDTO struct {
UpdatedCount int64 `json:"updated_count" bson:"updated_count"`
}