api

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	V1 = "exchange/v1/"
	V2 = "v2/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	ID     json.Number `json:"id"`
	Method string      `json:"method"`
	Code   json.Number `json:"code"`
}

type Request

type Request struct {
	ID        int64                  `json:"id"`
	Method    string                 `json:"method"`
	Nonce     int64                  `json:"nonce"`
	Params    map[string]interface{} `json:"params"`
	Signature string                 `json:"sig,omitempty"`
	APIKey    string                 `json:"api_key,omitempty"`
	Version   string                 `json:"version"`
}

type Requester

type Requester struct {
	Client  *http.Client
	BaseURL string
}

func (Requester) CheckErrorResponse

func (Requester) CheckErrorResponse(statusCode int, responseCode json.Number) error

func (Requester) Get

func (r Requester) Get(ctx context.Context, body Request, method string, response interface{}) (int, error)

func (Requester) Post

func (r Requester) Post(ctx context.Context, body Request, method string, response interface{}) (int, error)

Jump to

Keyboard shortcuts

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