types

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type RedisDepthData

type RedisDepthData struct {
	Price string      `json:"price"`
	At    int64       `json:"at"`
	Asks  [][2]string `json:"asks"`
	Bids  [][2]string `json:"bids"`
}

func (*RedisDepthData) JSON

func (r *RedisDepthData) JSON() []byte

type RedisKey

type RedisKey string
const (
	FormatNewOrder             RedisKey = "{prefix}order.list.{symbol}"
	FormatCancelOrder          RedisKey = "{prefix}need.cancel.{symbol}"
	FormatTradeResult          RedisKey = "{prefix}trade.result.{symbol}"
	FormatCancelResult         RedisKey = "{prefix}cancel.result.{symbol}"
	FormatQuoteTradeResult     RedisKey = "{prefix}quote.trade.result.{symbol}"
	FormatWsMessage            RedisKey = "{prefix}ws.message"
	FormatDepthData            RedisKey = "{prefix}depth.{symbol}"
	FormatBroadcastLatestPrice RedisKey = "{prefix}broadcast.latest_price.{symbol}"
)

func (RedisKey) Format

func (r RedisKey) Format(symbol string) string

func (RedisKey) String

func (r RedisKey) String() string

type Status

type Status int
const (
	StatusEnabled Status = 0
	StatusDisable Status = 1
)

func ParseStatusString

func ParseStatusString(v string) Status

type WebSocketMsgType

type WebSocketMsgType string
const (
	MsgDepth       WebSocketMsgType = "depth.{symbol}"
	MsgTrade       WebSocketMsgType = "trade.{symbol}"
	MsgLatestPrice WebSocketMsgType = "price.{symbol}"
	MsgMarketKLine WebSocketMsgType = "kline.{period}.{symbol}"
	MsgMarket24H   WebSocketMsgType = "market.24h.{symbol}"
	MsgOrderCancel WebSocketMsgType = "order.cancel.{symbol}"
	MsgToken       WebSocketMsgType = "token.{token}"
	MsgUser        WebSocketMsgType = "_user.{user_id}" //特殊的类型,通过后端程序设置的属性
)

func (WebSocketMsgType) Format

func (w WebSocketMsgType) Format(data map[string]string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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