httpclient

package
v6.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NonSensitiveHeaders

func NonSensitiveHeaders(h http.Header) 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