Client is a http client to crawl the feed from (#)
type Client interface { Get(url string) (resp *http.Response, err error) }
Image contains the URL and title of the podcast logo
type Image struct { URL string `xml:"url"` Title string `xml:"title"` }
Item represents an episode with all of its content
type Item struct { Title string `xml:"title"` Link string `xml:"link"` Comments string `xml:"comments"` PubDate string `xml:"pubDate"` GUID string `xml:"guid"` Category []string `xml:"category"` Enclosure []ItemEnclosure `xml:"enclosure"` Description string `xml:"description"` Content string `xml:"content"` }
func (episode *Item) Time() time.Time
Time returns the specified publication date as time.Time
ItemEnclosure contains an URL and its MIME-Type of an episode file
type ItemEnclosure struct { URL string `xml:"url,attr"` Type string `xml:"type,attr"` }
Main struct represents the root of the RSS feed
type Main struct { Title string `xml:"title"` Link string `xml:"link"` Copyright string `xml:"copyright"` Description string `xml:"description"` Generator string `xml:"generator"` Language string `xml:"language"` LastBuildDate string `xml:"lastBuildDate"` Items []Item `xml:"item"` Image Image `xml:"image"` }
func Read(url string) (*Main, error)
Read reads from an URL with the Golang default http client and returns rss.Main
func ReadCustomClient(url string, client Client) (*Main, error)
ReadCustomClient allows to read with an custom http client
func (rss *Main) Len() int
Len returns the episode count
func (rss *Main) Time() time.Time
Time returns the specified last build date as time.Time