Back to godoc.org

Package handler

v0.0.0-...-105f702
Latest Go to latest

The latest major version is .

Published: Apr 19, 2020 | License: MIT | Module: github.com/FelixWieland/eospke

Index

func ErrorHandler

func ErrorHandler(err error, c echo.Context)

type HTTPError

type HTTPError struct {
	// contains filtered or unexported fields
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

func (*HTTPError) MarshalJSON

func (e *HTTPError) MarshalJSON() ([]byte, error)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

type SurveyHandler

type SurveyHandler Handler

SurveyHandler is a handler for Survey requests

func NewSurveyHandler

func NewSurveyHandler() *SurveyHandler

NewSurveyHandler creates a handler for Survey requests

func (*SurveyHandler) CreateSurvey

func (h *SurveyHandler) CreateSurvey(c echo.Context) error

CreateSurvey godoc @Summary Create a Survey @Description Creates a Survey item @Tags Survey @Accept json @Produce json @Param todo body types.Survey true "New Survey" @Success 201 {object} types.Survey @Failure 400 {object} HTTPError @Router /surveys [post]

func (*SurveyHandler) DeleteSurvey

func (h *SurveyHandler) DeleteSurvey(c echo.Context) error

DeleteSurvey godoc @Summary Delete a Survey @Description Deletes a Survey item @Tags Survey @Produce json @Param id path int true "Survey ID" @Success 204 {object} types.Survey @Failure 404 {object} HTTPError @Router /surveys/{id} [delete]

func (*SurveyHandler) FindSurvey

func (h *SurveyHandler) FindSurvey(c echo.Context) error

FindSurvey godoc @Summary Finds a Survey @Description Returns a Survey item @Tags Survey @Accept json @Produce json @Param id path int true "Todo ID" @Success 200 {object} types.Survey @Failure 400 {object} HTTPError @Router /surveys/{id} [get]

func (*SurveyHandler) GetSurveys

func (h *SurveyHandler) GetSurveys(c echo.Context) error

GetSurveys godoc @Summary Returns all Surveys @Description Returns all survey items @Tags Survey @Accept json @Produce json @Success 200 {object} types.Surveys @Failure 400 {object} HTTPError @Router /surveys [get]

func (*SurveyHandler) UpdateSurvey

func (h *SurveyHandler) UpdateSurvey(c echo.Context) error

UpdateSurvey godoc @Summary Update a Survey @Description Updates a Survey item @Tags Survey @Accept json @Produce json @Param todo body types.Survey true "Updated Survey" @Param id path int true "Survey ID" @Success 200 {object} types.Survey @Failure 404 {object} HTTPError @Router /surveys/{id} [patch]

type UserHandler

type UserHandler Handler

UserHandler is a handler for User requests

func NewUserHandler

func NewUserHandler() *UserHandler

NewUserHandler creates a handler for User requests

func (*UserHandler) DeleteUser

func (h *UserHandler) DeleteUser(c echo.Context) error

DeleteUser godoc @Summary Delete a User @Description Deletes a User item @Tags User @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} types.User @Failure 404 {object} HTTPError @Router /users/{id} [delete]

func (*UserHandler) FindUser

func (h *UserHandler) FindUser(c echo.Context) error

FindUser godoc @Summary Returns a User @Description Returns a User item @Tags User @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} types.User @Failure 404 {object} HTTPError @Router /users/{id} [get]

func (*UserHandler) GetUsers

func (h *UserHandler) GetUsers(c echo.Context) error

GetUsers godoc @Summary Returns all Users @Description Returns all User items @Tags User @Accept json @Produce json @Success 200 {object} types.Users @Failure 404 {object} HTTPError @Router /users [get]

func (*UserHandler) RegisterUser

func (h *UserHandler) RegisterUser(c echo.Context) error

RegisterUser godoc @Summary Creates a User @Description Creates a User item @Tags User @Accept json @Produce json @Param todo body types.User true "New User" @Success 200 {object} types.User @Failure 404 {object} HTTPError @Router /users [post]

func (*UserHandler) UpdateUser

func (h *UserHandler) UpdateUser(c echo.Context) error

UpdateUser godoc @Summary Updates a User @Description Updates a User item @Tags User @Accept json @Produce json @Param id path int true "User ID" @Param todo body types.User true "Updated User" @Success 200 {object} types.User @Failure 404 {object} HTTPError @Router /users/{id} [patch]

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier