Documentation ¶
Index ¶
- func FailureResp(w http.ResponseWriter, errObj model.ErrorModel)
- func GetRequest(url string) model.Result
- func PostRequest(url string, header map[string]string, body string) model.Result
- func RegistHandle(name string, handler HttpHandler)
- func Request(method, url string, header map[string]string, body string) model.Result
- func RespResult(w http.ResponseWriter, r model.Result)
- func SetHtmlRep(w http.ResponseWriter)
- func SetJsonRep(w http.ResponseWriter)
- func SetTextRep(w http.ResponseWriter)
- func StartServer(addr string, c chan struct{})
- func StartTLSServer(addr, crt, key string)
- func SuccessRespJson(w http.ResponseWriter, r interface{})
- func TimestampHandler(w http.ResponseWriter, _ *http.Request)
- func TokenHandler(w http.ResponseWriter, _ *http.Request)
- type HttpHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailureResp ¶
func FailureResp(w http.ResponseWriter, errObj model.ErrorModel)
func GetRequest ¶
func RegistHandle ¶
func RegistHandle(name string, handler HttpHandler)
func RespResult ¶
func RespResult(w http.ResponseWriter, r model.Result)
func SetHtmlRep ¶
func SetHtmlRep(w http.ResponseWriter)
func SetJsonRep ¶
func SetJsonRep(w http.ResponseWriter)
func SetTextRep ¶
func SetTextRep(w http.ResponseWriter)
func StartServer ¶
func StartServer(addr string, c chan struct{})
func StartTLSServer ¶
func StartTLSServer(addr, crt, key string)
* openssl genrsa -out server.key 2048 openssl req -new -x509 -key server.key -out server.crt -days 365
func SuccessRespJson ¶
func SuccessRespJson(w http.ResponseWriter, r interface{})
func TimestampHandler ¶
func TimestampHandler(w http.ResponseWriter, _ *http.Request)
func TokenHandler ¶
func TokenHandler(w http.ResponseWriter, _ *http.Request)
Types ¶
type HttpHandler ¶
type HttpHandler func(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.