podcast

package
v0.0.0-...-7af979f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

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 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

func (*Search) Search

func (podcastSearch *Search) Search(ctx context.Context, term string, limit string) ([]Podcast, error)

Search searches for and persists Podcasts

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

Jump to

Keyboard shortcuts

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