Documentation
¶
Overview ¶
@auther fenglei
@auther fenglei
Index ¶
- Constants
- func BuildParams(contentType string, params interface{}, noUrlEncode ...bool) string
- type AntsParam
- type AntsReqMessage
- type OpsHttpClient
- func (e *OpsHttpClient) AntsHttp(params []*AntsParam, PoolNum int) *garray.Array
- func (e *OpsHttpClient) HttpFileDownRequest(url, filePath string) error
- func (e *OpsHttpClient) HttpRequest(postUrl string, data ...interface{}) (message ReqMessage)
- func (e *OpsHttpClient) HttpRequestRetry(postUrl string, data ...interface{}) (message ReqMessage)
- func (e *OpsHttpClient) HttpRequestRetryParam(postUrl string, attempts uint, delay time.Duration, data ...interface{}) (messgae ReqMessage)
- type ReqMessage
- type TBaseResults
Constants ¶
View Source
const ( HttpContentTypeJson = "application/json" HttpContentTypeUrlEncoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
func BuildParams ¶
Types ¶
type AntsParam ¶
type AntsParam struct { Url string Data interface{} //透传值 Unvarnished interface{} }
type AntsReqMessage ¶
type AntsReqMessage struct { Code int Body string Err error Url string //透传值 Unvarnished interface{} }
ReqMessage 返回
type OpsHttpClient ¶
type OpsHttpClient struct { Method string IsWan bool //是否外网 TimeOut time.Duration //超时时间 ContentType string //头类型 HeaderMap *gmap.StrStrMap //header Map Attempts uint //重试次数 Delay time.Duration // 每次重试间隔10秒 DownFileMax int }
func NewHttpClient ¶
func NewHttpClient() *OpsHttpClient
func (*OpsHttpClient) AntsHttp ¶
func (e *OpsHttpClient) AntsHttp(params []*AntsParam, PoolNum int) *garray.Array
func (*OpsHttpClient) HttpFileDownRequest ¶
func (e *OpsHttpClient) HttpFileDownRequest(url, filePath string) error
func (*OpsHttpClient) HttpRequest ¶
func (e *OpsHttpClient) HttpRequest(postUrl string, data ...interface{}) (message ReqMessage)
HttpPostRequest post请求
func (*OpsHttpClient) HttpRequestRetry ¶
func (e *OpsHttpClient) HttpRequestRetry(postUrl string, data ...interface{}) (message ReqMessage)
func (*OpsHttpClient) HttpRequestRetryParam ¶
func (e *OpsHttpClient) HttpRequestRetryParam(postUrl string, attempts uint, delay time.Duration, data ...interface{}) (messgae ReqMessage)
type TBaseResults ¶
type TBaseResults struct { B bool Code string `json:"code"` Message string `json:"message"` Result interface{} `json:"result"` }
func HttpInterfaceReq ¶
func HttpInterfaceReq(postUrl string, data ...interface{}) (t *TBaseResults)
Click to show internal directories.
Click to hide internal directories.