Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) GetCurrentEngine() omniserp.Engine
- func (c *Client) GetEngine(name string) (omniserp.Engine, error)
- func (c *Client) GetName() string
- func (c *Client) GetRegistry() *omniserp.Registry
- func (c *Client) GetSupportedTools() []string
- func (c *Client) GetVersion() string
- func (c *Client) ListEngines() []string
- func (c *Client) ScrapeWebpage(ctx context.Context, params omniserp.ScrapeParams) (*omniserp.SearchResult, error)
- func (c *Client) Search(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchAutocomplete(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchImages(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchImagesNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
- func (c *Client) SearchLens(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchMaps(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchNews(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchNewsNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
- func (c *Client) SearchNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
- func (c *Client) SearchPlaces(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchReviews(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchScholar(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchShopping(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SearchVideos(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
- func (c *Client) SetEngine(name string) error
- func (c *Client) SupportsOperation(operation string) bool
- type Options
Constants ¶
const ( OpSearch = "google_search" OpSearchNews = "google_search_news" OpSearchImages = "google_search_images" OpSearchVideos = "google_search_videos" OpSearchPlaces = "google_search_places" OpSearchMaps = "google_search_maps" OpSearchReviews = "google_search_reviews" OpSearchShopping = "google_search_shopping" OpSearchScholar = "google_search_scholar" OpSearchLens = "google_search_lens" OpSearchAutocomplete = "google_search_autocomplete" OpScrapeWebpage = "webpage_scrape" )
Operation names that map to Engine interface methods
Variables ¶
var ErrOperationNotSupported = errors.New("operation not supported by current engine")
ErrOperationNotSupported is returned when an operation is not supported by the current engine
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a unified SDK that fronts multiple search engine backends
func New ¶
New creates a new client with all available engines auto-registered It automatically selects an engine based on the SEARCH_ENGINE environment variable
func NewWithEngine ¶
NewWithEngine creates a new client with a specific engine name selected
func NewWithOptions ¶
NewWithOptions creates a new client with custom options
func NewWithRegistry ¶
NewWithRegistry creates a new client with a pre-configured registry and engine name
func (*Client) GetCurrentEngine ¶
GetCurrentEngine returns the currently selected engine
func (*Client) GetRegistry ¶
GetRegistry returns the underlying engine registry
func (*Client) GetSupportedTools ¶
GetSupportedTools returns a list of tool names supported by the current engine
func (*Client) GetVersion ¶
GetVersion returns the version of the current engine implementation
func (*Client) ListEngines ¶
ListEngines returns all registered engine names
func (*Client) ScrapeWebpage ¶
func (c *Client) ScrapeWebpage(ctx context.Context, params omniserp.ScrapeParams) (*omniserp.SearchResult, error)
ScrapeWebpage scrapes content from a webpage
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
Search performs a general web search
func (*Client) SearchAutocomplete ¶
func (c *Client) SearchAutocomplete(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchAutocomplete gets search suggestions
func (*Client) SearchImages ¶
func (c *Client) SearchImages(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchImages performs an image search
func (*Client) SearchImagesNormalized ¶
func (c *Client) SearchImagesNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
SearchImagesNormalized performs an image search and returns a normalized response
func (*Client) SearchLens ¶
func (c *Client) SearchLens(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchLens performs a visual search (if supported)
func (*Client) SearchMaps ¶
func (c *Client) SearchMaps(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchMaps performs a maps search
func (*Client) SearchNews ¶
func (c *Client) SearchNews(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchNews performs a news search
func (*Client) SearchNewsNormalized ¶
func (c *Client) SearchNewsNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
SearchNewsNormalized performs a news search and returns a normalized response
func (*Client) SearchNormalized ¶
func (c *Client) SearchNormalized(ctx context.Context, params omniserp.SearchParams) (*omniserp.NormalizedSearchResult, error)
SearchNormalized performs a web search and returns a normalized response
func (*Client) SearchPlaces ¶
func (c *Client) SearchPlaces(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchPlaces performs a places search
func (*Client) SearchReviews ¶
func (c *Client) SearchReviews(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchReviews performs a reviews search
func (*Client) SearchScholar ¶
func (c *Client) SearchScholar(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchScholar performs a scholar search
func (*Client) SearchShopping ¶
func (c *Client) SearchShopping(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchShopping performs a shopping search
func (*Client) SearchVideos ¶
func (c *Client) SearchVideos(ctx context.Context, params omniserp.SearchParams) (*omniserp.SearchResult, error)
SearchVideos performs a video search
func (*Client) SupportsOperation ¶
SupportsOperation checks if the current engine supports a specific operation