Documentation ¶
Index ¶
- Constants
- type Component
- type Config
- type Container
- type Option
- func WithAddr(addr string) Option
- func WithDebug(debug bool) Option
- func WithEnableAccessInterceptor(enableAccessInterceptor bool) Option
- func WithEnableAccessInterceptorReply(enableAccessInterceptorReply bool) Option
- func WithRawDebug(rawDebug bool) Option
- func WithReadTimeout(readTimeout time.Duration) Option
- func WithSlowLogThreshold(slowLogThreshold time.Duration) Option
Constants ¶
View Source
const PackageName = "client.ehttp"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addr string // 连接地址 Debug bool // 是否开启调试,默认不开启,开启后并加上export EGO_DEBUG=true,可以看到每次请求,配置名、地址、耗时、请求数据、响应数据 RawDebug bool // 是否开启原生调试,默认不开启 ReadTimeout time.Duration // 读超时,默认2s SlowLogThreshold time.Duration // 慢日志记录的阈值,默认500ms EnableAccessInterceptor bool // 是否开启记录请求数据,默认不开启 EnableAccessInterceptorReply bool // 是否开启记录响应参数,默认不开启 }
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
func DefaultContainer ¶
func DefaultContainer() *Container
type Option ¶
type Option func(c *Container)
func WithEnableAccessInterceptor ¶ added in v0.3.4
func WithEnableAccessInterceptorReply ¶ added in v0.3.4
func WithRawDebug ¶ added in v0.3.4
func WithReadTimeout ¶ added in v0.3.4
func WithSlowLogThreshold ¶ added in v0.3.4
Click to show internal directories.
Click to hide internal directories.