http

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMonitorProxy

func NewMonitorProxy(options ...MonitorProxyOption) *monitorProxy

func NewSlowProxy

func NewSlowProxy(logger log.Logger, name string) *slowProxy

func NewSpyProxy

func NewSpyProxy(logger log.Logger, name string) *spyProxy

func NewStubsProxy

func NewStubsProxy(options ...StubsProxyOption) *stubsProxy

Types

type Client added in v0.0.5

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v0.0.5

func NewClient(options ...Option) *Client

func (*Client) CloseIdleConnections added in v0.0.5

func (c *Client) CloseIdleConnections(ctx context.Context)

func (*Client) Do added in v0.0.5

func (c *Client) Do(ctx context.Context, req *http.Request) (*http.Response, error)

func (*Client) Get added in v0.0.5

func (c *Client) Get(ctx context.Context, url string) (resp *http.Response, err error)

func (*Client) Head added in v0.0.5

func (c *Client) Head(ctx context.Context, url string) (resp *http.Response, err error)

func (*Client) Post added in v0.0.5

func (c *Client) Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error)

func (*Client) PostForm added in v0.0.5

func (c *Client) PostForm(ctx context.Context, url string, data url.Values) (resp *http.Response, err error)

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 MonitorProxyOption

type MonitorProxyOption func(c *monitorProxy)

type MonitorProxyOptions

type MonitorProxyOptions struct{}

func (MonitorProxyOptions) WithConf

func (MonitorProxyOptions) WithLogger

func (MonitorProxyOptions) WithLogger(logger log.Logger) MonitorProxyOption

func (MonitorProxyOptions) WithTracer

use nethttp.Tracer

type Option

type Option func(c *Client)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL