Documentation
¶
Index ¶
- type OmniSearchResult
- type OmniSearchResultList
- type SearchClient
- type SearchConfig
- type SearchOption
- func WithApiKey(apiKey string) SearchOption
- func WithBaseURL(baseURL string) SearchOption
- func WithExtra(name string, val any) SearchOption
- func WithPage(page int) SearchOption
- func WithPageSize(pageSize int) SearchOption
- func WithProxy(proxy string) SearchOption
- func WithSearchType(searchType SearcherType) SearchOption
- func WithTimeout(timeout time.Duration) SearchOption
- type SearcherType
- type YakitOmniSearchKeyConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OmniSearchResult ¶
type OmniSearchResultList ¶
type OmniSearchResultList struct {
Results []*OmniSearchResult
Total int
}
type SearchClient ¶
type SearchClient interface {
Search(query string, config *SearchConfig) ([]*OmniSearchResult, error)
GetType() SearcherType
}
type SearchConfig ¶
type SearchConfig struct {
SearcherType SearcherType
Page int
ApiKey string
PageSize int
Proxy string
BaseURL string
Timeout time.Duration
Extra map[string]interface{}
}
func NewSearchConfig ¶
func NewSearchConfig(options ...SearchOption) *SearchConfig
type SearchOption ¶
type SearchOption func(*SearchConfig)
func WithApiKey ¶
func WithApiKey(apiKey string) SearchOption
func WithBaseURL ¶
func WithBaseURL(baseURL string) SearchOption
func WithExtra ¶
func WithExtra(name string, val any) SearchOption
func WithPage ¶
func WithPage(page int) SearchOption
func WithPageSize ¶
func WithPageSize(pageSize int) SearchOption
func WithProxy ¶
func WithProxy(proxy string) SearchOption
func WithSearchType ¶
func WithSearchType(searchType SearcherType) SearchOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) SearchOption
type SearcherType ¶
type SearcherType string
const ( SearcherTypeBrave SearcherType = "brave" SearcherTypeTavily SearcherType = "tavily" )
func (SearcherType) String ¶
func (s SearcherType) String() string
Click to show internal directories.
Click to hide internal directories.