Documentation ¶
Index ¶
- type Endpoints
- func (e *Endpoints) AddFruit(c echo.Context) error
- func (e *Endpoints) DeleteAll(c echo.Context) error
- func (e *Endpoints) DeleteFruit(c echo.Context) error
- func (e *Endpoints) GetFruitsByName(c echo.Context) error
- func (e *Endpoints) GetFruitsBySeason(c echo.Context) error
- func (e *Endpoints) ListFruits(c echo.Context) error
- func (e *Endpoints) Live(c echo.Context) error
- func (e *Endpoints) Ready(c echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoints ¶
Endpoints is the marker interface for defining routes
func NewEndpoints ¶
NewEndpoints gives handle to REST Endpoints dbType could be one of "pg","mysql","sqlite".Defaults to "sqlite"
func (*Endpoints) AddFruit ¶
AddFruit godoc @Summary Add a fruit to Database @Description Adds a new Fruit to the Database @Tags fruit @Accept json @Produce json @Param message body db.Fruit true "Fruit object" @Success 200 {object} db.Fruit @Failure 404 {object} utils.HTTPError @Router /fruits/add [post]
func (*Endpoints) DeleteAll ¶
DeleteAll godoc @Summary Delete all fruit from Database @Description Delete all fruit from Database @Tags fruit @Success 204 @Failure 404 {object} utils.HTTPError @Router /fruits/ [delete]
func (*Endpoints) DeleteFruit ¶
DeleteFruit godoc @Summary Delete a fruit from Database @Description Deletes a Fruit to the Database @Tags fruit @Param id path int true "Fruit ID" @Success 204 @Failure 404 {object} utils.HTTPError @Router /fruits/{id} [delete]
func (*Endpoints) GetFruitsByName ¶
GetFruitsByName godoc @Summary Gets fruits by name @Description Gets list of fruits by name @Tags fruit @Produce json @Param name path string true "Full or partial name of the fruit" @Success 200 {object} db.Fruits @Failure 404 {object} utils.HTTPError @Router /fruits/search/{name} [get]
func (*Endpoints) GetFruitsBySeason ¶
GetFruitsBySeason godoc @Summary Gets fruits by season @Description Gets a list of fruits by season @Tags fruit @Produce json @Param season path string true "Full or partial name of the season" @Success 200 {object} db.Fruits @Failure 404 {object} utils.HTTPError @Router /fruits/season/{season} [get]
func (*Endpoints) ListFruits ¶
ListFruits godoc @Summary Gets all fruits @Description Gets a list all available fruits from the database @Tags fruit @Produce json @Success 200 {object} db.Fruits @Failure 404 {object} utils.HTTPError @Router /fruits/ [get]