Documentation
¶
Index ¶
- type App
- type Config
- type Dependencies
- type Factory
- type FeedStorage
- type LLM
- type Manager
- type NotifyChannelEmail
- type NotifyChannels
- type NotifyReceiver
- type NotifyRoute
- type NotifySubRoute
- type RewriteRule
- type RewriteRuleTransform
- type RewriteRuleTransformToText
- type SchedulsRule
- type Scrape
- type ScrapeSource
- type ScrapeSourceRSS
- type Storage
- type Watcher
- type WatcherFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Timezone string `` /* 136-byte string literal not displayed */
Log struct {
Level string `yaml:"level,omitempty" json:"level,omitempty" desc:"Log level, one of debug, info, warn, error. Default: info"`
} `yaml:"log,omitempty" json:"log,omitempty" desc:"The log config."`
API struct {
HTTP struct {
Address string `` /* 182-byte string literal not displayed */
} `yaml:"http,omitempty" json:"http,omitempty" desc:"The HTTP API config."`
MCP struct {
Address string `` /* 181-byte string literal not displayed */
} `yaml:"mcp,omitempty" json:"mcp,omitempty" desc:"The MCP API config."`
LLM string `` /* 158-byte string literal not displayed */
} `yaml:"api,omitempty" json:"api,omitempty" desc:"The API config."`
LLMs []LLM `` /* 145-byte string literal not displayed */
Scrape Scrape `yaml:"scrape,omitempty" json:"scrape,omitempty" desc:"The scrape config."`
Storage Storage `yaml:"storage,omitempty" json:"storage,omitempty" desc:"The storage config."`
Scheduls struct {
Rules []SchedulsRule `` /* 214-byte string literal not displayed */
} `yaml:"scheduls,omitempty" json:"scheduls,omitempty" desc:"The scheduls config for monitoring feeds. Aka monitoring rules."`
Notify struct {
Route NotifyRoute `yaml:"route,omitempty" json:"route,omitempty" desc:"The notify route config. It is required."`
Receivers []NotifyReceiver `` /* 138-byte string literal not displayed */
Channels NotifyChannels `yaml:"channels,omitempty" json:"channels,omitempty" desc:"The notify channels config. e.g. email"`
} `` /* 228-byte string literal not displayed */
}
type Dependencies ¶
type Dependencies struct{}
type Factory ¶
type Factory component.Factory[Manager, Config, Dependencies]
--- Factory code block ---
func NewFactory ¶
func NewFactory(mockOn ...component.MockOption) Factory
type FeedStorage ¶
type FeedStorage struct {
Rewrites []RewriteRule `` /* 293-byte string literal not displayed */
FlushInterval time.Duration `` /* 276-byte string literal not displayed */
EmbeddingLLM string `` /* 455-byte string literal not displayed */
Retention time.Duration `yaml:"retention,omitempty" json:"retention,omitempty" desc:"How long to keep a feed. Default: 8d"`
BlockDuration time.Duration `` /* 173-byte string literal not displayed */
}
type LLM ¶
type LLM struct {
Name string `` /* 155-byte string literal not displayed */
Default bool `` /* 126-byte string literal not displayed */
Provider string `` /* 159-byte string literal not displayed */
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty" desc:"The custom endpoint of the LLM. e.g. https://api.openai.com/v1"`
APIKey string `yaml:"api_key,omitempty" json:"api_key,omitempty" desc:"The API key of the LLM. It is required when api.llm is set."`
Model string `` /* 164-byte string literal not displayed */
EmbeddingModel string `` /* 277-byte string literal not displayed */
Temperature float32 `yaml:"temperature,omitempty" json:"temperature,omitempty" desc:"The temperature (0-2) of the LLM. Default: 0.0"`
}
type Manager ¶
type Manager interface {
component.Component
AppConfig() *App
SaveAppConfig(app *App) error
Subscribe(w Watcher)
}
--- Interface code block ---
type NotifyChannelEmail ¶
type NotifyChannelEmail struct {
SmtpEndpoint string `` /* 132-byte string literal not displayed */
From string `yaml:"from,omitempty" json:"from,omitempty" desc:"The sender email of the email channel."`
Password string `` /* 164-byte string literal not displayed */
FeedMarkdownTemplate string `` /* 148-byte string literal not displayed */
FeedHTMLSnippetTemplate string `` /* 193-byte string literal not displayed */
}
type NotifyChannels ¶
type NotifyChannels struct {
Email *NotifyChannelEmail `yaml:"email,omitempty" json:"email,omitempty" desc:"The global email channel config."`
}
type NotifyReceiver ¶
type NotifyRoute ¶
type NotifyRoute struct {
Receivers []string `` /* 131-byte string literal not displayed */
GroupBy []string `` /* 189-byte string literal not displayed */
CompressByRelatedThreshold *float32 `` /* 235-byte string literal not displayed */
SubRoutes []NotifySubRoute `` /* 202-byte string literal not displayed */
}
type NotifySubRoute ¶
type NotifySubRoute struct {
Matchers []string `` /* 232-byte string literal not displayed */
Receivers []string `` /* 131-byte string literal not displayed */
GroupBy []string `` /* 189-byte string literal not displayed */
CompressByRelatedThreshold *float32 `` /* 235-byte string literal not displayed */
SubRoutes []NotifySubRoute `` /* 202-byte string literal not displayed */
}
type RewriteRule ¶
type RewriteRule struct {
SourceLabel string `` /* 400-byte string literal not displayed */
SkipTooShortThreshold *int `` /* 199-byte string literal not displayed */
Transform *RewriteRuleTransform `` /* 197-byte string literal not displayed */
Match string `` /* 214-byte string literal not displayed */
MatchRE string `` /* 139-byte string literal not displayed */
Action string `` /* 184-byte string literal not displayed */
Label string `` /* 207-byte string literal not displayed */
}
type RewriteRuleTransform ¶
type RewriteRuleTransform struct {
ToText *RewriteRuleTransformToText `yaml:"to_text,omitempty" json:"to_text,omitempty" desc:"The transform config to transform the source text to text."`
}
type SchedulsRule ¶
type SchedulsRule struct {
Name string `yaml:"name,omitempty" json:"name,omitempty" desc:"The name of the rule. It is required."`
Query string `yaml:"query,omitempty" json:"query,omitempty" desc:"The semantic query to get the feeds. NOTE it is optional"`
Threshold float32 `` /* 192-byte string literal not displayed */
LabelFilters []string `` /* 164-byte string literal not displayed */
EveryDay string `` /* 192-byte string literal not displayed */
WatchInterval time.Duration `` /* 179-byte string literal not displayed */
}
type Scrape ¶
type Scrape struct {
Past time.Duration `` /* 159-byte string literal not displayed */
Interval time.Duration `` /* 137-byte string literal not displayed */
RSSHubEndpoint string `` /* 288-byte string literal not displayed */
Sources []ScrapeSource `yaml:"sources,omitempty" json:"sources,omitempty" desc:"The sources for scraping feeds."`
}
type ScrapeSource ¶
type ScrapeSource struct {
Interval time.Duration `yaml:"interval,omitempty" json:"interval,omitempty" desc:"How often to scrape this source. Default: global interval"`
Name string `yaml:"name,omitempty" json:"name,omitempty" desc:"The name of the source. It is required."`
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty" desc:"The additional labels to add to the feed of this source."`
RSS *ScrapeSourceRSS `yaml:"rss,omitempty" json:"rss,omitempty" desc:"The RSS config of the source."`
}
type ScrapeSourceRSS ¶
type Storage ¶
type Storage struct {
Dir string `` /* 153-byte string literal not displayed */
Feed FeedStorage `yaml:"feed,omitempty" json:"feed,omitempty" desc:"The feed storage config."`
}
type WatcherFunc ¶
func (WatcherFunc) Name ¶
func (f WatcherFunc) Name() string
func (WatcherFunc) Reload ¶
func (f WatcherFunc) Reload(app *App) error
Click to show internal directories.
Click to hide internal directories.