handler

package
v0.0.0-...-6d5be25 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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`
)

Variables

This section is empty.

Functions

func AddBeer

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

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]

Types

type Beer

type Beer struct {
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Graduation  float32 `json:"graduation"`
}

type BeerData

type BeerData struct {
	Id          int     `json:"id"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Graduation  float32 `json:"graduation"`
}

Jump to

Keyboard shortcuts

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