gchttp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailureResp

func FailureResp(w http.ResponseWriter, errObj model.ErrorModel)

func GetRequest

func GetRequest(url string) model.Result

func PostRequest

func PostRequest(url string, header map[string]string, body string) model.Result

func RegistHandle

func RegistHandle(name string, handler HttpHandler)

func Request

func Request(method, url string, header map[string]string, body string) model.Result

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)

Jump to

Keyboard shortcuts

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