Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EpisodeHandler ¶
func EpisodeHandler() http.HandlerFunc
EpisodeHandler is a http.HandlerFunc serving FeedEpisodes.
func Handler ¶
func Handler(feedRepository Repository) http.HandlerFunc
Handler is a http.HandlerFunc serving a Feed with a given ID.
func ImageHandler ¶
func ImageHandler() http.HandlerFunc
ImageHandler is a http.HandlerFunc serving FeedImages.
Types ¶
type Episode ¶
type Episode struct { Title string `json:"title" xml:"title"` Description string `json:"description" xml:"description" datastore:",noindex"` Author string `json:"author" xml:"author"` GUID string `json:"guid" xml:"guid"` PubDate string `json:"pubDate" xml:"pubDate"` }
Episode represents a Podcast Episode.
type Feed ¶
type Feed struct { ID int64 `json:"id" datastore:"-"` Title string `json:"title" xml:"title"` Link string `json:"link" xml:"link"` Description string `json:"description" xml:"description" datastore:",noindex"` Language string `json:"language" xml:"language"` Copyright string `json:"copyright" xml:"copyright"` PubDate string `json:"pubDate" xml:"pubDate"` Image Image `json:"image" xml:"image"` Episodes []Episode `json:"episodes" xml:"item"` }
Feed represents a Podcast Feed.
type Image ¶
type Image struct { //Id int64 `datastore:"-"` FeeURL string `json:"url" xml:"url"` Title string `json:"title" xml:"title"` Link string `json:"link" xml:"link"` }
Image is attached to Feed.
type Repository ¶
type Repository interface { Save(ctx context.Context, feed *Feed) (*Feed, error) Get(ctx context.Context, id int64) (*Feed, error) GetAll(ctx context.Context) ([]Feed, error) }
Repository is responsible for CRUD operations on Feeds.
type Task ¶
type Task struct { FeedRepository Repository HTTPClient middleware.HTTPClientFacade }
Task fetches and stores Podcast Feeds
func NewFeedTask ¶
func NewFeedTask(feedRepo Repository, httpClient middleware.HTTPClientFacade) *Task
NewFeedTask creates a new FeedTask
func (*Task) FetchAndStore ¶
FetchAndStore fetches the Feed assigned to given Podcast and persists it.
Click to show internal directories.
Click to hide internal directories.