httpclient

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPOptions

type HTTPOptions struct {
	Endpoint string
	Body     io.Reader
	Headers  http.Header
	Params   url.Values

	// Ref: https://github.com/cenkalti/backoff/blob/a78d3804c2c84f0a3178648138442c9b07665bda/exponential.go#L76
	// DefaultInitialInterval     = 500 * time.Millisecond
	// DefaultRandomizationFactor = 0.5
	// DefaultMultiplier          = 1.5
	// DefaultMaxInterval         = 60 * time.Second
	// DefaultMaxElapsedTime      = 15 * time.Minute
	ExponentialBackoff *backoff.ExponentialBackOff
}

type HttpClient

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

func New

func New(
	serviceUrl string,
	options HTTPOptions,
) (*HttpClient, error)

func (*HttpClient) Get

func (h *HttpClient) Get(ctx context.Context) (*http.Response, error)

func (*HttpClient) Patch

func (h *HttpClient) Patch(ctx context.Context) (*http.Response, error)

func (*HttpClient) Post

func (h *HttpClient) Post(ctx context.Context) (*http.Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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