Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientError ¶
func (ClientError) Error ¶
func (e ClientError) Error() string
type ErrorHandler ¶
type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error)
var DefaultErrorHandler ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) { clientErr, ok := err.(ClientError) if ok { _ = Encode(w, r, clientErr.Code, clientErr) return } _ = Encode(w, r, http.StatusInternalServerError, map[string]string{"message": "internal server error"}) }
type Option ¶
type Option func(*server)
func WithErrorHandler ¶
func WithErrorHandler(handler ErrorHandler) Option
func WithMiddleware ¶
func WithMiddleware(mw Middleware) Option
func WithPathPrefix ¶
Click to show internal directories.
Click to hide internal directories.