config

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserConfig

type BrowserConfig struct {
	Default string               `toml:"default"`
	Paths   map[string]string    `toml:"paths"`
	Cookies BrowserCookiesConfig `toml:"cookies"`
}

type BrowserCookiesConfig

type BrowserCookiesConfig struct {
	Domains []string `toml:"domains"`
	Exclude []string `toml:"exclude"`
}

type Config

type Config struct {
	Schema     string           `toml:"$schema,omitempty" mapstructure:"$schema"`
	Browser    BrowserConfig    `toml:"browser" mapstructure:"browser"`
	Extraction ExtractionConfig `toml:"extraction" mapstructure:"extraction"`
	Output     OutputConfig     `toml:"output" mapstructure:"output"`
	Network    NetworkConfig    `toml:"network" mapstructure:"network"`
	Parallel   ParallelConfig   `toml:"parallel" mapstructure:"parallel"`
	Pipe       PipeConfig       `toml:"pipe" mapstructure:"pipe"`
	Logging    LoggingConfig    `toml:"logging" mapstructure:"logging"`
}

func Default

func Default() *Config

func Load

func Load(configFile string) (*Config, error)

func (*Config) CreateExampleConfig

func (c *Config) CreateExampleConfig(configPath string) error

type ExtractionConfig

type ExtractionConfig struct {
	SkipCookieBanners bool   `toml:"skip_cookie_banners"`
	BannerTimeout     int    `toml:"banner_timeout"`
	EnableJavaScript  string `toml:"enable_javascript"`
	JSTimeout         int    `toml:"js_timeout"`
	WaitForSelector   string `toml:"wait_for_selector"`
	MinContentLength  int    `toml:"min_content_length"`
	RemoveAds         bool   `toml:"remove_ads"`
	CleanHTML         bool   `toml:"clean_html"`
	Backend           string `toml:"backend"` // readability (default), tavily, jina

	// Tavily extraction settings
	Tavily TavilyExtractionConfig `toml:"tavily"`

	// Jina extraction settings
	Jina JinaExtractionConfig `toml:"jina"`
}

type JinaExtractionConfig

type JinaExtractionConfig struct {
	APIKey string `toml:"api_key"` // optional, for higher rate limits
}

JinaExtractionConfig holds Jina Reader API settings

type LoggingConfig

type LoggingConfig struct {
	Level string `toml:"level"`
	File  string `toml:"file"`
}

type NetworkConfig

type NetworkConfig struct {
	Timeout         int    `toml:"timeout"`
	UserAgent       string `toml:"user_agent"`
	BrowserAgent    string `toml:"browser_agent"`
	FollowRedirects bool   `toml:"follow_redirects"`
	MaxRedirects    int    `toml:"max_redirects"`
	Delay           int    `toml:"delay"`
}

type OutputConfig

type OutputConfig struct {
	DefaultFormat   string   `toml:"default_format"`
	IncludeMetadata bool     `toml:"include_metadata"`
	MetadataFields  []string `toml:"metadata_fields"`
	LineWidth       int      `toml:"line_width"`
	PreserveLinks   bool     `toml:"preserve_links"`
}

type ParallelConfig

type ParallelConfig struct {
	MaxConcurrency  int  `toml:"max_concurrency"`
	BatchSize       int  `toml:"batch_size"`
	ShowProgress    bool `toml:"show_progress"`
	FailFast        bool `toml:"fail_fast"`
	MaxMemoryMB     int  `toml:"max_memory_mb"`
	CleanupInterval int  `toml:"cleanup_interval"`
}

type PipeConfig

type PipeConfig struct {
	BufferSize      int    `toml:"buffer_size"`
	OutputSeparator string `toml:"output_separator"`
	NullSeparator   bool   `toml:"null_separator"`
	StreamMode      bool   `toml:"stream_mode"`
}

type TavilyExtractionConfig

type TavilyExtractionConfig struct {
	APIKey       string `toml:"api_key"`
	ExtractDepth string `toml:"extract_depth"` // basic or advanced
}

TavilyExtractionConfig holds Tavily Extract API settings

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL