httpclient

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the http client implementation

func NewClient

func NewClient(opts ...Option) *Client

NewClient returns a new instance of http Client

func (*Client) Delete

func (c *Client) Delete(url string, headers http.Header) (*http.Response, error)

Delete makes a HTTP DELETE request with provided URL

func (*Client) Do

func (c *Client) Do(request *http.Request) (*http.Response, error)

Do makes an HTTP request with the native `http.Do` interface

func (*Client) Get

func (c *Client) Get(url string, headers http.Header) (*http.Response, error)

Get makes a HTTP GET request to provided URL

func (*Client) Patch

func (c *Client) Patch(url string, body io.Reader, headers http.Header) (*http.Response, error)

Patch makes a HTTP PATCH request to provided URL and requestBody

func (*Client) Post

func (c *Client) Post(url string, body io.Reader, headers http.Header) (*http.Response, error)

Post makes a HTTP POST request to provided URL and requestBody

func (*Client) Put

func (c *Client) Put(url string, body io.Reader, headers http.Header) (*http.Response, error)

Put makes a HTTP PUT request to provided URL and requestBody

type Option

type Option func(*Client)

Option represents the client options

func WithHTTPClient

func WithHTTPClient(client heimdall.Doer) Option

WithHTTPClient sets a custom http client

func WithHTTPTimeout

func WithHTTPTimeout(timeout time.Duration) Option

WithHTTPTimeout sets hystrix timeout

func WithRetrier

func WithRetrier(retrier heimdall.Retriable) Option

WithRetrier sets the strategy for retrying

func WithRetryCount

func WithRetryCount(retryCount int) Option

WithRetryCount sets the retry count for the hystrixHTTPClient

Jump to

Keyboard shortcuts

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