common

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToInt

func ToInt(digit interface{}) (i int, err error)

func ToInt64

func ToInt64(digit interface{}) (i int64, err error)

func ToJSONList

func ToJSONList(v []byte) []byte

ToJSONList convert v to json list if v is a map

Types

type APIError

type APIError struct {
	Code    int64  `json:"code"`
	Message string `json:"msg"`
}

APIError define API error when response status is 4xx or 5xx

func (APIError) Error

func (e APIError) Error() string

Error return error code and message

type PriceLevel

type PriceLevel struct {
	Price    string
	Quantity string
}

PriceLevel is a common structure for bids and asks in the order book.

func (*PriceLevel) Parse

func (p *PriceLevel) Parse() (float64, float64, error)

Parse parses this PriceLevel's Price and Quantity and returns them both. It also returns an error if either fails to parse.

Jump to

Keyboard shortcuts

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