news

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// Binance CMS API WebSocket endpoint (requires authentication)
	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 NewClient

func NewClient(apiKey, secretKey string) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, handler func(WsNewsEvent)) error

Subscribe is a no-op for CMS API since subscription happens at connection time

func (*Client) Unsubscribe

func (c *Client) Unsubscribe(topic string) error

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 WsRequest

type WsRequest struct {
	Command string `json:"command"`
	Value   string `json:"value"`
}

WsRequest represents a request to 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

Jump to

Keyboard shortcuts

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