Documentation
¶
Index ¶
- func BuildImageURL(q core.Query) (string, error)
- func BuildURL(q core.Query, page int) (string, error)
- type DuckDuckGo
- func (ddg *DuckDuckGo) GetRateLimiter() *rate.Limiter
- func (ddg *DuckDuckGo) Name() string
- func (ddg *DuckDuckGo) Search(ctx context.Context, query core.Query) (results []core.SearchResult, err error)
- func (ddg *DuckDuckGo) SearchImage(ctx context.Context, query core.Query) ([]core.SearchResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildImageURL ¶
BuildImageURL builds a DuckDuckGo image search URL from Query fields. It returns an error when query text or date parameters are invalid.
Types ¶
type DuckDuckGo ¶
type DuckDuckGo struct {
core.Browser
core.SearchEngineOptions
// contains filtered or unexported fields
}
DuckDuckGo implements core.SearchEngine for DuckDuckGo SERP pages.
func New ¶
func New(browser core.Browser, opts core.SearchEngineOptions) *DuckDuckGo
New creates a DuckDuckGo engine instance with browser/runtime options applied.
func (*DuckDuckGo) GetRateLimiter ¶
func (ddg *DuckDuckGo) GetRateLimiter() *rate.Limiter
GetRateLimiter returns a limiter configured from SearchEngineOptions.
func (*DuckDuckGo) Name ¶
func (ddg *DuckDuckGo) Name() string
Name returns the stable engine identifier.
func (*DuckDuckGo) Search ¶
func (ddg *DuckDuckGo) Search(ctx context.Context, query core.Query) (results []core.SearchResult, err error)
Search executes a DuckDuckGo web search and returns normalized search results. It may return core.ErrCaptcha or core.ErrSearchTimeout.
func (*DuckDuckGo) SearchImage ¶
func (ddg *DuckDuckGo) SearchImage(ctx context.Context, query core.Query) ([]core.SearchResult, error)
SearchImage executes a DuckDuckGo image search and returns normalized image results. It may return core.ErrCaptcha or core.ErrSearchTimeout.