ostype

package
v1.4.3-alpha0826 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OmniSearchResult

type OmniSearchResult struct {
	Title      string `json:"title"`
	URL        string `json:"url"`
	Age        string `json:"age,omitempty"`
	FaviconURL string `json:"favicon_url,omitempty"`
	Content    string `json:"content,omitempty"`
	Source     string `json:"source,omitempty"`
	Data       any    `json:"data,omitempty"`
}

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

type YakitOmniSearchKeyConfig

type YakitOmniSearchKeyConfig struct {
	APIKey string `app:"name:api_key,verbose:API Key,required:true"`
	Proxy  string `app:"name:proxy,verbose:Proxy,required:false"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL