Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterArticlesByWordDenylist ¶ added in v0.3.0
FilterArticlesByWordDenylist filters out articles that contain any of the denylisted words in their title, content, or summary. The comparison is case-insensitive. Returns a new slice containing only the articles that don't match any denylisted words.
Types ¶
type Source ¶
type Source interface {
// Name returns a unique identifier for this source
Name() string
// Fetch retrieves articles from the source
Fetch(ctx context.Context, fetcher fetcher.Fetcher) ([]*models.Article, error)
// Configure sets up the source with configuration parameters
Configure(config map[string]any) error
}
Source defines the interface that all content sources must implement.
type SourceConfig ¶
type SourceConfig struct {
// Type identifies the source implementation to use
Type string `toml:"type"`
// Enabled determines if this source should be processed
Enabled bool `toml:"enabled"`
// MaxArticles limits the number of articles to include from this source
MaxArticles int `toml:"max_articles"`
// WordDenylist contains words that will cause articles to be filtered out
WordDenylist []string `toml:"word_denylist"`
// FetcherConfig contains configuration for the fetcher
FetcherConfig *fetcher.FetcherConfig `toml:"fetcher_config"`
// ProcessorConfig contains configuration for the processor
ProcessorConfig *processor.ProcessorConfig `toml:"processor_config"`
// Options contains source-specific configuration
Options map[string]any `toml:"options"`
}
SourceConfig contains configuration for a single source.
Click to show internal directories.
Click to hide internal directories.