handlers

package
v0.0.0-...-f8deed7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePokemonHandler

func CreatePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

CreatePokemonHandler godoc @Summary Add Pokemon @Description Adds a Pokemon to the Pokedex @Tags pokedex @Accept json @Produce json @Param pokemon body models.Pokemon true "Pokemon object" @Success 200 {string} string "Pokemon created successfully" @Router /pokemon [post]

func DeletePokemonHandler

func DeletePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

DeletePokemonHandler godoc @Summary Deletes Pokemon @Description Deletes a Pokemon from the Pokedex by name @Tags pokedex @Accept json @Produce json @Param name path string true "Pokemon name" @Success 200 {string} string "Successfully deleted Pokemon" @Failure 500 {string} string "Failed to delete Pokemon" @Router /pokemon/{name} [delete]

func GetPokemonHandler

func GetPokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

GetPokemonHandler godoc @Summary Get Pokemon @Description Gets a Pokemon from the Pokedex by name @Tags pokedex @Accept json @Produce json @Param name path string true "Pokemon name" @Success 200 {object} models.Pokemon @Failure 404 {string} string "Pokemon not found" @Failure 500 {string} string "Failed to retrieve Pokemon record" @Router /pokemon/{name} [get]

func GetPokemonsHandler

func GetPokemonsHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

GetPokemonsHandler godoc @Summary Get Pokemons. @Description Gets all pokemons from the pokedex. @Tags pokedex @Accept json @Produce json @Success 200 {string} string @Router /pokemons [get]

func PutIDPokemonHandler

func PutIDPokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

@Summary Update Pokemon by ID @Description Updates a Pokemon in the Pokedex by ID @Tags pokedex @Accept json @Produce json @Param id path string true "Pokemon ID" @Param pokemon body models.Pokemon true "Pokemon object" @Success 200 {string} string "Successfully updated Pokemon" @Failure 400 {object} string "Failed to update Pokemon" @Failure 500 {string} string "Failed to update Pokemon" @Router /pokemon/{id} [put]

func PutNamePokemonHandler

func PutNamePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc

PutNamePokemonHandler godoc @Summary Update Pokemon by name @Description Updates a Pokemon in the Pokedex by name @Tags pokedex @Accept json @Produce json @Param pokemon body models.Pokemon true "Pokemon object" @Success 200 {string} string "Successfully updated Pokemon" @Failure 400 {object} string "Failed to update Pokemon" @Failure 500 {string} string "Failed to update Pokemon" @Router /pokemon [put]

Types

This section is empty.

Jump to

Keyboard shortcuts

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