Documentation ¶
Index ¶
- type Body
- type ContentType
- type Cookies
- type HcError
- type HeaderMap
- type HttpClient
- func (hc *HttpClient) DownloadFile(filePath, fileName string) *HttpClient
- func (hc *HttpClient) GetBytes(body *[]byte) *HttpClient
- func (hc *HttpClient) GetMap(m map[string]interface{}) *HttpClient
- func (hc *HttpClient) GetString(str *string) *HttpClient
- func (hc *HttpClient) GetStruct(data interface{}) *HttpClient
- func (hc *HttpClient) Retry(retry int, retryInterval []int) *HttpClient
- func (hc *HttpClient) SaveReturnBizData(result interface{})
- type QueryMap
- type RequestClientOptions
- type RequestClientPr
- type RequestConfig
- type SplitTable
- type TableName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpClient ¶
type HttpClient struct { RequestConfig Error error // contains filtered or unexported fields }
func (*HttpClient) DownloadFile ¶
func (hc *HttpClient) DownloadFile(filePath, fileName string) *HttpClient
DownloadFile *
- @Description: 下载文件
- @receiver hc
- @param filePath 文件保存地址
- @param fileName 文件名
- @return *HttpClient
func (*HttpClient) GetBytes ¶
func (hc *HttpClient) GetBytes(body *[]byte) *HttpClient
GetBytes *
- @Description: 获取Bytes
- @receiver hc
- @param body
- @return *HttpClient
func (*HttpClient) GetMap ¶
func (hc *HttpClient) GetMap(m map[string]interface{}) *HttpClient
GetMap *
- @Description: 获取Map
- @receiver hc
- @param m
- @return *HttpClient
func (*HttpClient) GetString ¶
func (hc *HttpClient) GetString(str *string) *HttpClient
GetString *
- @Description: 获取字符串
- @receiver hc
- @param str
- @return *HttpClient
func (*HttpClient) GetStruct ¶
func (hc *HttpClient) GetStruct(data interface{}) *HttpClient
GetStruct *
- @Description: 将结果保存到结构体
- @receiver hc
- @param data
- @return *HttpClient
func (*HttpClient) Retry ¶
func (hc *HttpClient) Retry(retry int, retryInterval []int) *HttpClient
Retry *
- @Description: 重试
- @receiver hc
- @param retry 重试次数
- @param retryInterval 每次重试之间的间隔(如:[2,2,2,2,2]、[1,2,3,4,5])
- @return *HttpClient
func (*HttpClient) SaveReturnBizData ¶
func (hc *HttpClient) SaveReturnBizData(result interface{})
SaveReturnBizData *
- @Description: 保存业务
- @receiver hc
- @param result
type RequestClientOptions ¶
type RequestClientOptions interface {
// contains filtered or unexported methods
}
type RequestClientPr ¶
type RequestConfig ¶
type RequestConfig struct { TimeOut int // 超时时间 DB *gorm.DB // 数据库对象 InsecureSkipVerify bool // InsecureSkipVerify为true,client将不再对服务端的证书进行校验 // contains filtered or unexported fields }
func (*RequestConfig) NewHttpClient ¶
func (rc *RequestConfig) NewHttpClient() *http.Client
NewHttpClient *
- @Description: 创建Http连接池
- @receiver rc
- @return *http.Client
func (*RequestConfig) Request ¶
func (rc *RequestConfig) Request(urlPath, method string, data interface{}, rcd *clientmod.HttpRequestRcd, opts ...RequestClientOptions) (hc *HttpClient)
Request *
- @Description: 创建请求
- @receiver rc
- @param url
- @param method
- @param data
Click to show internal directories.
Click to hide internal directories.