Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPErr ¶
func HTTPErr(ctx context.Context, w http.ResponseWriter, err error)
HTTPErr is a provisional convenience helper for handling errors inside the handler Setting usermsg to a non empty string, will overwrite the the error forwarded to the user with it's value
func NewHandler ¶
func NewHandler(ctx context.Context, f HandlerFunc) http.HandlerFunc
NewHandler returns a standard http.HandlerFunc wrapping our default encoding and error handling
Types ¶
type Error ¶
Error implements the error interface and provides a matching implementation for Response
type HandlerFunc ¶
HandlerFunc represents a http.HandlerFunc returning an error
type Response ¶
type Response interface { // Fail should set the internal error value if existing Fail(error) // Failure should return the internal error value if existing (or nil) Failure() error }
Response with basic error handling features
type Server ¶
Server is our default wrapper for routing and serving
func (*Server) GracefulHandler ¶
GracefulHandler watches for termination signals and takes care of graceful server shutdown
Click to show internal directories.
Click to hide internal directories.