httpclient

package
v6.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NonSensitiveHeaders

func NonSensitiveHeaders(h http.Header) (h2 http.Header)

NonSensitiveHeaders is a helper to strip out sensitive data from headers when logging

Types

type Doer

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

Doer is the interface for the underlying client that this package wraps around

type HTTPClient

type HTTPClient interface {
	SetHeaders(http.Header)
	Get(context.Context, string, *http.Header) (*http.Response, error)
	GetBody(context.Context, string, *http.Header) (*http.Response, []byte, error)
	Post(context.Context, string, *http.Header, io.Reader) (*http.Response, error)
	PostBody(context.Context, string, *http.Header, io.Reader) (*http.Response, []byte, error)
}

HTTPClient is the interface of an http client

func NewHTTPClient

func NewHTTPClient(deps dependencies) HTTPClient

NewHTTPClient creates a new http client

Jump to

Keyboard shortcuts

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