Documentation
¶
Index ¶
- func GetListLimit(c echo.Context, defaultLimit int) int
- func GetListOffest(c echo.Context, defaultOffset int) int
- func GetNumericQueryParam(c echo.Context, param string, defaultValue int) int
- func GetParameterID(c echo.Context, name string) (int64, error)
- func GetParameterString(c echo.Context, name string) (string, error)
- func GetQueryID(c echo.Context, value string) (int64, error)
- func GetQueryParamsInt64(c echo.Context, key string) ([]int64, error)
- type BaseHandler
- func (h *BaseHandler) BindedRequest(c echo.Context, op string, request *requests.Request, body requests.Body) error
- func (h *BaseHandler) BindedRequestXMLResponse(c echo.Context, op string, request *requests.Request, body requests.Body) error
- func (h *BaseHandler) ManageError(c echo.Context, op string, request *requests.Request, managedError error) error
- func (h *BaseHandler) StandardRequest(c echo.Context, op string, request *requests.Request, body requests.Body) error
- type ErrorResponse
- type RESTServer
- type StandardError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNumericQueryParam ¶
Types ¶
type BaseHandler ¶
type BaseHandler struct {
Server RESTServer
}
BaseHandler is a struct with basic methods that should be extended to properly handle a HTTP Service.
func NewHandler ¶
func NewHandler(Server RESTServer) *BaseHandler
func (*BaseHandler) BindedRequest ¶
func (*BaseHandler) BindedRequestXMLResponse ¶
func (*BaseHandler) ManageError ¶
func (h *BaseHandler) ManageError(c echo.Context, op string, request *requests.Request, managedError 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 RESTServer ¶
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.