Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidParameter defines the invalid parameter error. ErrInvalidParameter = echo.NewHTTPError(http.StatusBadRequest, "invalid parameter") // ErrServiceNotImplemented defines the service not implemented error. ErrServiceNotImplemented = echo.NewHTTPError(http.StatusNotImplemented, "service not implemented") )
Functions ¶
func JSONResponse ¶
JSONResponse wraps the result into a "data" field and sends the JSON response with status code.
Types ¶
type AllowedRoute ¶
type AllowedRoute func(echo.Context) bool
AllowedRoute defines a function to allow or disallow routes.
type HTTPErrorResponse ¶
HTTPErrorResponse defines the error struct for the HTTPErrorResponseEnvelope.
type HTTPErrorResponseEnvelope ¶
type HTTPErrorResponseEnvelope struct {
Error HTTPErrorResponse `json:"error"`
}
HTTPErrorResponseEnvelope defines the error response schema for node API responses.
type HTTPOkResponseEnvelope ¶
type HTTPOkResponseEnvelope struct {
// The response is encapsulated in the Data field.
Data interface{} `json:"data"`
}
HTTPOkResponseEnvelope defines the ok response schema for node API responses.
Click to show internal directories.
Click to hide internal directories.