httpclient

package
v17.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 11 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

HTTPClient is the interface of an http client

func NewHTTPClient

func NewHTTPClient(deps dependencies) HTTPClient

NewHTTPClient creates a new http client

type RateLimit added in v17.1.0

type RateLimit struct {
	Bucket       string
	Limit        int
	LastReported time.Time
	ResetAt      time.Time
}

type RateLimiter added in v17.1.0

type RateLimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*RateLimiter) Report added in v17.1.0

func (r *RateLimiter) Report(b string, limit int, reset, at time.Time)

func (*RateLimiter) Wait added in v17.1.0

func (r *RateLimiter) Wait(ctx context.Context, b string) error

Jump to

Keyboard shortcuts

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