Documentation
¶
Index ¶
- func LogErrorStacktrace(err error)
- type App
- type BaseHandler
- func (h *BaseHandler) BindedJSONResponse(c echo.Context, op string, request requests.Request, body requests.Body) error
- func (h *BaseHandler) BindedXMLResponse(c echo.Context, op string, request requests.Request, body requests.Body) error
- func (h *BaseHandler) BlobResponse(c echo.Context, op string, request requests.Request, contentType string, ...) error
- func (h *BaseHandler) GetListLimit(c echo.Context, defaultLimit int) int
- func (h *BaseHandler) GetListOffset(c echo.Context, defaultOffset int) int
- func (h *BaseHandler) GetNumericQueryParam(c echo.Context, param string, defaultValue int) int
- func (h *BaseHandler) GetParameterInt64(c echo.Context, name string) (int64, error)
- func (h *BaseHandler) GetParameterString(c echo.Context, name string) (string, error)
- func (h *BaseHandler) GetParameterUUID(c echo.Context, name string) (uuid.UUID, error)
- func (h *BaseHandler) GetQueryParamInt64(c echo.Context, value string) (int64, error)
- func (h *BaseHandler) GetQueryParamInt64s(c echo.Context, key string) ([]int64, error)
- func (h *BaseHandler) GetQueryParamTime(c echo.Context, key string) (time.Time, error)
- func (h *BaseHandler) JSONResponse(c echo.Context, op string, request requests.Request, body requests.Body) error
- func (h *BaseHandler) ManageError(c echo.Context, op string, request requests.Request, err error) error
- type ErrorResponse
- type StandardError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogErrorStacktrace ¶
func LogErrorStacktrace(err error)
Types ¶
type BaseHandler ¶
type BaseHandler struct {
App App
}
BaseHandler is a struct with basic methods that should be extended to properly handle a HTTP Service.
func NewHandler ¶
func NewHandler(App App) *BaseHandler
func (*BaseHandler) BindedJSONResponse ¶
func (*BaseHandler) BindedXMLResponse ¶
func (*BaseHandler) BlobResponse ¶
func (*BaseHandler) GetListLimit ¶
func (h *BaseHandler) GetListLimit(c echo.Context, defaultLimit int) int
func (*BaseHandler) GetListOffset ¶
func (h *BaseHandler) GetListOffset(c echo.Context, defaultOffset int) int
func (*BaseHandler) GetNumericQueryParam ¶
func (*BaseHandler) GetParameterInt64 ¶
func (*BaseHandler) GetParameterString ¶
Parameters
func (*BaseHandler) GetParameterUUID ¶
func (*BaseHandler) GetQueryParamInt64 ¶
func (*BaseHandler) GetQueryParamInt64s ¶
func (*BaseHandler) GetQueryParamTime ¶ added in v1.5.3
GetQueryParamTime parses a required query param as RFC3339/RFC3339Nano
func (*BaseHandler) JSONResponse ¶
func (*BaseHandler) ManageError ¶
func (h *BaseHandler) ManageError(c echo.Context, op string, request requests.Request, err error) error
ManageError translates an error into the appropriate HTTP error code
type ErrorResponse ¶
type ErrorResponse struct {
Error StandardError `json:"error"`
}
ErrorResponse defines the structure of the error that the handler will return
type StandardError ¶
type StandardError struct {
Code string `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}
StandardError defines a error in JSON format
Click to show internal directories.
Click to hide internal directories.