Documentation ¶
Index ¶
- func ProxyHttp(c *gin.Context, addr string)
- func ProxyRestHttp(req *restful.Request, resp *restful.Response, addr string)
- func ReqForward(req *restful.Request, url, method string) (string, error)
- func ReqHttp(req *restful.Request, url, method string, body []byte) (string, error)
- type HttpClient
- func (client *HttpClient) DELETE(url string, header http.Header, data []byte) ([]byte, error)
- func (client *HttpClient) DELETEEx(url string, header http.Header, data []byte) (int, []byte, error)
- func (client *HttpClient) DoWithTimeout(timeout time.Duration, req *http.Request) (*http.Response, error)
- func (client *HttpClient) GET(url string, header http.Header, data []byte) ([]byte, error)
- func (client *HttpClient) GETEx(url string, header http.Header, data []byte) (int, []byte, error)
- func (client *HttpClient) GetClient() *http.Client
- func (client *HttpClient) GetHeader(key string) string
- func (client *HttpClient) NewTransPort() *http.Transport
- func (client *HttpClient) POST(url string, header http.Header, data []byte) ([]byte, error)
- func (client *HttpClient) POSTEx(url string, header http.Header, data []byte) (int, []byte, error)
- func (client *HttpClient) PUT(url string, header http.Header, data []byte) ([]byte, error)
- func (client *HttpClient) PUTEx(url string, header http.Header, data []byte) (int, []byte, error)
- func (client *HttpClient) Request(url, method string, header http.Header, data []byte) ([]byte, error)
- func (client *HttpClient) RequestEx(url, method string, header http.Header, data []byte) (int, []byte, error)
- func (client *HttpClient) SetHeader(key, value string)
- func (client *HttpClient) SetTimeOut(timeOut time.Duration)
- func (client *HttpClient) SetTlsNoVerity() error
- func (client *HttpClient) SetTlsVerity(caFile, certFile, keyFile, passwd string) error
- func (client *HttpClient) SetTlsVerityConfig(tlsConf *tls.Config)
- func (client *HttpClient) SetTlsVerityServer(caFile string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProxyRestHttp ¶
func ProxyRestHttp(req *restful.Request, resp *restful.Response, addr string)
rest-api请求转发
func ReqForward ¶
rest-api http请求代理
Types ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient() *HttpClient
func (*HttpClient) DoWithTimeout ¶
func (*HttpClient) GetClient ¶
func (client *HttpClient) GetClient() *http.Client
func (*HttpClient) GetHeader ¶
func (client *HttpClient) GetHeader(key string) string
func (*HttpClient) NewTransPort ¶
func (client *HttpClient) NewTransPort() *http.Transport
func (*HttpClient) SetHeader ¶
func (client *HttpClient) SetHeader(key, value string)
func (*HttpClient) SetTimeOut ¶
func (client *HttpClient) SetTimeOut(timeOut time.Duration)
func (*HttpClient) SetTlsNoVerity ¶
func (client *HttpClient) SetTlsNoVerity() error
func (*HttpClient) SetTlsVerity ¶
func (client *HttpClient) SetTlsVerity(caFile, certFile, keyFile, passwd string) error
func (*HttpClient) SetTlsVerityConfig ¶
func (client *HttpClient) SetTlsVerityConfig(tlsConf *tls.Config)
func (*HttpClient) SetTlsVerityServer ¶
func (client *HttpClient) SetTlsVerityServer(caFile string) error
Click to show internal directories.
Click to hide internal directories.