Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetPreDefinedOpts ¶
func SetPreDefinedOpts(opts ...RequestOption)
Pre define some RequestOption here
Types ¶
type ClientOption ¶
type ClientOption struct {
F func(o *ClientOptions)
}
ClientOption is the only struct that can be used to set ClientOptions.
type ClientOptions ¶
type ClientOptions struct { // Timeout for establishing a connection to server DialTimeout time.Duration // The max connection nums for each host MaxConnsPerHost int MaxIdleConnDuration time.Duration MaxConnDuration time.Duration MaxConnWaitTimeout time.Duration MaxIdempotentCallAttempts int KeepAlive bool ReadTimeout time.Duration TLSConfig *tls.Config ResponseBodyStream bool DialFunc func(addr string) (network.Conn, error) }
func NewClientOptions ¶
func NewClientOptions(opts []ClientOption) *ClientOptions
func (*ClientOptions) Apply ¶
func (o *ClientOptions) Apply(opts []ClientOption)
type Option ¶
type Option struct {
F func(o *Options)
}
Option is the only struct that can be used to set Options.
type Options ¶
type Options struct { KeepAliveTimeout time.Duration ReadTimeout time.Duration IdleTimeout time.Duration RedirectTrailingSlash bool MaxRequestBodySize int MaxKeepBodySize int GetOnly bool DisableKeepalive bool RedirectFixedPath bool HandleMethodNotAllowed bool UseRawPath bool RemoveExtraSlash bool UnescapePathValues bool DisablePreParseMultipartForm bool StreamRequestBody bool NoDefaultServerHeader bool Network string Addr string ExitWaitTimeout time.Duration TLS *tls.Config H2C bool ReadBufferSize int ALPN bool Tracers []interface{} TraceLevel interface{} ListenConfig *net.ListenConfig }
func NewOptions ¶
type RequestOption ¶
type RequestOption struct {
F func(o *RequestOptions)
}
RequestOption 是唯一可以用来设置 RequestOption 的类.
type RequestOptions ¶
type RequestOptions struct {
// contains filtered or unexported fields
}
func NewRequestOptions ¶
func NewRequestOptions(opts []RequestOption) *RequestOptions
NewRequestOptions create a *RequestOptions according to the given opts
func (*RequestOptions) Apply ¶
func (o *RequestOptions) Apply(opts []RequestOption)
func (*RequestOptions) CopyTo ¶
func (o *RequestOptions) CopyTo(dst *RequestOptions)
func (*RequestOptions) IsSD ¶
func (o *RequestOptions) IsSD() bool
func (*RequestOptions) Tag ¶
func (o *RequestOptions) Tag(k string) string
Click to show internal directories.
Click to hide internal directories.