search-cli/internal/adapters/types.go

43 lines
881 B
Go
Raw Permalink Normal View History

2024-12-07 00:54:31 +00:00
package adapters
// Common interfaces
type SearchProvider interface {
Search(query string, options map[string]string) (*SearchResponse, error)
}
type ExtractProvider interface {
Extract(urls []string) (*ExtractResponse, error)
}
// Response types
type SearchResult struct {
URL string `json:"url"`
Content string `json:"content"`
}
type SearchResponse struct {
Results []SearchResult `json:"results"`
}
type ExtractResult struct {
URL string `json:"url"`
RawContent string `json:"raw_content"`
}
type FailedResult struct {
URL string `json:"url"`
Error string `json:"error"`
}
type ExtractResponse struct {
Results []ExtractResult `json:"results"`
FailedResults []FailedResult `json:"failed_results"`
ResponseTime float64 `json:"response_time"`
}
2024-12-07 11:08:15 +00:00
// Add base URL configuration
type Config struct {
APIKey string
BaseURL string
}