Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
Types ¶
type CORSConfig ¶
type CORSConfig struct { AllowCredentials bool `default:"true"` Headers []string Methods []string Origins []string }
CORSConfig configures CORS.
type Config ¶
type Config struct { Debug bool `default:"true"` Address string `default:":8080"` ReadTimeout time.Duration `default:"1m"` WriteTimeout time.Duration `default:"1m"` CORS CORSConfig }
Config configures the server.
type HTTPError ¶
type HTTPError struct { Message string `json:"message"` Details interface{} `json:"details,omitempty"` Code int `json:"code,omitempty"` // Unique application error code. HTTPCode int `json:"-"` // HTTP status code. Err error `json:"-"` RequestID string `json:"request_id,omitempty"` }
Error represents a handler error.
func GenericInternalServerError ¶
func GenericInternalServerError() *HTTPError
type REST ¶
type REST struct {
// contains filtered or unexported fields
}
REST represents a REST server.
func (*REST) SetErrorHandler ¶
func (r *REST) SetErrorHandler(errorHandler echo.HTTPErrorHandler)
SetErrorHandler sets the error handler.
func (*REST) SetValidation ¶
func (r *REST) SetValidation(validator echo.Validator, binder echo.Binder)
SetValidation sets the validator and binder that validate incoming payload.
Click to show internal directories.
Click to hide internal directories.