Versions in this module Expand all Collapse all v1 v1.0.1 Aug 10, 2026 v1.0.0 Aug 9, 2026 Changes in this version + var ErrBlocked = errors.New("finlight: connection rejected by server (blocked)") + type APIError struct + Body []byte + Status string + StatusCode int + func (e *APIError) Error() string + type Article struct + Categories []string + Companies []Company + Confidence *FlexFloat + Content string + Countries []string + CreatedAt *FlexTime + Images []string + IsUpdate *bool + Language string + Link string + PublishDate FlexTime + RevisedDate *FlexTime + Sentiment string + Source string + Summary string + Title string + func ConstructWebhookEvent(rawBody []byte, signature, endpointSecret, timestamp string) (*Article, error) + type ArticleResponse struct + Articles []Article + Page int + PageSize int + Status string + type ArticleService struct + func (s *ArticleService) FetchArticleByLink(ctx context.Context, params GetArticleByLinkParams) (*Article, error) + func (s *ArticleService) FetchArticles(ctx context.Context, params GetArticlesParams) (*ArticleResponse, error) + type Category string + const CategoryBusiness + const CategoryClimate + const CategoryCommodities + const CategoryCrypto + const CategoryEconomy + const CategoryEnergy + const CategoryGeopolitics + const CategoryHealth + const CategoryMarkets + const CategoryPolitics + const CategoryRegulation + const CategorySecurity + const CategoryTechnology + type Client struct + Articles *ArticleService + RawWebsocket *RawWebSocketClient + Sources *SourceService + Websocket *WebSocketClient + func New(cfg Config) (*Client, error) + type Company struct + CompanyID int + Confidence *FlexFloat + Country string + Exchange string + ISIN string + ISINs []string + Industry string + Name string + OpenFIGI string + OtherListings []Listing + PrimaryListing *Listing + Sector string + Ticker string + type Config struct + APIKey string + BaseURL string + HTTPClient *http.Client + Logger *slog.Logger + RetryCount int + Timeout time.Duration + WssURL string + type FlexFloat float64 + func (f *FlexFloat) UnmarshalJSON(data []byte) error + func (f FlexFloat) Float64() float64 + func (f FlexFloat) MarshalJSON() ([]byte, error) + type FlexTime struct + func (t *FlexTime) UnmarshalJSON(data []byte) error + func (t FlexTime) MarshalJSON() ([]byte, error) + type GetArticleByLinkParams struct + IncludeContent bool + IncludeEntities bool + Link string + type GetArticlesParams struct + Categories []Category + Countries []string + ExcludeEmptyContent bool + ExcludeSources []string + From string + IncludeContent bool + IncludeEntities bool + Language string + OptInSources []string + Order SortOrder + OrderBy OrderBy + Page int + PageSize int + Query string + Source string + Sources []string + Tickers []string + To string + type GetArticlesWebSocketParams struct + Categories []Category + Countries []string + ExcludeEmptyContent bool + ExcludeSources []string + Extended bool + IncludeContent bool + IncludeEntities bool + IncludeUpdates bool + Language string + OptInSources []string + Query string + Sources []string + Tickers []string + type GetRawArticlesWebSocketParams struct + ExcludeSources []string + IncludeUpdates bool + Language string + OptInSources []string + Query string + Sources []string + type Listing struct + ExchangeCode string + ExchangeCountry string + Ticker string + type OrderBy string + const OrderByCreatedAt + const OrderByPublishDate + const OrderByRevisedDate + type RawArticle struct + Categories []string + CreatedAt *FlexTime + Images []string + IsUpdate *bool + Language string + Link string + PublishDate FlexTime + RevisedDate *FlexTime + Source string + Summary string + Title string + type RawWebSocketClient struct + func NewRawWebSocketClient(cfg Config, opts WebSocketOptions) *RawWebSocketClient + func (w *RawWebSocketClient) Err() error + func (w *RawWebSocketClient) Stream(ctx context.Context, params GetRawArticlesWebSocketParams) iter.Seq[RawArticle] + type SortOrder string + const SortOrderAsc + const SortOrderDesc + type Source struct + Domain string + IsContentAvailable bool + IsDefaultSource bool + type SourceService struct + func (s *SourceService) GetSources(ctx context.Context) ([]Source, error) + type WebSocketClient struct + func NewWebSocketClient(cfg Config, opts WebSocketOptions) *WebSocketClient + func (w *WebSocketClient) Err() error + func (w *WebSocketClient) Stream(ctx context.Context, params GetArticlesWebSocketParams) iter.Seq[Article] + type WebSocketOptions struct + BaseReconnectDelay time.Duration + ConnectionLifetime time.Duration + MaxReconnectDelay time.Duration + OnClose func(code int, reason string) + PingInterval time.Duration + PongTimeout time.Duration + Takeover bool + type WebhookVerificationError struct + func (e *WebhookVerificationError) Error() string