client

package
v0.0.0-...-33f150c Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package client contains methods to make request to Covalent API server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	URL        string
	Key        string
	HTTPClient *http.Client
	UserAgent  string
}

API is a Binance API client.

func New

func New(url, key string, httpClient *http.Client) *API

New initializes API with given URL, api key. It also provides a way to overwrite *http.Client

func (*API) Request

func (a *API) Request(method, endpoint string, params interface{}, out interface{}) error

type CovalentError

type CovalentError struct {
	Code int    `json:"error_code"`
	Msg  string `json:"error_message"`
}

CovalentError handles api errors from covalenthq.com.

func (CovalentError) Error

func (e CovalentError) Error() string

Error returns error message from Covalent API.

Jump to

Keyboard shortcuts

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