Documentation ¶
Overview ¶
Package http provides a convenient way to impliment http servers
Index ¶
- func AssetsChain(f func(w http.ResponseWriter, r *http.Request)) http.Handler
- func Chain(f func(w http.ResponseWriter, r *http.Request)) http.Handler
- func IsInvalid(w http.ResponseWriter, err error, caption string) bool
- func RenderHTML(w http.ResponseWriter, templatePath []string, data interface{}, err error)
- func RenderJSON(w http.ResponseWriter, data interface{}, err error)
- func RenderText(w http.ResponseWriter, data string, err error)
- func RequestGetParam(r *http.Request, key string) (string, bool)
- func RequestGetParamI(r *http.Request, key string, def int) int
- func RequestGetParamS(r *http.Request, key, def string) string
- func RequestPostParam(r *http.Request, key string) (string, bool)
- func RequestPostParamS(r *http.Request, key, def string) string
- func SplittedUpperStrings(value string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetsChain ¶
AssetsChain enables middleware chaining
func IsInvalid ¶
func IsInvalid(w http.ResponseWriter, err error, caption string) bool
IsInvalid checks if the second argument represents a real error
func RenderHTML ¶
func RenderHTML(w http.ResponseWriter, templatePath []string, data interface{}, err error)
RenderHTML write data as a HTML text with template
func RenderJSON ¶
func RenderJSON(w http.ResponseWriter, data interface{}, err error)
RenderJSON write data as a json
func RenderText ¶
func RenderText(w http.ResponseWriter, data string, err error)
RenderText write data as a simple text
func RequestGetParam ¶
RequestGetParam retrives a request parameter
func RequestGetParamI ¶
RequestGetParamI retrives a request parameter as int
func RequestGetParamS ¶
RequestGetParamS retrives a request parameter as string
func RequestPostParam ¶
RequestPostParam retrives a POST request parameter
func RequestPostParamS ¶
RequestPostParamS retrives a request parameter as string
func SplittedUpperStrings ¶
SplittedUpperStrings split word to array and change those words to UpperCase
Types ¶
This section is empty.