summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rss.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/rss.go b/rss.go
index 02388ef..1a45fae 100644
--- a/rss.go
+++ b/rss.go
@@ -1,3 +1,4 @@
+// Package rss implements RSS fetcher
package rss
import (
@@ -6,11 +7,13 @@ import (
"net/http"
)
+// RSS container
type RSS struct {
Version string `xml:"version,attr"`
Channel Channel `xml:"channel"`
}
+// Channel container
type Channel struct {
Link string `xml:"link"`
Language string `xml:"language"`
@@ -20,6 +23,7 @@ type Channel struct {
Items []Item `xml:"item"`
}
+// Item container
type Item struct {
Author string `xml:"author"`
Link string `xml:"link"`
@@ -28,6 +32,7 @@ type Item struct {
PubDate string `xml:"pubDate"`
}
+// Fetch and parse RSS from given URL
func Fetch(url string) (rss RSS, err error) {
resp, err := http.Get(url)
if err != nil {