data_type

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Depth

type Depth struct {
	Ch   string `json:"ch"`
	Ts   uint   `json:"ts"`
	Tick struct {
		Bids [][]float64 `json:"bids"`
		Asks [][]float64 `json:"asks"`
	} `json:"tick"`
}

func DecodeDepth

func DecodeDepth(raw []byte) (*Depth, error)

type Kline

type Kline struct {
	Ch   string    `json:"ch"`
	Ts   uint      `json:"ts"`
	Tick KlineTick `json:"tick"`
}

func DecodeKline

func DecodeKline(raw []byte) (*Kline, error)

type KlineTick

type KlineTick struct {
	ID     uint    `json:"id"`
	Amount float64 `json:"amount"`
	Count  uint    `json:"count"`
	Open   float64 `json:"open"`
	Close  float64 `json:"close"`
	Low    float64 `json:"low"`
	High   float64 `json:"high"`
	Vol    float64 `json:"vol"`
}

type Trade

type Trade struct {
	Ch   string `json:"ch"`
	Ts   uint   `json:"ts"`
	Tick struct {
		ID   uint        `json:"id"`
		Ts   uint        `json:"ts"`
		Data []TradeItem `json:"data"`
	} `json:"tick"`
}

func DecodeTrade

func DecodeTrade(raw []byte) (*Trade, error)

type TradeItem

type TradeItem struct {
	Ts        uint    `json:"ts"`
	ID        uint    `json:"id"`
	Direction string  `json:"direction"`
	Amount    float64 `json:"amount"`
	Price     float64 `json:"price"`
}

Jump to

Keyboard shortcuts

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