price

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriceInfo

type PriceInfo struct {
	Price     float32 `json:"price"`
	Timestamp int64   `json:"timestamp"`
	Err       string  `json:"err"`
}

PriceInfo 币价信息

type PriceTool

type PriceTool struct {
	// contains filtered or unexported fields
}

PriceTool 获取币价的工具

func NewPriceTool

func NewPriceTool(endpoint string) *PriceTool

NewPriceTool 返回一个PriceTool实例

func (*PriceTool) GetCurrPrice

func (t *PriceTool) GetCurrPrice(symbol string, forth bool) (*PriceInfo, error)

GetCurrPrice 获取指定交易对的币价,ex: BCH-USDT

func (*PriceTool) GetPriceByTimestamp

func (t *PriceTool) GetPriceByTimestamp(symbol string, ts int64, forth bool) (*PriceInfo, error)

GetPriceByTimestamp 获取指定交易对某个时间戳的币价

Jump to

Keyboard shortcuts

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