Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SearchClient ¶
type SearchClient struct {
// SearXNG base URL (should have a trailing /)
BaseURL string
UserAgent string
}
SearXNG client construct this struct manually.
func (*SearchClient) Search ¶
func (s *SearchClient) Search(ctx context.Context, request SearchRequest) (*SearchResponse, error)
func (*SearchClient) SearchPixivNovel ¶
func (s *SearchClient) SearchPixivNovel(ctx context.Context, title string, pageno int) (*SearchResponse, error)
type SearchRequest ¶
type SearchResponse ¶
type SearchResponse struct {
Query string `json:"query"`
NumberOfResults int `json:"number_of_results"`
Results []SearchResult `json:"results"`
Answers []any `json:"answers"`
Corrections []any `json:"corrections"`
Infoboxes []any `json:"infoboxes"`
Suggestions []any `json:"suggestions"`
UnresponsiveEngines []any `json:"unresponsive_engines"`
}
type SearchResult ¶
type SearchResult struct {
URL string `json:"url"`
Title string `json:"title"`
Content string `json:"content"`
Engine string `json:"engine"`
ParsedURL []string `json:"parsed_url"`
Template string `json:"template"`
Engines []string `json:"engines"`
Positions []int `json:"positions"`
Score float64 `json:"score"`
Category string `json:"category"`
PublishDate string `json:"publishedDate,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.