httpclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0, Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func CreateDefaultClient

func CreateDefaultClient(certPool *x509.CertPool) *http.Client

func CreateDefaultClientInsecureSkipVerify

func CreateDefaultClientInsecureSkipVerify() *http.Client

func NewMutualTLSClient added in v0.1.0

func NewMutualTLSClient(identity tls.Certificate, caCertPool *x509.CertPool, serverName string) *http.Client

Types

type Client

type Client interface {
	Do(*http.Request) (*http.Response, error)
}

func NewNetworkSafeRetryClient added in v0.1.0

func NewNetworkSafeRetryClient(
	delegate Client,
	maxAttempts uint,
	retryDelay time.Duration,
	logger boshlog.Logger,
) Client

func NewRetryClient added in v0.1.0

func NewRetryClient(
	delegate Client,
	maxAttempts uint,
	retryDelay time.Duration,
	logger boshlog.Logger,
) Client

type DialFunc added in v0.0.10

type DialFunc func(network, address string) (net.Conn, error)

func SOCKS5DialFuncFromEnvironment added in v0.0.10

func SOCKS5DialFuncFromEnvironment(origDialer DialFunc, socks5Proxy ProxyDialer) DialFunc

func (DialFunc) Dial added in v0.0.10

func (f DialFunc) Dial(network, address string) (net.Conn, error)

type HTTPClient

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

func NewHTTPClient

func NewHTTPClient(client Client, logger boshlog.Logger) *HTTPClient

func NewHTTPClientOpts

func NewHTTPClientOpts(client Client, logger boshlog.Logger, opts Opts) *HTTPClient

func (*HTTPClient) Delete

func (c *HTTPClient) Delete(endpoint string) (*http.Response, error)

func (*HTTPClient) DeleteCustomized added in v0.0.10

func (c *HTTPClient) DeleteCustomized(endpoint string, f func(*http.Request)) (*http.Response, error)

func (*HTTPClient) Get

func (c *HTTPClient) Get(endpoint string) (*http.Response, error)

func (*HTTPClient) GetCustomized

func (c *HTTPClient) GetCustomized(endpoint string, f func(*http.Request)) (*http.Response, error)

func (*HTTPClient) Post

func (c *HTTPClient) Post(endpoint string, payload []byte) (*http.Response, error)

func (*HTTPClient) PostCustomized

func (c *HTTPClient) PostCustomized(endpoint string, payload []byte, f func(*http.Request)) (*http.Response, error)

func (*HTTPClient) Put

func (c *HTTPClient) Put(endpoint string, payload []byte) (*http.Response, error)

func (*HTTPClient) PutCustomized

func (c *HTTPClient) PutCustomized(endpoint string, payload []byte, f func(*http.Request)) (*http.Response, error)

type Opts

type Opts struct {
	NoRedactUrlQuery bool
}

type ProxyDialer added in v0.1.0

type ProxyDialer interface {
	Dialer(string, string, string) (proxy.DialFunc, error)
}

type RequestRetryable added in v0.1.0

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

func NewRequestRetryable added in v0.1.0

func NewRequestRetryable(
	request *http.Request,
	delegate Client,
	logger boshlog.Logger,
	isResponseAttemptable func(*http.Response, error) (bool, error),
) *RequestRetryable

func (*RequestRetryable) Attempt added in v0.1.0

func (r *RequestRetryable) Attempt() (bool, error)

func (*RequestRetryable) Response added in v0.1.0

func (r *RequestRetryable) Response() *http.Response

Jump to

Keyboard shortcuts

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