Documentation ¶
Overview ¶
The Tideland Go Library atom package implements an RSS feed client.
The RSS package provides the RSS XML schema as Go types for the usage with the standard marshalling/unmarshalling. The supported format is RSS 2.0. A client allows to retrieve RSS documents.
Index ¶
- Constants
- func ComposeTime(t time.Time) string
- func Encode(w io.Writer, rss *RSS) error
- func IsParsingError(err error) bool
- func IsValidationError(err error) bool
- func ParseTime(s string) (t time.Time, err error)
- type Category
- type Channel
- type Cloud
- type Enclosure
- type GUID
- type Image
- type Item
- type RSS
- type SkipDays
- type SkipHours
- type Source
- type TextInput
Constants ¶
const ( ErrValidation = iota + 1 ErrParsing )
const (
Version = "2.0"
)
Variables ¶
This section is empty.
Functions ¶
func ComposeTime ¶
ComposeTime takes a Go time and converts it into a valid RSS time string.
func IsParsingError ¶
IsParsingError checks if the error signals a bad formatted value.
func IsValidationError ¶
IsValidationError checks if the error signals an invalid feed.
Types ¶
type Category ¶
type Category struct { Category string `xml:",chardata"` Domain string `xml:"domain,attr,omitempty"` }
Category identifies a category or tag to which the feed belongs.
type Channel ¶
type Channel struct { Title string `xml:"title"` Description string `xml:"description"` Link string `xml:"link"` Categories []*Category `xml:"category,omitempty"` Cloud *Cloud `xml:"cloud,omitempty"` Copyright string `xml:"copyright,omitempty"` Docs string `xml:"docs,omitempty"` Generator string `xml:"generator,omitempty"` Image *Image `xml:"image,omitempty"` Language string `xml:"language,omitempty"` LastBuildDate string `xml:"lastBuildDate,omitempty"` ManagingEditor string `xml:"managingEditor,omitempty"` PubDate string `xml:"pubDate,omitempty"` Rating string `xml:"rating,omitempty"` SkipDays *SkipDays `xml:"skipDays,omitempty"` SkipHours *SkipHours `xml:"skipHours,omitempty"` TextInput string `xml:"textInput,omitempty"` TTL int `xml:"ttl,omitempty"` WebMaster string `xml:"webMaster,omitempty"` Items []*Item `xml:"item,omitempty"` }
Channel is the one channel element of the RSS document.
type Cloud ¶
type Cloud struct { Domain string `xml:"domain,attr"` Port int `xml:"port,attr,omitempty"` Path string `xml:"path,attr"` RegisterProcedure string `xml:"registerProcedure,attr"` Protocol string `xml:"protocol,attr"` }
Cloud indicates that updates to the feed can be monitored using a web service that implements the RssCloud application programming interface.
type Enclosure ¶
type Enclosure struct { Length int64 `xml:"length,attr"` Type string `xml:"type,attr"` URL string `xml:"url,attr"` }
Enclosure associates a media object such as an audio or video file with the item.
type GUID ¶
type GUID struct { GUID string `xml:",chardata"` IsPermaLink bool `xml:"isPermaLink,attr,omitempty"` }
GUID provides a string that uniquely identifies the item.
type Image ¶
type Image struct { Link string `xml:"link"` Title string `xml:"title"` URL string `xml:"url"` Description string `xml:"description,omitempty"` Height int `xml:"height,omitempty"` Width int `xml:"width,omitempty"` }
Image supplies a graphical logo for the feed .
type Item ¶
type Item struct { Title string `xml:"title,omitempty"` Description string `xml:"description,omitempty"` Author string `xml:"author,omitempty"` Categories []*Category `xml:"category,omitempty"` Comments string `xml:"comments,omitempty"` Enclosure *Enclosure `xml:"enclosure,omitempty"` GUID *GUID `xml:"guid,omitempty"` Link string `xml:"link,omitempty"` PubDate string `xml:"pubDate,omitempty"` Source *Source `xml:"source,omitempty"` }
Item represents distinct content published in the feed such as a news article, weblog entry or some other form of discrete update. It must contain either a title or description.
type RSS ¶
type RSS struct { XMLName string `xml:"rss"` Version string `xml:"version,attr"` Channel Channel `xml:"channel"` }
RSS is the root element of the document.
type SkipDays ¶
type SkipDays struct {
Days []string `xml:"day"`
}
SkipDays identifies days of the week during which the feed is not updated.
type SkipHours ¶
type SkipHours struct {
Hours []int `xml:"hour"`
}
SkipHours identifies the hours of the day during which the feed is not updated.