controller

package
v0.0.0-...-8b97de0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTodo

func CreateTodo(c *fiber.Ctx) error

CreateTodo func creates a new to-do. @Description Create a new to-do. @Summary create a new to-do @Tags To-dos @Accept json @Produce json @Param title body string true "Title" @Success 201 {object} db.Todo @Router /api/todos [post]

func DeleteTodo

func DeleteTodo(c *fiber.Ctx) error

DeleteTodo func deletes a to-do by given ID. @Description Delete a to-do by given ID. @Summary delete a to-do by given ID @Tags To-dos @Accept json @Produce json @Param id body string true "To-do ID" @Success 204 {string} status "No Content" @Router /api/todos/{id} [delete]

func GetTodo

func GetTodo(c *fiber.Ctx) error

GetTodo func gets a to-do by given ID or 404 error. @Description Get a to-do by given ID. @Summary get a to-do by given ID @Tags To-dos @Accept json @Produce json @Param id path string true "To-do ID" @Success 200 {object} db.Todo @Router /api/todos/{id} [get]

func GetTodos

func GetTodos(c *fiber.Ctx) error

GetTodos func gets all to-dos. @Description Get all to-dos. @Summary get all to-dos @Tags To-dos @Accept json @Produce json @Success 200 {array} db.Todo @Router /api/todos [get]

func UpdateTodo

func UpdateTodo(c *fiber.Ctx) error

UpdateTodo func updates a to-do by given ID. @Description Update a to-do by given ID. @Summary update a to-do by given ID @Tags To-dos @Accept json @Produce json @Param title body string false "Title" @Param completed body boolean false "Completed" @Success 200 {object} db.Todo @Router /api/todos/{id} [put]

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL