client

package
v0.0.0-...-f82f096 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// USERAGENT based on $(git describe --always) and set by 'scripts/build.sh'
	USERAGENT = "unset"
)

Functions

func Fetch

func Fetch(client *http.Client, url url.URL, target interface{}) error

Fetch queries an API endpoint and expects to receive JSON. It then unmarshals the JSON to the interface{} provided by the caller. By returning data this way, Fetch() ensures that JSON is always unmarshaled the same way, and that errors are handled correctly, but allows the returned data to be mapped to an arbitrary struct that the caller is aware of.

Types

This section is empty.

Jump to

Keyboard shortcuts

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