Documentation ¶
Index ¶
- Variables
- func Register(name string, filter NewFilter)
- func ToBodyType(s string) color.BodyType
- type Bencher
- type Context
- type Curl
- type DataFlow
- func (df *DataFlow) BindBody(obj interface{}) *DataFlow
- func (df *DataFlow) BindHeader(obj interface{}) *DataFlow
- func (df *DataFlow) BindJSON(obj interface{}) *DataFlow
- func (df *DataFlow) BindXML(obj interface{}) *DataFlow
- func (df *DataFlow) BindYAML(obj interface{}) *DataFlow
- func (df *DataFlow) Callback(cb func(*Context) error) *DataFlow
- func (df *DataFlow) Code(httpCode *int) *DataFlow
- func (df *DataFlow) DELETE(url string) *DataFlow
- func (df *DataFlow) Debug(d ...interface{}) *DataFlow
- func (df *DataFlow) Do() (err error)
- func (df *DataFlow) E() *export
- func (df *DataFlow) Export() *export
- func (df *DataFlow) F() *filter
- func (df *DataFlow) Filter() *filter
- func (df *DataFlow) GET(url string) *DataFlow
- func (df *DataFlow) GetHost() (string, error)
- func (df *DataFlow) HEAD(url string) *DataFlow
- func (df *DataFlow) IsDebug() bool
- func (df *DataFlow) OPTIONS(url string) *DataFlow
- func (df *DataFlow) PATCH(url string) *DataFlow
- func (df *DataFlow) POST(url string) *DataFlow
- func (df *DataFlow) PUT(url string) *DataFlow
- func (df *DataFlow) SetBody(obj interface{}) *DataFlow
- func (df *DataFlow) SetCookies(c ...*http.Cookie) *DataFlow
- func (df *DataFlow) SetForm(obj ...interface{}) *DataFlow
- func (df *DataFlow) SetGout(out *Gout)
- func (df *DataFlow) SetHeader(obj ...interface{}) *DataFlow
- func (df *DataFlow) SetHost(host string) *DataFlow
- func (df *DataFlow) SetJSON(obj interface{}) *DataFlow
- func (df *DataFlow) SetMethod(method string) *DataFlow
- func (df *DataFlow) SetProxy(proxyURL string) *DataFlow
- func (df *DataFlow) SetQuery(obj ...interface{}) *DataFlow
- func (df *DataFlow) SetRequest(req *http.Request) *DataFlow
- func (df *DataFlow) SetSOCKS4(addr string) *DataFlow
- func (df *DataFlow) SetSOCKS5(addr string) *DataFlow
- func (df *DataFlow) SetTimeout(d time.Duration) *DataFlow
- func (df *DataFlow) SetURL(url string) *DataFlow
- func (df *DataFlow) SetWWWForm(obj ...interface{}) *DataFlow
- func (df *DataFlow) SetXML(obj interface{}) *DataFlow
- func (df *DataFlow) SetYAML(obj interface{}) *DataFlow
- func (df *DataFlow) UnixSocket(path string) *DataFlow
- func (df *DataFlow) WithContext(c context.Context) *DataFlow
- type DebugFunc
- type DebugOpt
- type DebugOption
- type Do
- type Export
- type Filter
- type Gout
- type NewFilter
- type Req
- type Retry
- type TraceInfo
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultClient The default http client, which has a connection pool DefaultClient = http.Client{} // DefaultBenchClient is the default http client used by the benchmark, // which has a connection pool DefaultBenchClient = http.Client{ Transport: &http.Transport{ MaxIdleConnsPerHost: 10000, }, } )
Functions ¶
func ToBodyType ¶
ToBodyType Returns the http body type, which mainly affects color highlighting
Types ¶
type DataFlow ¶
type DataFlow struct { Req // contains filtered or unexported fields }
DataFlow is the core data structure, including the encoder and decoder of http data
func (*DataFlow) BindBody ¶
BindBody parse the variables in http body to obj. obj must be a pointer variable
func (*DataFlow) BindHeader ¶
BindHeader parse http header to obj variable. obj must be a pointer variable Support string/int/float/slice ... types
func (*DataFlow) BindJSON ¶
BindJSON parse the json string in http body to obj. obj must be a pointer variable
func (*DataFlow) BindXML ¶
BindXML parse the xml string in http body to obj. obj must be a pointer variable
func (*DataFlow) BindYAML ¶
BindYAML parse the yaml string in http body to obj. obj must be a pointer variable
func (*DataFlow) Callback ¶
Callback parse the http body into obj according to the condition (json or string)
func (*DataFlow) E ¶
func (df *DataFlow) E() *export
E filter function, use this function to turn on the filter function
func (*DataFlow) Export ¶
func (df *DataFlow) Export() *export
Export filter function, use this function to turn on the filter function
func (*DataFlow) F ¶
func (df *DataFlow) F() *filter
F filter function, use this function to turn on the filter function
func (*DataFlow) Filter ¶
func (df *DataFlow) Filter() *filter
Filter filter function, use this function to turn on the filter function
func (*DataFlow) SetCookies ¶
SetCookies set cookies
func (*DataFlow) SetJSON ¶
SetJSON send json to the http body, Support raw json(string, []byte)/struct/map types
func (*DataFlow) SetQuery ¶
SetQuery send URL query string, Support string/[]byte/struct/map/slice types
func (*DataFlow) SetTimeout ¶
SetTimeout set timeout, and WithContext are mutually exclusive functions
func (*DataFlow) SetWWWForm ¶
SetWWWForm send x-www-form-urlencoded to the http body, Support struct/map/array/slice types
func (*DataFlow) UnixSocket ¶
UnixSocket 函数会修改Transport, 请像对待全局变量一样对待UnixSocket
type DebugFunc ¶
type DebugFunc func(*DebugOption)
DebugFunc DebugOpt is a function that manipulates core data structures
func (DebugFunc) Apply ¶
func (f DebugFunc) Apply(o *DebugOption)
Apply is an interface for operating DebugOption
type DebugOpt ¶
type DebugOpt interface {
Apply(*DebugOption)
}
DebugOpt is an interface for operating DebugOption
type DebugOption ¶
type DebugOption struct { Write io.Writer Debug bool Color bool Trace bool ReqBodyType string RspBodyType string TraceInfo }
DebugOption Debug mode core data structure
type Req ¶
type Req struct { Err error // contains filtered or unexported fields }
Req controls core data structure of http request