Documentation
¶
Index ¶
Constants ¶
View Source
const (
BaseURL = "wss://api.binance.com/sapi/wss"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Subscribe ¶
func (c *Client) Subscribe(topic string, handler func(WsNewsEvent)) error
func (*Client) Unsubscribe ¶
type WsNewsEvent ¶
type WsNewsEvent struct {
CatalogId int64 `json:"catalogId"`
CatalogName string `json:"catalogName"`
PublishDate int64 `json:"publishDate"`
Title string `json:"title"`
Body string `json:"body"`
Disclaimer string `json:"disclaimer"`
}
WsNewsEvent represents a news event from the WebSocket
type WsResponse ¶
type WsResponse struct {
Type string `json:"type"`
Topic string `json:"topic"`
Data string `json:"data"` // Data is a JSON string containing WsNewsEvent
}
WsResponse represents a generic response from the WebSocket
Click to show internal directories.
Click to hide internal directories.