package
Version:
v0.0.0-...-6d5be25
Opens a new window with list of versions in this module.
Published: Aug 20, 2021
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
const (
INSERTQUERY = `insert into public.beer (beer_name, description, graduation) values ($1, $2, $3)`
SELECTQUERY = `select * from public.beer where beer_name = $1`
)
func AddBeer(c echo.Context) error
AddBeer godoc
@Summary AddBeer
@Description AddBeer to catalogue
@Accept json
@Produce json
@Success 200 {object} string
@Failure 400 {object} string
@Failure 500 {object} string
@Param beer body Beer true "beer"
@Router /addbeer [post]
func GetBeer(c echo.Context) error
GetBeer godoc
@Summary GetBeer
@Description GetBeer from catalogue
@Accept json
@Produce json
@Success 200 {object} Beer
@Failure 400 {object} string
@Failure 500 {object} string
@Param name path string true "name"
@Router /beer/{name} [get]
type Beer struct {
Name string `json:"name"`
Description string `json:"description"`
Graduation float32 `json:"graduation"`
}
type BeerData struct {
Id int `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Graduation float32 `json:"graduation"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.