Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultWSURL is the CoinGecko WebSocket streaming endpoint. DefaultWSURL = "wss://stream.coingecko.com/v1" // ChannelID is the ActionCable channel identifier for price streaming. ChannelID = `{"channel":"CGSimplePrice"}` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages a WebSocket connection to CoinGecko's streaming API.
type CoinUpdate ¶
type CoinUpdate struct {
CoinID string `json:"coin_id"`
Price float64 `json:"price"`
Change24h float64 `json:"change_24h_pct"`
MarketCap float64 `json:"market_cap"`
Volume24h float64 `json:"volume_24h"`
UpdatedAt int64 `json:"updated_at"`
}
CoinUpdate represents a parsed price update from the WebSocket stream.
Click to show internal directories.
Click to hide internal directories.