Documentation ¶
Index ¶
- func CreatePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
- func DeletePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
- func GetPokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
- func GetPokemonsHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
- func PutIDPokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
- func PutNamePokemonHandler(dbpool *pgxpool.Pool, tableName string) gin.HandlerFunc
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.