api

package
v0.7.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package api provides low-level primitives for HTTP APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(endpoint *url.URL, apiKey string, body []byte) (res string, statusCode int, err error)

Get is a convenience method for MakeAPIRequest.

func GetJSON

func GetJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)

GetJSON is a convenience method for MakeAPIRequest.

func MakeAPIRequest

func MakeAPIRequest(method string, endpoint *url.URL, APIKey string, body []byte) (res []byte, statusCode int, err error)

MakeAPIRequest runs and logs a request backed by a default `http.Client`.

func Post

func Post(endpoint *url.URL, apiKey string, body []byte) (res string, statusCode int, err error)

Post is a convenience method for MakeAPIRequest.

func PostJSON

func PostJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)

PostJSON is a convenience method for MakeAPIRequest.

func PutJSON added in v0.7.0

func PutJSON(endpoint *url.URL, apiKey string, body []byte, v interface{}) (statusCode int, err error)

PutJSON is a convenience method for MakeAPIRequest.

Types

type TimeoutError

type TimeoutError error

TimeoutError is an error caused by an HTTP request timeout.

Directories

Path Synopsis
Package fossa provides a high-level interface to the FOSSA API (by default, located at https://app.fossa.io).
Package fossa provides a high-level interface to the FOSSA API (by default, located at https://app.fossa.io).

Jump to

Keyboard shortcuts

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