Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPError ¶
type HTTPError struct { // Message to log in console Message string // Status code that'll be sent in response StatusCode int }
HTTPError is any error that occurs in middlewares or the code that handles HTTP Frontend of application Message is logged to console and Status Code is sent in response If a Middleware sends an HTTPError, No middlewares further up in chain are executed
func ReadAndServeFile ¶
func ReadAndServeFile(name string, w http.ResponseWriter) *HTTPError
ReadAndServeFile reads the file from specified location and sends it in response
type Handler ¶
type Handler func(rc *RouterContext, w http.ResponseWriter, r *http.Request) *HTTPError
Handler is the signature of HTTP Handler that is passed to Handle function
type RouterContext ¶
type RouterContext struct {
User *User
}
RouterContext contains any information to be shared with middlewares.
Click to show internal directories.
Click to hide internal directories.