Documentation ¶
Index ¶
- Constants
- func ReqToJSON(r *http.Request, obj interface{}) error
- func ReqToPB(r *http.Request, obj interface{}) error
- func ReqToTOML(r *http.Request, obj interface{}) error
- func ReqToXML(r *http.Request, obj interface{}) error
- func ReqToYAML(r *http.Request, obj interface{}) error
- func Resp(statusCode int, data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespFail(data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespHTML(statusCode int, data []byte, w http.ResponseWriter, headersKV ...string)
- func RespHTMLFail(data []byte, w http.ResponseWriter, headersKV ...string)
- func RespHTMLOk(data []byte, w http.ResponseWriter, headersKV ...string)
- func RespJSON(statusCode int, data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespJSONFail(data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespJSONOk(data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespOk(data interface{}, w http.ResponseWriter, headersKV ...string)
- func RespRaw(statusCode int, data []byte, w http.ResponseWriter, headersKV ...string)
- func RespRawFail(data []byte, w http.ResponseWriter, headersKV ...string)
- func RespRawOk(data []byte, w http.ResponseWriter, headersKV ...string)
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" HeaderContentLength = "Content-Length" MIMEHTML = "text/html" MIMEHTMLUTF8 = "text/html; charset=utf-8" MIMEJSON = "application/json" MIMEJSONUTF8 = "application/json; charset=utf-8" MIMEXML = "application/xml" MIMEXML2 = "text/xml" MIMEPlain = "text/plain" MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEMultipartPOSTForm = "multipart/form-data" MIMEPROTOBUF = "application/x-protobuf" MIMEMSGPACK = "application/x-msgpack" MIMEMSGPACK2 = "application/msgpack" MIMEYAML = "application/x-yaml" MIMEYAML2 = "application/yaml" MIMETOML = "application/toml" )
Variables ¶
This section is empty.
Functions ¶
func RespFail ¶
func RespFail(data interface{}, w http.ResponseWriter, headersKV ...string)
func RespHTML ¶
func RespHTML(statusCode int, data []byte, w http.ResponseWriter, headersKV ...string)
func RespHTMLFail ¶
func RespHTMLFail(data []byte, w http.ResponseWriter, headersKV ...string)
func RespHTMLOk ¶
func RespHTMLOk(data []byte, w http.ResponseWriter, headersKV ...string)
func RespJSON ¶
func RespJSON(statusCode int, data interface{}, w http.ResponseWriter, headersKV ...string)
func RespJSONFail ¶
func RespJSONFail(data interface{}, w http.ResponseWriter, headersKV ...string)
func RespJSONOk ¶
func RespJSONOk(data interface{}, w http.ResponseWriter, headersKV ...string)
func RespOk ¶
func RespOk(data interface{}, w http.ResponseWriter, headersKV ...string)
func RespRaw ¶
func RespRaw(statusCode int, data []byte, w http.ResponseWriter, headersKV ...string)
func RespRawFail ¶
func RespRawFail(data []byte, w http.ResponseWriter, headersKV ...string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.