Documentation ¶
Index ¶
- Constants
- func Init(loggerIns Logger)
- func NewLongConnClient(timeout time.Duration, retry *RestyRetry) *resty.Client
- func NewLongConnTransport() *http.Transport
- func RequestLongConn(client *resty.Client, req *Req) (httpCode int, resp []byte, err error)
- type DullLogger
- type Logger
- type Method
- type Req
- type RestyRetry
Constants ¶
View Source
const ( MethodUnknown = iota POST GET )
View Source
const ( TypeJSON = "json" TypeXML = "xml" TypeUrlencoded = "urlencoded" TypeForm = "form" TypeFormData = "form-data" TypeHTML = "html" TypeText = "text" TypeMultipart = "multipart" )
Variables ¶
This section is empty.
Functions ¶
func NewLongConnClient ¶
func NewLongConnClient(timeout time.Duration, retry *RestyRetry) *resty.Client
func NewLongConnTransport ¶
Types ¶
type DullLogger ¶
type DullLogger struct{}
func (*DullLogger) Errorf ¶
func (l *DullLogger) Errorf(format string, args ...interface{})
func (*DullLogger) Infof ¶
func (l *DullLogger) Infof(format string, args ...interface{})
func (*DullLogger) Warningf ¶
func (l *DullLogger) Warningf(format string, args ...interface{})
type Req ¶
type Req struct { ApiName string Url string Method Method TargetType string FileName string // for file request Query map[string]string Body interface{} Headers map[string]string Cookies []*http.Cookie RequestId string TimeOut time.Duration RateLimiter *rate.Limiter RespCheck func(content []byte) (err error) }
Click to show internal directories.
Click to hide internal directories.