Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultConfigFile = "doctrove.yaml"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Settings *Settings `yaml:"settings,omitempty"`
Sites map[string]*SiteConfig `yaml:"sites"`
// contains filtered or unexported fields
}
func Load ¶
Load reads the config from the given root directory. If the file doesn't exist, returns an empty config with default settings.
func (*Config) AddSite ¶
AddSite adds a new site to the config. Returns an error if it already exists.
func (*Config) RemoveSite ¶
RemoveSite removes a site from the config.
func (*Config) SetContentTypes ¶
SetContentTypes updates the content_types filter for a site, allowing agents to widen or narrow the filter after initial scan.
type Settings ¶
type Settings struct {
RateLimit int `yaml:"rate_limit,omitempty"` // requests/sec per host
RateBurst int `yaml:"rate_burst,omitempty"` // burst capacity
Timeout string `yaml:"timeout,omitempty"` // HTTP timeout (e.g. "30s")
MaxProbes int `yaml:"max_probes,omitempty"` // companion probes per llms.txt
UserAgent string `yaml:"user_agent,omitempty"` // User-Agent header
EventsURL string `yaml:"events_url,omitempty"` // URL for postDash (e.g. http://localhost:6060/events)
Context7APIKey string `yaml:"context7_api_key"` // Context7 API key (get one at https://context7.com)
}
func DefaultSettings ¶
func DefaultSettings() *Settings
DefaultSettings returns settings with sane defaults.
func (*Settings) HasContext7Key ¶
HasContext7Key returns true if a valid Context7 API key is configured. Keys must start with the "ctx7sk" prefix to be considered valid.
func (*Settings) TimeoutDuration ¶
TimeoutDuration parses the Timeout string as a time.Duration.
type SiteConfig ¶
type SiteConfig struct {
URL string `yaml:"url"`
Include []string `yaml:"include,omitempty"`
Exclude []string `yaml:"exclude,omitempty"`
ContentTypes string `yaml:"content_types,omitempty"` // persisted from scan (e.g. "llms-txt,llms-full-txt")
UpdateFreq string `yaml:"update_freq,omitempty"`
LastSync time.Time `yaml:"last_sync,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.