utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MPL-2.0-no-copyleft-exception Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStatus

func CheckStatus(resp *http.Response) error

CheckStatus returns error if the status is not 200 OK.

func Get

func Get(url *url.URL, client *http.Client) (*http.Response, error)

Get a *url.URL

func ParseJSON

func ParseJSON(reader io.Reader, dst interface{}) error

ParseJSON simplification of json.NewDecoder.

func RetryRequest

func RetryRequest(ctx context.Context, client *http.Client, req *http.Request, returnChan chan error) (resp *http.Response, retErr error)

RetryRequest attempts a request on the client repeatedly until it succeeds or the context is canceled. It will retry for time.Duration and back off slowly over several polls. If a channel is provided, it will return to the channel when the operation succeeds with any error if relevant, but only calling it sync will return the response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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