handler

package
v0.0.0-...-72605ad Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetHealth

func GetHealth(w http.ResponseWriter, r *http.Request)

GetHealth godoc @Summary Returns health of the service @Router /healthz [get]

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, msg interface{})

RespondWithError return error message

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})

RespondWithJSON write json response format

Types

type Config

type Config struct {
	fx.In

	Repo *puso.Puso
}

type PusoHandler

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

func NewPusoHandler

func NewPusoHandler(config Config) *PusoHandler

func (*PusoHandler) CreatePuso

func (p *PusoHandler) CreatePuso(w http.ResponseWriter, r *http.Request)

CreatePuso @Summary Create a new puso @Tags Puso @Accept json @Produce json @Param data body puso.Puso true "data" @Success 200 {string} string "successfully puso created" @Failure 400 {string} string @Failure 500 {string} string @Router /puso [post]

func (*PusoHandler) DeletePuso

func (p *PusoHandler) DeletePuso(w http.ResponseWriter, r *http.Request)

DeletePuso @Summary Delete puso @Tags Puso @Accept json @Produce json @Param id path string true "ID" @Success 200 {nil} nil @Failure 404 {string} string @Router /puso/{id} [delete]

func (*PusoHandler) GetPuso

func (p *PusoHandler) GetPuso(w http.ResponseWriter, r *http.Request)

GetPuso @Summary Get puso @Tags Puso @Accept json @Produce json @Param id path string true "ID" @Success 200 {object} puso.Puso @Failure 404 {string} string @Router /puso/{id} [get]

func (*PusoHandler) PusoList

func (p *PusoHandler) PusoList(w http.ResponseWriter, r *http.Request)

PusoList @Summary Get puso list @Tags Puso @Accept json @Produce json @Success 200 {object} []puso.Puso @Failure 404 {string} string @Router /puso [get]

func (*PusoHandler) UpdatePuso

func (p *PusoHandler) UpdatePuso(w http.ResponseWriter, r *http.Request)

UpdatePuso @Summary Update puso @Tags Puso @Description Update puso @Accept json @Produce json @Param id path string true "ID" @Success 200 {string} string "successfully updated" @Failure 400 {string} string @Failure 404 {string} string @Router /puso/{id} [put]

Jump to

Keyboard shortcuts

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