Documentation ¶
Index ¶
- func Bind(r *http.Request, v interface{}) error
- func Binder(r *http.Request, v interface{})
- func GetIP(r *http.Request) (ip string, err error)
- func MIME(w http.ResponseWriter, mimeType string)
- func Redirect(w http.ResponseWriter, r *http.Request, statusCodeAndPath ...interface{})
- func Send(w http.ResponseWriter, statusCodeAndData ...interface{})
- func SendJSON(w http.ResponseWriter, statusCodeAndData ...interface{})
- func SendString(w http.ResponseWriter, statusCodeAndData ...interface{})
- type Map
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Binder ¶
Binder does the same as Bind() but handles panic the error, hence useful if you don't want to check error and modify it but just panic it
func Redirect ¶
func Redirect(w http.ResponseWriter, r *http.Request, statusCodeAndPath ...interface{})
Redirect for redirecting the client request
func Send ¶
func Send(w http.ResponseWriter, statusCodeAndData ...interface{})
Send sends any data. Struct and map are sent as json whereas, other data are treated as plain texts. For sending other data as json, you might require SendJSON()
func SendJSON ¶
func SendJSON(w http.ResponseWriter, statusCodeAndData ...interface{})
SendJSON for sending error in json format and providing the error code
func SendString ¶
func SendString(w http.ResponseWriter, statusCodeAndData ...interface{})
SendString is for sending data in string format to the client
Types ¶
Click to show internal directories.
Click to hide internal directories.