Versions in this module Expand all Collapse all v0 v0.4.1 Sep 23, 2026 Changes in this version + func IsSubscribeQuotaExceeded(code int) bool type WSOptions + StaleAfter time.Duration + SubscribeRetry time.Duration v0.4.0 Sep 22, 2026 Changes in this version + func ClassifyRest(ret int, msg string) int + func IsTerminalWs(code int) bool + func ValidSymbolType(s SymbolType) bool v0.3.0 Sep 21, 2026 Changes in this version + const Version + func IsWsError(code int) bool + func JoinMarkets(markets ...Market) string + func Ptr[T any](v T) *T + func RestErrorLabel(code int) string + func RestErrorName(code int) string + func WsErrorLabel(code int) string + func WsErrorName(code int) string + type APIError struct + ErrorName string + Msg string + Ret int + TraceID string + func OfHTTPStatus(status int, msg, traceID string) *APIError + func OfRest(ret int, msg, traceID string) *APIError + func OfWS(ret int, msg, traceID string) *APIError + func (e *APIError) Error() string + type AuthError struct + type Basic struct + func (b *Basic) GetAdjustmentFactors(ctx context.Context, symbol, market, beginDay, endDay string) (any, error) + func (b *Basic) GetMarkets(ctx context.Context) (any, error) + func (b *Basic) GetStockDetail(ctx context.Context, typ SymbolType, symbol string) (any, error) + func (b *Basic) GetSymbolInfo(ctx context.Context, typ SymbolType, symbols string) (any, error) + func (b *Basic) GetSymbols(ctx context.Context, typ SymbolType, symbols string) (any, error) + func (b *Basic) GetTradingDays(ctx context.Context, market, beginDay, endDay string) (any, error) + func (b *Basic) GetTradingHours(ctx context.Context) (any, error) + func (b *Basic) GetTradingSchedule(ctx context.Context) (any, error) + func (b *Basic) GetTradingScheduleByType(ctx context.Context, typ string) (any, error) + type Business string + const BusinessCommon + const BusinessCrypto + const BusinessIndia + const BusinessJapan + const BusinessKorea + const BusinessStock + const BusinessTaiwan + func (b Business) String() string + type Client struct + Basic *Basic + Common *MarketData + Crypto *MarketData + Financial *Financial + India *MarketData + Japan *MarketData + Korea *MarketData + Market *MarketClient + Packages *Packages + Plate *Plate + Stock *MarketData + StockInfo *StockInfo + Taiwan *MarketData + func New(opts Options) *Client + func (c *Client) Close() + type Financial struct + func (f *Financial) GetBalanceSheet(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetCashFlow(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetDividend(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetDividendPayout(ctx context.Context, symbol string, typ SymbolType) (any, error) + func (f *Financial) GetEarningStatus(ctx context.Context, symbol string, typ SymbolType) (any, error) + func (f *Financial) GetEarnings(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetIncomeStatement(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetRevenue(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + func (f *Financial) GetStatistics(ctx context.Context, symbol string, typ SymbolType, period PeriodType) (any, error) + type IOError struct + Cause error + Msg string + func (e *IOError) Error() string + func (e *IOError) Unwrap() error + type KlineType int + const KlineDay + const KlineHour1 + const KlineHour2 + const KlineHour4 + const KlineMin1 + const KlineMin15 + const KlineMin30 + const KlineMin5 + const KlineMonth + const KlineQuarter + const KlineWeek + const KlineYear + type Lang string + const LangEN + const LangZHCN + func (l Lang) String() string + type Market string + const MarketCN + const MarketHK + const MarketIN + const MarketJP + const MarketKS + const MarketTW + const MarketUS + func (m Market) String() string + type MarketClient struct + func (m *MarketClient) GetBreadth(ctx context.Context, market, lang string) (any, error) + func (m *MarketClient) GetIndexes(ctx context.Context, lang string) (any, error) + func (m *MarketClient) GetLeaders(ctx context.Context, market string, limit int, lang string) (any, error) + func (m *MarketClient) GetOverview(ctx context.Context, market, lang string) (any, error) + func (m *MarketClient) GetRank(ctx context.Context, market, key string, opts *RankOptions) (any, error) + func (m *MarketClient) GetRankCategories(ctx context.Context, market, lang string) (any, error) + func (m *MarketClient) GetRankConfig(ctx context.Context, market string) (any, error) + func (m *MarketClient) GetTemperature(ctx context.Context, market, lang string) (any, error) + func (m *MarketClient) GetTurnover(ctx context.Context, market, lang string) (any, error) + type MarketData struct + func (m *MarketData) GetDepth(ctx context.Context, codes string) (any, error) + func (m *MarketData) GetKline(ctx context.Context, codes string, klineType KlineType, count int, ...) (any, error) + func (m *MarketData) GetTrade(ctx context.Context, codes string) (any, error) + type NewsLang string + const NewsDE + const NewsEN + const NewsES + const NewsFR + const NewsJA + const NewsKO + const NewsPT + const NewsRU + const NewsTR + const NewsZHHans + const NewsZHHant + func (l NewsLang) String() string + type NewsOptions struct + APIKey string + BaseURL string + HeartbeatInterval time.Duration + Lang string + MaxReconnectAttempts int + PrintFrames bool + ReconnectBackoff time.Duration + type NewsWebSocket struct + OnDisconnect func() + OnError func(error) + OnFrame func(string) + OnNews func(map[string]any) + OnNewsParsed func(map[string]any) + OnReconnect func() + func NewNewsWebSocket(opts NewsOptions) (*NewsWebSocket, error) + func (n *NewsWebSocket) Close() error + func (n *NewsWebSocket) Connect(ctx context.Context) error + func (n *NewsWebSocket) Subscribe(lang string) + func (n *NewsWebSocket) Unsubscribe() + type Options struct + APIKey string + BaseURL string + MaxRetries int + Timeout time.Duration + type Packages struct + func (p *Packages) GetInfo(ctx context.Context) (any, error) + type PeriodType string + const PeriodFH + const PeriodFQ + const PeriodFY + func (p PeriodType) String() string + type Plate struct + func (p *Plate) GetChart(ctx context.Context, market string, limit int) (any, error) + func (p *Plate) GetConcept(ctx context.Context, market string, limit int) (any, error) + func (p *Plate) GetIndustry(ctx context.Context, market string, limit int) (any, error) + func (p *Plate) GetIntro(ctx context.Context, plateSymbol string) (any, error) + func (p *Plate) GetMembers(ctx context.Context, plateSymbol string, offset, limit int) (any, error) + type RankOptions struct + Lang string + Limit int + Offset int + Order string + Sort string + type RankSort string + const RankSortChg + func (s RankSort) String() string + type RateLimitError struct + type RestErrorCode int + const RestBadRequest + const RestKlineExceedsLimit + const RestNoPermission + const RestOrderBookDepthExceedsLimit + const RestParamError + const RestParamLost + const RestProductNotExists + const RestProductsExceedsLimit + const RestRequestExceedLimit + const RestRequestForDayLimit + const RestServerError + const RestSuccess + const RestTimeLimitError + const RestTokenPermissionExpired + const RestWebsocketDisconnected + const RestWebsocketExceedsLimit + const RestWebsocketHeartbeatTimeout + type ScheduleType string + const ScheduleEnergy + const ScheduleForex + const ScheduleFutures + const ScheduleIndices + const ScheduleMetal + func ParseScheduleType(value string) (ScheduleType, bool) + func (s ScheduleType) String() string + type SortOrder string + const SortAsc + const SortDesc + func (s SortOrder) String() string + type StockInfo struct + func (s *StockInfo) GetCompany(ctx context.Context, symbol, lang string) (any, error) + func (s *StockInfo) GetConcepts(ctx context.Context, symbol, lang string) (any, error) + func (s *StockInfo) GetDrivers(ctx context.Context, symbol, lang string) (any, error) + func (s *StockInfo) GetEvents(ctx context.Context, symbol string, limit int, lang string) (any, error) + func (s *StockInfo) GetPanorama(ctx context.Context, symbol, lang string) (any, error) + func (s *StockInfo) GetRatings(ctx context.Context, symbol, lang string) (any, error) + func (s *StockInfo) GetValuation(ctx context.Context, symbol, lang string) (any, error) + type SymbolType string + const SymbolCrypto + const SymbolEnergy + const SymbolForex + const SymbolFutures + const SymbolIndices + const SymbolMetal + const SymbolStockCN + const SymbolStockHK + const SymbolStockIN + const SymbolStockJP + const SymbolStockKS + const SymbolStockTW + const SymbolStockUS + func (s SymbolType) String() string + type TimeoutError struct + Msg string + func (e *TimeoutError) Error() string + type WSOptions struct + APIKey string + BaseURL string + Business Business + HeartbeatInterval time.Duration + MaxReconnectAttempts int + PrintFrames bool + ReconnectBackoff time.Duration + type WebSocket struct + OnDepth func(map[string]any) + OnDisconnect func() + OnError func(error) + OnFrame func(string) + OnKline func(map[string]any) + OnReconnect func() + OnTrade func(map[string]any) + func NewWebSocket(opts WSOptions) (*WebSocket, error) + func (w *WebSocket) Close() error + func (w *WebSocket) Connect(ctx context.Context) error + func (w *WebSocket) SubscribeDepth(codes string) + func (w *WebSocket) SubscribeKline(codes string, klineType KlineType) + func (w *WebSocket) SubscribeTrade(codes string, includeTy bool) + func (w *WebSocket) UnsubscribeDepth(codes string) + func (w *WebSocket) UnsubscribeKline(codes string, klineType KlineType) + func (w *WebSocket) UnsubscribeTrade(codes string) + type WsCode int + const WsConnectOK + const WsHeartApply + const WsHeartbeat + const WsPushDepth + const WsPushKline + const WsPushNews + const WsPushTrade + const WsSubDepth + const WsSubDepthAck + const WsSubKline + const WsSubKlineAck + const WsSubNews + const WsSubNewsAck + const WsSubTrade + const WsSubTradeAck + const WsUnsubAck + const WsUnsubDepth + const WsUnsubKline + const WsUnsubNews + const WsUnsubTrade + type WsErrorCode int + const WsErrAPIKeyBlacklist + const WsErrAPIKeyEmpty + const WsErrAPIKeyExpired + const WsErrAPIKeyInvalid + const WsErrAllProductsQuantityExceed + const WsErrHandshakeAPIKeyMissing + const WsErrHandshakeAPIKeyNotExist + const WsErrHandshakeMaxConnections + const WsErrHandshakeNoPermission + const WsErrKlineQuantityExceed + const WsErrOrderBookDepthExceed + const WsErrParamError + const WsErrParamLost + const WsErrParamNotJSON + const WsErrProductCodeOrAlreadyConnected + const WsErrProductsQuantityExceed + const WsErrRequestFrequencyDayExceed + const WsErrRequestFrequencyMinExceed + const WsErrServerError + const WsErrWSConnExceed + const WsErrWSHeartTimeout + const WsErrWSURLWrong