client

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 15 Imported by: 0

README

http-client-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StandardBackOffStrategy

func StandardBackOffStrategy(expFactor time.Duration, generator *rand.Rand, stdDeviation float64) strategy.Strategy

Types

type BytesReadSeekCloser

type BytesReadSeekCloser struct {
	*bytes.Reader
}

func NewBytesSeekReader

func NewBytesSeekReader(b []byte) *BytesReadSeekCloser

func (*BytesReadSeekCloser) Close

func (b *BytesReadSeekCloser) Close() error

type Client

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

func New

func New(opts ...Option) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, opts ...Option) (*http.Response, error)

func (*Client) Get

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

func (*Client) Head

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

func (*Client) Post

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

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithRetryPolicy

func WithRetryPolicy(requestTimeout time.Duration, maxRetries uint, strategies ...strategy.Strategy) Option

func WithSpanCarrierInjected

func WithSpanCarrierInjected() Option

func WithStandardRetryPolicy

func WithStandardRetryPolicy(requestTimeout time.Duration, maxRetries uint) Option

func WithTracingOptions

func WithTracingOptions(enabled bool, operationName string, spanOptions ...opentracing.StartSpanOption) Option

Jump to

Keyboard shortcuts

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