networking

package
v0.0.0-...-200b26a Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(attempts int, sleep time.Duration, fn func() (interface{}, error)) (interface{}, error)

retry provides a recursive function retry implementation

Types

type HTTPClient

type HTTPClient struct {
	Client *http.Client
}

HTTPClient provides a wrapper for *http.Client to abstract shared responsibilities

func New

func New() *HTTPClient

New creates a new HTTPClient

func (*HTTPClient) Do

func (c *HTTPClient) Do(req *http.Request, successV, failureV OK) (*http.Response, error)

Do performs an Http request, decodes and validates the response

type OK

type OK interface {
	OK() error
}

OK represents types capable of validating themselves.

Jump to

Keyboard shortcuts

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