Documentation ¶
Index ¶
- Constants
- Variables
- type BookDepthTopicParam
- type BookDiffDepthTopicParam
- type KlineTopicParam
- type Listener
- type SpotMarketStreamCfg
- type SpotMarketStreamClient
- func (m *SpotMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
- func (m *SpotMarketStreamClient) Close() error
- func (m *SpotMarketStreamClient) GetAggTradeTopic(symbol string) (string, error)
- func (m *SpotMarketStreamClient) GetAllMarketMiniTickersTopic() (string, error)
- func (m *SpotMarketStreamClient) GetAllMarketTickersTopic() (string, error)
- func (m *SpotMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
- func (m *SpotMarketStreamClient) GetBookDiffDepthTopic(params *BookDiffDepthTopicParam) (string, error)
- func (m *SpotMarketStreamClient) GetBookTickerTopic(symbol string) (string, error)
- func (m *SpotMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
- func (m *SpotMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
- func (m *SpotMarketStreamClient) GetMiniTickerTopic(symbol string) (string, error)
- func (m *SpotMarketStreamClient) GetTickerTopic(symbol string) (string, error)
- func (m *SpotMarketStreamClient) GetTradeTopic(symbol string) (string, error)
- func (m *SpotMarketStreamClient) IsConnected() bool
- func (m *SpotMarketStreamClient) Open() error
- func (m *SpotMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
- func (m *SpotMarketStreamClient) Subscribe(topics []string) error
- func (m *SpotMarketStreamClient) UnSubscribe(topics []string) error
Constants ¶
View Source
const ( SUBSCRIBE = "SUBSCRIBE" UNSUBSCRIBE = "UNSUBSCRIBE" )
View Source
const (
MaxTryTimes = 5
)
Variables ¶
View Source
var ( SpotMarketStreamBaseURL = "wss://data-stream.binance.vision" CombinedStreamRouter = "/stream" )
Functions ¶
This section is empty.
Types ¶
type BookDepthTopicParam ¶
type BookDiffDepthTopicParam ¶
type KlineTopicParam ¶
type KlineTopicParam struct { Symbol string `validate:"required"` Interval spotutils.KlineInterval `validate:"required,oneof=1s 1m 3m 5m 15m 30m 1h 2h 4h 6h 8h 12h 1d 3d 1w 1M"` }
type SpotMarketStreamCfg ¶
type SpotMarketStreamClient ¶
type SpotMarketStreamClient struct {
// contains filtered or unexported fields
}
func NewSpotMarketStreamClient ¶
func NewSpotMarketStreamClient(cfg *SpotMarketStreamCfg) (*SpotMarketStreamClient, error)
func (*SpotMarketStreamClient) AddListener ¶
func (m *SpotMarketStreamClient) AddListener(event string, listener Listener) *emission.Emitter
func (*SpotMarketStreamClient) Close ¶
func (m *SpotMarketStreamClient) Close() error
func (*SpotMarketStreamClient) GetAggTradeTopic ¶
func (m *SpotMarketStreamClient) GetAggTradeTopic(symbol string) (string, error)
func (*SpotMarketStreamClient) GetAllMarketMiniTickersTopic ¶
func (m *SpotMarketStreamClient) GetAllMarketMiniTickersTopic() (string, error)
func (*SpotMarketStreamClient) GetAllMarketTickersTopic ¶
func (m *SpotMarketStreamClient) GetAllMarketTickersTopic() (string, error)
func (*SpotMarketStreamClient) GetBookDepthTopic ¶
func (m *SpotMarketStreamClient) GetBookDepthTopic(params *BookDepthTopicParam) (string, error)
func (*SpotMarketStreamClient) GetBookDiffDepthTopic ¶
func (m *SpotMarketStreamClient) GetBookDiffDepthTopic(params *BookDiffDepthTopicParam) (string, error)
func (*SpotMarketStreamClient) GetBookTickerTopic ¶
func (m *SpotMarketStreamClient) GetBookTickerTopic(symbol string) (string, error)
func (*SpotMarketStreamClient) GetKlineTopic ¶
func (m *SpotMarketStreamClient) GetKlineTopic(params *KlineTopicParam) (string, error)
func (*SpotMarketStreamClient) GetListeners ¶
func (m *SpotMarketStreamClient) GetListeners(event string, argument any) *emission.Emitter
func (*SpotMarketStreamClient) GetMiniTickerTopic ¶
func (m *SpotMarketStreamClient) GetMiniTickerTopic(symbol string) (string, error)
func (*SpotMarketStreamClient) GetTickerTopic ¶
func (m *SpotMarketStreamClient) GetTickerTopic(symbol string) (string, error)
func (*SpotMarketStreamClient) GetTradeTopic ¶
func (m *SpotMarketStreamClient) GetTradeTopic(symbol string) (string, error)
func (*SpotMarketStreamClient) IsConnected ¶
func (m *SpotMarketStreamClient) IsConnected() bool
IsConnected returns the WebSocket connection state
func (*SpotMarketStreamClient) Open ¶
func (m *SpotMarketStreamClient) Open() error
func (*SpotMarketStreamClient) RemoveListener ¶
func (m *SpotMarketStreamClient) RemoveListener(event string, listener Listener) *emission.Emitter
func (*SpotMarketStreamClient) Subscribe ¶
func (m *SpotMarketStreamClient) Subscribe(topics []string) error
func (*SpotMarketStreamClient) UnSubscribe ¶
func (m *SpotMarketStreamClient) UnSubscribe(topics []string) error
Click to show internal directories.
Click to hide internal directories.