feat: add YouTube engine with config file and env support
YouTube Data API v3 engine: - Add YouTubeConfig to EnginesConfig with api_key field - Add YOUTUBE_API_KEY env override - Thread *config.Config through search service to factory - Factory falls back to env vars if config fields are empty - Update config.example.toml with youtube section Also update default local_ported to include google and youtube.
This commit is contained in:
parent
38122385bd
commit
41b80a939a
5 changed files with 47 additions and 12 deletions
|
|
@ -53,9 +53,10 @@ func main() {
|
|||
}
|
||||
|
||||
svc := search.NewService(search.ServiceConfig{
|
||||
UpstreamURL: cfg.Upstream.URL,
|
||||
HTTPTimeout: cfg.HTTPTimeout(),
|
||||
Cache: searchCache,
|
||||
UpstreamURL: cfg.Upstream.URL,
|
||||
HTTPTimeout: cfg.HTTPTimeout(),
|
||||
Cache: searchCache,
|
||||
EnginesConfig: cfg,
|
||||
})
|
||||
|
||||
acSvc := autocomplete.NewService(cfg.Upstream.URL, cfg.HTTPTimeout())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue