Documentation
¶
Index ¶
- type App
- type Config
- type Dependencies
- type Factory
- type FeedStorage
- type LLM
- type Manager
- type NotifyChannelEmail
- type NotifyChannels
- type NotifyReceiver
- type NotifyReceiverWebhook
- type NotifyRoute
- type NotifySubRoute
- type ObjectStorage
- type RewriteRule
- type RewriteRuleTransform
- type RewriteRuleTransformToPodcast
- type RewriteRuleTransformToPodcastSpeaker
- 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 */
Telemetry struct {
Address string `` /* 190-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."`
} `yaml:"telemetry,omitempty" json:"telemetry,omitempty" desc:"The telemetry 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."`
RSS struct {
Address string `` /* 181-byte string literal not displayed */
ContentHTMLTemplate string `` /* 178-byte string literal not displayed */
} `yaml:"rss,omitempty" json:"rss,omitempty" desc:"The RSS 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 */
Jina struct {
Token string `yaml:"token,omitempty" json:"token,omitempty" desc:"The token of the Jina server."`
} `yaml:"jina,omitempty" json:"jina,omitempty" desc:"The Jina config."`
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 timeutil.Duration `` /* 276-byte string literal not displayed */
EmbeddingLLM string `` /* 455-byte string literal not displayed */
Retention timeutil.Duration `yaml:"retention,omitempty" json:"retention,omitempty" desc:"How long to keep a feed. Default: 8d"`
BlockDuration timeutil.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 */
TTSModel string `yaml:"tts_model,omitempty" json:"tts_model,omitempty" desc:"The TTS model of the LLM."`
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 NotifyReceiver struct {
Name string `yaml:"name,omitempty" json:"name,omitempty" desc:"The name of the receiver. It is required."`
Email string `yaml:"email,omitempty" json:"email,omitempty" desc:"The email of the receiver."`
Webhook *NotifyReceiverWebhook `yaml:"webhook" json:"webhook" desc:"The webhook of the receiver."`
}
type NotifyReceiverWebhook ¶ added in v0.3.0
type NotifyReceiverWebhook struct {
URL string `yaml:"url"`
}
type NotifyRoute ¶
type NotifyRoute struct {
Receivers []string `` /* 131-byte string literal not displayed */
GroupBy []string `` /* 189-byte string literal not displayed */
SourceLabel string `` /* 238-byte string literal not displayed */
SummaryPrompt string `yaml:"summary_prompt,omitempty" json:"summary_prompt,omitempty" desc:"The prompt to summarize the feeds of each group."`
LLM string `` /* 156-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 */
SourceLabel string `` /* 238-byte string literal not displayed */
SummaryPrompt string `yaml:"summary_prompt,omitempty" json:"summary_prompt,omitempty" desc:"The prompt to summarize the feeds of each group."`
LLM string `` /* 156-byte string literal not displayed */
CompressByRelatedThreshold *float32 `` /* 235-byte string literal not displayed */
SubRoutes []NotifySubRoute `` /* 202-byte string literal not displayed */
}
type ObjectStorage ¶ added in v0.5.0
type ObjectStorage struct {
Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty" desc:"The endpoint of the object storage."`
AccessKeyID string `yaml:"access_key_id,omitempty" json:"access_key_id,omitempty" desc:"The access key id of the object storage."`
SecretAccessKey string `yaml:"secret_access_key,omitempty" json:"secret_access_key,omitempty" desc:"The secret access key of the object storage."`
Bucket string `yaml:"bucket,omitempty" json:"bucket,omitempty" desc:"The bucket of the object storage."`
BucketURL string `yaml:"bucket_url,omitempty" json:"bucket_url,omitempty" desc:"The public URL of the object storage bucket."`
}
type RewriteRule ¶
type RewriteRule struct {
If []string `` /* 179-byte string literal not displayed */
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."`
ToPodcast *RewriteRuleTransformToPodcast `yaml:"to_podcast,omitempty" json:"to_podcast,omitempty" desc:"The transform config to transform the source text to podcast."`
}
type RewriteRuleTransformToPodcast ¶ added in v0.5.0
type RewriteRuleTransformToPodcast struct {
LLM string `yaml:"llm,omitempty" json:"llm,omitempty" desc:"The LLM name to use. Default is the default LLM in llms section."`
EstimateMaximumDuration timeutil.Duration `` /* 218-byte string literal not displayed */
TranscriptAdditionalPrompt string `` /* 162-byte string literal not displayed */
TTSLLM string `` /* 155-byte string literal not displayed */
Speakers []RewriteRuleTransformToPodcastSpeaker `` /* 127-byte string literal not displayed */
}
type RewriteRuleTransformToPodcastSpeaker ¶ added in v0.5.0
type RewriteRuleTransformToPodcastSpeaker struct {
Name string `yaml:"name,omitempty" json:"name,omitempty" desc:"The name of the speaker. It is required."`
Role string `` /* 131-byte string literal not displayed */
Voice string `yaml:"voice,omitempty" json:"voice,omitempty" desc:"The voice of the speaker. It is required."`
}
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 */
Labels map[string]string `yaml:"labels,omitempty" json:"labels,omitempty" desc:"The labels to attach to the feeds."`
EveryDay string `` /* 192-byte string literal not displayed */
WatchInterval timeutil.Duration `` /* 179-byte string literal not displayed */
}
type Scrape ¶
type Scrape struct {
Past timeutil.Duration `` /* 159-byte string literal not displayed */
Interval timeutil.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 timeutil.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."`
Object ObjectStorage `yaml:"object,omitempty" json:"object,omitempty" desc:"The object 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.