api

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: MPL-2.0 Imports: 10 Imported by: 3 modules, 4 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

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