rapidapi

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2022 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API added in v0.4.0

type API interface {
	Call(endpoint string) (body []byte, err error)
	CallWithContext(ctx context.Context, endpoint string) (body []byte, err error)
}

API interface for a RapiAPI client

type Client

type Client struct {
	HTTPClient *http.Client
	Hostname   string
	URL        string
	APIKey     string
}

Client represents a RapidAPI client

APIKey should contain the RapidAPI API Key If Hostname is set, it will be used to construct the URL and fill in the x-rapidapi-host header field. For unit tests, set the URL field and ignore the Hostname field.

func (*Client) Call

func (client *Client) Call(endpoint string) (body []byte, err error)

Call an endpoint on the API

func (*Client) CallWithContext added in v0.3.0

func (client *Client) CallWithContext(ctx context.Context, endpoint string) (body []byte, err error)

CallWithContext calls an endpoint on the API with a provided context

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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