Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SearchHandler ¶
func SearchHandler(podcastSearcher *Search) http.HandlerFunc
SearchHandler creates a http.HandlerFunc searching for Podcasts on the given PodcastSearch.
func SuggestionHandler ¶
func SuggestionHandler(podcastSuggestion SuggestionFacade) http.HandlerFunc
SuggestionHandler is a http.HandlerFunc serving search results
Types ¶
type Podcast ¶
type Podcast struct { ID int64 `json:"id"` ArtistName string `json:"artistName"` CollectionName string `json:"collectionName"` FeedURL string `json:"feedUrl"` CollectionID int64 `json:"collectionId"` TrackID int64 `json:"trackId"` Genres []string `json:"genres"` }
Podcast struct is strong coupled to the Apple iTunes format.
type Search ¶
type Search struct { FeedTask feed.TaskFacade SearchEngine SearchEngine }
Search encapsulates Task and SearchEngine capabilities
func NewPodcastSearch ¶
func NewPodcastSearch(feedTask feed.TaskFacade, searchEngine SearchEngine) *Search
NewPodcastSearch creates a new PodcastSearchFacade instance
type SearchEngine ¶
type SearchEngine interface {
Search(ctx context.Context, term string, limit string) ([]Podcast, error)
}
SearchEngine searches for Podcasts with the given term.
func NewSearchEngine ¶
func NewSearchEngine(httpClient middleware.HTTPClientFacade) SearchEngine
NewSearchEngine creates a new ITunesSearchEngine instance.
type SearchFacade ¶
type SearchFacade interface {
Search(ctx context.Context, term string, limit string) ([]Podcast, error)
}
SearchFacade is the facade that handle the usecase of searching podcast for a given term and storing the results into the datastore
type SuggestionFacade ¶
type SuggestionFacade interface {
Suggestion(ctx context.Context, term string, limit string) ([]Podcast, error)
}
SuggestionFacade exposes a search result
func NewPodcastSuggestion ¶
func NewPodcastSuggestion(searchEngine SearchEngine) SuggestionFacade
NewPodcastSuggestion creates a new PodcastSuggestionFacade instance