httpu

package
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

View Source
const (
	HeaderContentType   = "Content-Type"
	HeaderContentLength = "Content-Length"

	ContentTypeHTML     = "text/html"
	ContentTypeHTMLUTF8 = "text/html; charset=utf-8"
	ContentTypeJSON     = "application/json"
	ContentTypeJSONUTF8 = "application/json; charset=utf-8"
)

Variables

This section is empty.

Functions

func Resp

func Resp(statusCode int, data interface{}, w http.ResponseWriter, headersKV ...string)

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)

func RespRawOk

func RespRawOk(data []byte, w http.ResponseWriter, headersKV ...string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL