api

package
v0.7.24 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 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.

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.com).
Package fossa provides a high-level interface to the FOSSA API (by default, located at https://app.fossa.com).

Jump to

Keyboard shortcuts

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