Documentation ¶
Overview ¶
The types and wrapper types used in gomedia
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct { Error error `json:"error"` Message string `json:"message"` Code int `json:"errorCode"` }
AppError is a convience type used to return HTTP status codes and messages from AppHandler wrapped HTTPHandlers
type AppHandler ¶
type AppHandler func(http.ResponseWriter, *http.Request) *AppError
AppHandler is a fun type that is used to enable generic error handling for HTTP handlers
func (AppHandler) ServeHTTP ¶
func (fn AppHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServerHTTP is the way to wrap your HTTP Handlers in generic error handling you just need to return and AppError or nil
Click to show internal directories.
Click to hide internal directories.