samsa/internal/engines/factory.go
Franz Kafka 79e01e0de2 feat: add Google engine (experimental, may be blocked)
Google blocks scrapers — results depend on whether Google serves
a static page or a JS challenge. Set LOCAL_PORTED_ENGINES=google
to enable. Without it, Google is proxied to upstream SearXNG.

Closes #1
2026-03-22 01:25:04 +00:00

37 lines
1 KiB
Go

package engines
import (
"net/http"
"os"
"time"
)
// NewDefaultPortedEngines returns the starter set of Go-native engines.
// The service can swap/extend this registry later as more engines are ported.
func NewDefaultPortedEngines(client *http.Client) map[string]Engine {
if client == nil {
client = &http.Client{Timeout: 10 * time.Second}
}
return map[string]Engine{
"wikipedia": &WikipediaEngine{client: client},
"arxiv": &ArxivEngine{client: client},
"crossref": &CrossrefEngine{client: client},
"braveapi": &BraveEngine{
client: client,
apiKey: os.Getenv("BRAVE_API_KEY"),
accessGateToken: os.Getenv("BRAVE_ACCESS_TOKEN"),
resultsPerPage: 20,
},
"qwant": &QwantEngine{
client: client,
category: "web-lite",
resultsPerPage: 10,
},
"duckduckgo": &DuckDuckGoEngine{client: client},
"github": &GitHubEngine{client: client},
"reddit": &RedditEngine{client: client},
"bing": &BingEngine{client: client},
"google": &GoogleEngine{client: client},
}
}