Documentation
¶
Index ¶
- Variables
- func CacheFileSystem(path string) (http.FileSystem, error)
- func ErrFuncDefault(w http.ResponseWriter, r *http.Request, err error)
- func ErrorResponse(w http.ResponseWriter, error error, statusCode int)
- func NewRouter(handler ErrorHandlerFunc) *routerState
- type ContentType
- type ErrorHandlerFunc
- type HandlerFunc
- type Middleware
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CacheFileSystem ¶
func CacheFileSystem(path string) (http.FileSystem, error)
func ErrFuncDefault ¶
func ErrFuncDefault(w http.ResponseWriter, r *http.Request, err error)
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, error error, statusCode int)
Error is used to build the http error response with the provided http status code and make theese values available to the middlewares.
func NewRouter ¶
func NewRouter(handler ErrorHandlerFunc) *routerState
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeTextPlain ContentType = "text/plain" ContentTypeTextHtml ContentType = "text/html" ContentTypeJson ContentType = "application/json" ContentTypeXml ContentType = "application/xml" ContentTypeFormEncoded ContentType = "application/x-www-form-urlencoded" ContentTypeFormData ContentType = "multipart/form-data" )
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request) error
type Middleware ¶
type Middleware func(HandlerFunc) HandlerFunc
Source Files
¶
Click to show internal directories.
Click to hide internal directories.