Documentation
¶
Index ¶
- func NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy
- func NewSlowProxy(logger log.Logger, name string) *slowProxy
- func NewSpyProxy(logger log.Logger, name string) *spyProxy
- func NewStubsProxy(options ...StubsProxyOption) *stubsProxy
- type ClientOptions
- type HttpClient
- func (this *HttpClient) CloseIdleConnections(ctx context.Context)
- func (this *HttpClient) Do(ctx context.Context, req *http.Request) (*http.Response, error)
- func (this *HttpClient) Get(ctx context.Context, url string) (resp *http.Response, err error)
- func (this *HttpClient) Head(ctx context.Context, url string) (resp *http.Response, err error)
- func (this *HttpClient) Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error)
- func (this *HttpClient) PostForm(ctx context.Context, url string, data url.Values) (resp *http.Response, err error)
- type MonitorProxyOption
- type MonitorProxyOptions
- type Option
- type StubsProxyOption
- type StubsProxyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMonitorProxy ¶
func NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy
func NewSlowProxy ¶
func NewSpyProxy ¶
func NewStubsProxy ¶
func NewStubsProxy(options ...StubsProxyOption) *stubsProxy
Types ¶
type ClientOptions ¶
type ClientOptions struct{}
func (ClientOptions) WithLogger ¶
func (ClientOptions) WithLogger(logger log.Logger) Option
func (ClientOptions) WithProxy ¶
func (ClientOptions) WithProxy(proxy ...func() interface{}) Option
func (ClientOptions) WithTimeOut ¶
func (ClientOptions) WithTimeOut(timeout time.Duration) Option
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func NewHttpClient ¶
func NewHttpClient(options ...Option) *HttpClient
func (*HttpClient) CloseIdleConnections ¶
func (this *HttpClient) CloseIdleConnections(ctx context.Context)
type MonitorProxyOption ¶
type MonitorProxyOption func(c *monitorProxy)
type MonitorProxyOptions ¶
type MonitorProxyOptions struct{}
func (MonitorProxyOptions) WithConf ¶
func (MonitorProxyOptions) WithConf(conf config.Config) MonitorProxyOption
func (MonitorProxyOptions) WithLogger ¶
func (MonitorProxyOptions) WithLogger(logger log.Logger) MonitorProxyOption
func (MonitorProxyOptions) WithTracer ¶
func (MonitorProxyOptions) WithTracer(tracer opentracing2.Tracer) MonitorProxyOption
use nethttp.Tracer
type Option ¶
type Option func(c *HttpClient)
type StubsProxyOption ¶
type StubsProxyOption func(c *stubsProxy)
type StubsProxyOptions ¶
type StubsProxyOptions struct{}
func (StubsProxyOptions) WithLogger ¶
func (StubsProxyOptions) WithLogger(logger log.Logger) StubsProxyOption
func (StubsProxyOptions) WithName ¶
func (StubsProxyOptions) WithName(name string) StubsProxyOption
func (StubsProxyOptions) WithRespFunc ¶
func (StubsProxyOptions) WithRespFunc(respFunc func(*http.Request) *http.Response) StubsProxyOption
Click to show internal directories.
Click to hide internal directories.