handlers

package
v0.0.0-...-a137641 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(c *fiber.Ctx) error

Count godoc @Summary Count total amount of people in the database @Tags count @Produce json @Success 200 {object} models.CountResponse{} @Failure 500 {object} models.ErrorResponse{} @Router /contagem-pessoas [get]

func Create

func Create(c *fiber.Ctx) error

Create godoc @Summary Create new person document @Description Adds a person to the database. Returns an error if another person with the same value for the "apelido" field exists. Apelido and Nome have to be strings of length up to 32 and 100, respectively. Nascimento has to follow date format YYYY-MM-DD. Stack is optional, but each entry contained has to be a string of up to 32 chars in length. @Tags pessoas @Param request body models.PersonCreateRequest true "Request body" @Accept json @Produce json @Success 201 {object} models.PersonCreateResponse{} @Failure 422 {object} models.ErrorResponse{} @Failure 500 {object} models.ErrorResponse{} @Router /pessoas [post]

func GetAll

func GetAll(c *fiber.Ctx) error

GetAll godoc @Summary Get every person in the database @Description Returns an empty array if no people found. @Tags getall @Produce json @Success 200 {array} models.PersonDTO @Router /getall [get]

func Query

func Query(c *fiber.Ctx) error

Query godoc @Summary Search by term @Description Search for a person in database by a given query string. Search term must not be empty @Tags pessoas @Param t query string false "Search term" @Produce json @Success 200 {array} models.PersonDTO{} @Failure 400 {object} models.ErrorResponse{} @Failure 500 {object} models.ErrorResponse{} @Router /pessoas [get]

func SearchId

func SearchId(c *fiber.Ctx) error

SearchId godoc @Summary Search person by ID @Description Returns a person with the given id (UUID format) @Tags pessoas @Param id path string true "Person ID" @Produce json @Success 200 {object} models.PersonDTO{} @Failure 400 {object} models.ErrorResponse{} @Failure 404 {object} models.ErrorResponse{} @Failure 500 {object} models.ErrorResponse{} @Router /pessoas/{id} [get]

func Status

func Status(c *fiber.Ctx) error

Status godoc @Summary Health check @Tags status @Success 200 {array} string @Router /status [get]

Types

type QueryParams

type QueryParams struct {
	T string //`query:"t"`
}

Jump to

Keyboard shortcuts

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