models

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormattedData

type FormattedData struct {
	EventTime   int64
	Symbol      string
	LastPrice   float64
	PriceChange float64
	HighPrice   float64
	LowPrice    float64
	Volume      float64
	QuoteVolume float64
	OpenTime    int64
	CloseTime   int64
	TradeCount  int
	Latency     int64
}

FormattedData represents the structure of the processed data

func FormatTickerData

func FormatTickerData(td TickerData) FormattedData

FormatTickerData converts TickerData to FormattedData

type TickerData

type TickerData struct {
	EventType    string      `json:"e"`
	EventTime    utils.Int64 `json:"E"`
	Symbol       string      `json:"s"`
	LastPrice    string      `json:"c"`
	PriceChange  string      `json:"p"`
	HighPrice    string      `json:"h"`
	LowPrice     string      `json:"l"`
	Volume       string      `json:"v"`
	QuoteVolume  string      `json:"q"`
	OpenTime     utils.Int64 `json:"O"`
	CloseTime    utils.Int64 `json:"C"`
	FirstTradeID int         `json:"F"`
	LastTradeID  int         `json:"L"`
	TradeCount   int         `json:"n"`
}

TickerData represents the structure of the incoming WebSocket message

Jump to

Keyboard shortcuts

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