rest

package
v0.0.0-...-24c361e Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ENDPOINT = "http://open-api.bybt.com/api/pro/v1"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Status  int
	Message string
}

APIError return the api error

func (APIError) Error

func (e APIError) Error() string

Error return the error message

type Client

type Client struct {
	Auth *auth.Config

	HTTPC       *fasthttp.Client
	HTTPTimeout time.Duration
}

func New

func New(auth *auth.Config) *Client

func (*Client) FundingRateWithChart

func (p *Client) FundingRateWithChart(req *fr.RequestWithChart) (*fr.ResponseWithChart, error)

func (*Client) Liquidation

func (p *Client) Liquidation(req *liquidation.Request) (*liquidation.Response, error)

func (*Client) LiquidationWithChart

func (p *Client) LiquidationWithChart(req *liquidation.RequestWithChart) (*liquidation.ResponseWithChart, error)

func (*Client) OpenInterest

func (p *Client) OpenInterest(req *oi.Request) (*oi.Response, error)

func (*Client) OpenInterestWithChart

func (p *Client) OpenInterestWithChart(req *oi.RequestWithChart) (*oi.ResponseWithChart, error)

type Requester

type Requester interface {
	Path() string
	Method() string
	Query() string
	Payload() []byte
}

type Response

type Response struct {
	Code    string      `json:"code,omitempty"`
	Msg     string      `json:"msg,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Success bool        `json:"success"`
}

Directories

Path Synopsis
futures
fr
oi

Jump to

Keyboard shortcuts

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