From 290da52606bd79d8e81592902f3206e9bc73c2f7 Mon Sep 17 00:00:00 2001 From: Simone Vellei Date: Fri, 24 May 2024 11:03:37 +0200 Subject: [PATCH] fix: remove unused structs --- tools/serpapi/api.go | 75 +++----------------------------------------- 1 file changed, 4 insertions(+), 71 deletions(-) diff --git a/tools/serpapi/api.go b/tools/serpapi/api.go index d36d36b5..1a7d7ffe 100644 --- a/tools/serpapi/api.go +++ b/tools/serpapi/api.go @@ -24,67 +24,17 @@ type response struct { } type apiResponse struct { - SearchMetadata SearchMetadata `json:"search_metadata"` - SearchParameters SearchParameters `json:"search_parameters"` - SearchInformation SearchInformation `json:"search_information"` - InlineImagesSuggestedSearches []InlineImagesSuggestedSearches `json:"inline_images_suggested_searches"` - InlineImages []InlineImages `json:"inline_images"` - AnswerBox AnswerBox `json:"answer_box"` - OrganicResults []OrganicResults `json:"organic_results"` - Pagination Pagination `json:"pagination"` - SerpapiPagination SerpapiPagination `json:"serpapi_pagination"` -} -type SearchMetadata struct { - ID string `json:"id"` - Status string `json:"status"` - JSONEndpoint string `json:"json_endpoint"` - CreatedAt string `json:"created_at"` - ProcessedAt string `json:"processed_at"` - GoogleURL string `json:"google_url"` - RawHTMLFile string `json:"raw_html_file"` - TotalTimeTaken float64 `json:"total_time_taken"` -} -type SearchParameters struct { - Engine string `json:"engine"` - Q string `json:"q"` - GoogleDomain string `json:"google_domain"` - Hl string `json:"hl"` - Gl string `json:"gl"` - Device string `json:"device"` -} -type SearchInformation struct { - QueryDisplayed string `json:"query_displayed"` - TotalResults int `json:"total_results"` - TimeTakenDisplayed float64 `json:"time_taken_displayed"` - OrganicResultsState string `json:"organic_results_state"` -} -type InlineImagesSuggestedSearches struct { - Name string `json:"name"` - Link string `json:"link"` - Uds string `json:"uds"` - Q string `json:"q"` - SerpapiLink string `json:"serpapi_link"` - Thumbnail string `json:"thumbnail"` -} -type InlineImages struct { - Link string `json:"link"` - Source string `json:"source"` - Thumbnail string `json:"thumbnail"` - Original string `json:"original"` - Title string `json:"title"` - SourceName string `json:"source_name"` -} -type AnswerBox struct { - Type string `json:"type"` - Title string `json:"title"` - Thumbnail string `json:"thumbnail"` + OrganicResults []OrganicResults `json:"organic_results"` } + type Top struct { Extensions []string `json:"extensions"` } + type RichSnippet struct { Top Top `json:"top"` } + type OrganicResults struct { Position int `json:"position"` Title string `json:"title"` @@ -98,23 +48,6 @@ type OrganicResults struct { RichSnippet RichSnippet `json:"rich_snippet,omitempty"` SnippetHighlightedWords []string `json:"snippet_highlighted_words,omitempty"` } -type OtherPages struct { - Num2 string `json:"2"` - Num3 string `json:"3"` - Num4 string `json:"4"` - Num5 string `json:"5"` -} -type Pagination struct { - Current int `json:"current"` - Next string `json:"next"` - OtherPages OtherPages `json:"other_pages"` -} -type SerpapiPagination struct { - Current int `json:"current"` - NextLink string `json:"next_link"` - Next string `json:"next"` - OtherPages OtherPages `json:"other_pages"` -} type result struct { Title string