Documentation ¶
Index ¶
- Constants
- func CandlesFormatWithGranularityProductId(granularity int64, productId string) string
- func StartServer()
- type CandlesMessage
- type Channel
- type Client
- type FundsMessage
- type Level2Change
- type Level2SnapshotMessage
- type Level2Type
- type Level2UpdateMessage
- type MatchMessage
- type MatchStream
- type OrderBookFullSnapshot
- type OrderBookLevel2Snapshot
- type OrderBookStream
- type OrderMessage
- type PriceLevel
- type Request
- type Response
- type Server
- type TickerMessage
- type TickerStream
- type TradeMessage
Constants ¶
View Source
const ( Level2TypeSnapshot = Level2Type("snapshot") Level2TypeUpdate = Level2Type("l2update") ChannelTicker = Channel("ticker") ChannelMatch = Channel("match") ChannelTrade = Channel("trade") ChannelLevel2 = Channel("level2") ChannelFunds = Channel("funds") ChannelOrder = Channel("order") ChannelCandles1m = Channel("candles_1m") ChannelCandles3m = Channel("candles_3m") ChannelCandles5m = Channel("candles_5m") ChannelCandles15m = Channel("candles_15m") ChannelCandles30m = Channel("candles_30m") ChannelCandles60m = Channel("candles_60m") ChannelCandles120m = Channel("candles_120m") ChannelCandles240m = Channel("candles_240m") ChannelCandles360m = Channel("candles_360m") ChannelCandles720m = Channel("candles_720m") ChannelCandles1440m = Channel("candles_1440m") )
Variables ¶
This section is empty.
Functions ¶
func StartServer ¶
func StartServer()
Types ¶
type CandlesMessage ¶
type Channel ¶
type Channel string
func (Channel) FormatWithProductId ¶
func (Channel) FormatWithUserId ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
每个连接对应一个client,client负责该连接的数据I/O
type FundsMessage ¶
type Level2Change ¶
type Level2SnapshotMessage ¶
type Level2SnapshotMessage struct { Type Level2Type `json:"type"` ProductId string `json:"productId"` Bids [][3]interface{} `json:"bids"` // [["6500.15", "0.57753524"]] Asks [][3]interface{} `json:"asks"` }
type Level2Type ¶
type Level2Type string
type Level2UpdateMessage ¶
type Level2UpdateMessage struct { Type Level2Type `json:"type"` ProductId string `json:"productId"` Changes [][3]interface{} `json:"changes"` // ["buy", "6500.09", "0.84702376"], }
type MatchMessage ¶
type MatchMessage struct { Type string `json:"type"` TradeSeq int64 `json:"tradeSeq"` Sequence int64 `json:"sequence"` Time string `json:"time"` ProductId string `json:"productId"` Price string `json:"price"` Size string `json:"size"` MakerOrderId string `json:"makerOrderId"` TakerOrderId string `json:"takerOrderId"` Side string `json:"side"` }
type MatchStream ¶
type MatchStream struct {
// contains filtered or unexported fields
}
func (*MatchStream) OnDoneLog ¶
func (s *MatchStream) OnDoneLog(log *matching.DoneLog, offset int64)
func (*MatchStream) OnMatchLog ¶
func (s *MatchStream) OnMatchLog(log *matching.MatchLog, offset int64)
func (*MatchStream) OnOpenLog ¶
func (s *MatchStream) OnOpenLog(log *matching.OpenLog, offset int64)
func (*MatchStream) Start ¶
func (s *MatchStream) Start()
type OrderBookFullSnapshot ¶
type OrderBookLevel2Snapshot ¶
type OrderBookStream ¶
type OrderBookStream struct {
// contains filtered or unexported fields
}
func (*OrderBookStream) OnDoneLog ¶
func (s *OrderBookStream) OnDoneLog(log *matching.DoneLog, offset int64)
func (*OrderBookStream) OnMatchLog ¶
func (s *OrderBookStream) OnMatchLog(log *matching.MatchLog, offset int64)
func (*OrderBookStream) OnOpenLog ¶
func (s *OrderBookStream) OnOpenLog(log *matching.OpenLog, offset int64)
func (*OrderBookStream) Start ¶
func (s *OrderBookStream) Start()
type OrderMessage ¶
type OrderMessage struct { UserId int64 `json:"userId"` Type string `json:"type"` Sequence int64 `json:"sequence"` Id string `json:"id"` Price string `json:"price"` Size string `json:"size"` Funds string `json:"funds"` ProductId string `json:"productId"` Side string `json:"side"` OrderType string `json:"orderType"` CreatedAt string `json:"createdAt"` FillFees string `json:"fillFees"` FilledSize string `json:"filledSize"` ExecutedValue string `json:"executedValue"` Status string `json:"status"` Settled bool `json:"settled"` }
type PriceLevel ¶
type TickerMessage ¶
type TickerMessage struct { Type string `json:"type"` TradeSeq int64 `json:"tradeSeq"` Sequence int64 `json:"sequence"` Time string `json:"time"` ProductId string `json:"productId"` Price string `json:"price"` Side string `json:"side"` LastSize string `json:"lastSize"` BestBid string `json:"bestBid"` BestAsk string `json:"bestAsk"` Volume24h string `json:"volume24h"` Volume30d string `json:"volume30d"` Low24h string `json:"low24h"` Open24h string `json:"open24h"` }
type TickerStream ¶
type TickerStream struct {
// contains filtered or unexported fields
}
func (*TickerStream) OnDoneLog ¶
func (s *TickerStream) OnDoneLog(log *matching.DoneLog, offset int64)
func (*TickerStream) OnMatchLog ¶
func (s *TickerStream) OnMatchLog(log *matching.MatchLog, offset int64)
func (*TickerStream) OnOpenLog ¶
func (s *TickerStream) OnOpenLog(log *matching.OpenLog, offset int64)
func (*TickerStream) Start ¶
func (s *TickerStream) Start()
type TradeMessage ¶
Click to show internal directories.
Click to hide internal directories.