Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "openserp", Short: "Open SERP", Long: `Get [Google, Yandex, Baidu] search engine results via API or CLI.`, Version: version, SilenceUsage: true, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { err := initializeConfig(cmd) if err != nil { return err } if err := browserprofile.LoadProfilesFromJSON(config.App.ProfilesJSON); err != nil { return fmt.Errorf("load app.profiles: %w", err) } logFormat, err := core.NormalizeLogFormat(config.App.LogFormat) if err != nil { return err } config.App.LogFormat = logFormat core.InitLogger(config.Server.IsVerbose, config.Server.IsDebug, config.App.LogFormat) logrus.WithField("config", fmt.Sprintf("%+v", config)).Debug("Final config") return nil }, }
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Timeout int `mapstructure:"timeout"`
BrowserPath string `mapstructure:"browser_path"`
ProfilesJSON string `mapstructure:"profiles"`
IsBrowserHead bool `mapstructure:"head"`
IsLeaveHead bool `mapstructure:"leave_head"`
IsLeakless bool `mapstructure:"leakless"`
BlockResources string `mapstructure:"block_resources"`
BlockTrackers bool `mapstructure:"block_trackers"`
DebugEndpoints bool `mapstructure:"debug_endpoints"`
LogFormat string `mapstructure:"log_format"`
}
type CORSConfig ¶ added in v0.6.0
type CacheConfig ¶ added in v0.6.0
type CaptchaConfig ¶ added in v0.7.2
type CaptchaConfig struct {
SolverEnabled bool `mapstructure:"solver_enabled"`
}
type CircuitBreakerConfig ¶ added in v0.6.0
type Config ¶ added in v0.2.1
type Config struct {
Server ServerConfig `mapstructure:"server"`
App AppConfig `mapstructure:"app"`
Proxies core.ProxiesConfig `mapstructure:"proxies"`
Cache CacheConfig `mapstructure:"cache"`
Resilience ResilienceConfig `mapstructure:"resilience"`
CircuitBreaker CircuitBreakerConfig `mapstructure:"circuit_breaker"`
CORS CORSConfig `mapstructure:"cors"`
Captcha CaptchaConfig `mapstructure:"captcha"`
Config2Capcha Config2Captcha `mapstructure:"2captcha"`
GoogleConfig EngineConfig `mapstructure:"google"`
YandexConfig EngineConfig `mapstructure:"yandex"`
BaiduConfig EngineConfig `mapstructure:"baidu"`
BingConfig EngineConfig `mapstructure:"bing"`
DuckDuckGoConfig EngineConfig `mapstructure:"duckduckgo"`
}
type Config2Captcha ¶ added in v0.4.1
type Config2Captcha struct {
ApiKey string `mapstructure:"apikey"`
}
type EngineConfig ¶ added in v0.6.0
type EngineConfig struct {
core.SearchEngineOptions `mapstructure:",squash"`
Proxy string `mapstructure:"proxy"`
}
type ResilienceConfig ¶ added in v0.6.0
type ServerConfig ¶ added in v0.6.0
type ServerConfig struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
ConfigPath string `mapstructure:"config_path"`
IsDebug bool `mapstructure:"debug"`
IsVerbose bool `mapstructure:"verbose"`
IsRawRequests bool `mapstructure:"raw_requests"`
Insecure bool `mapstructure:"insecure"`
}
Click to show internal directories.
Click to hide internal directories.