summaryrefslogtreecommitdiffstats
path: root/schema
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-12-13 21:31:45 -0500
committersiddharth <s@ricketyspace.net>2021-12-13 21:31:45 -0500
commit1472b8e4bcde779735fd7faed06f2131a5f29a60 (patch)
tree262958a6cb8387312d17e9c4e1ac9e9d69eef870 /schema
parente602b18cfd5f756a2cc3e67d6be4b2a5089959be (diff)
schema/schema.go: add docs
Diffstat (limited to 'schema')
-rw-r--r--schema/schema.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/schema/schema.go b/schema/schema.go
index 3d010c1..55e215a 100644
--- a/schema/schema.go
+++ b/schema/schema.go
@@ -8,6 +8,7 @@ import (
"time"
)
+// Generic entry.
type Entry struct {
Id string
Title string
@@ -15,12 +16,13 @@ type Entry struct {
Link string
}
-// NPR Feed Schema
+// Represents a NPR media link.
type NPRLink struct {
XMLName xml.Name `xml:"link"`
Url string `xml:",chardata"`
}
+// Represents an entry in the NPR feed.
type NPREntry struct {
XMLName xml.Name `xml:"item"`
Id string `xml:"guid"`
@@ -30,17 +32,19 @@ type NPREntry struct {
Link NPRLink `xml:"link"`
}
+// Represents a NPR Feed.
type NPRFeed struct {
XMLName xml.Name `xml:"rss"`
Entries []NPREntry `xml:"channel>item"`
}
-// YouTube Feed Schema
+// Represents the link a YouTube video.
type YouTubeLink struct {
XMLName xml.Name `xml:"content"`
Url string `xml:"url,attr"`
}
+// Represents an entry in the YouTube feed.
type YouTubeEntry struct {
XMLName xml.Name `xml:"entry"`
Id string `xml:"id"`
@@ -50,6 +54,7 @@ type YouTubeEntry struct {
Link YouTubeLink `xml:"group>content"`
}
+// Represents a YouTube feed.
type YouTubeFeed struct {
XMLName xml.Name `xml:"feed"`
Entries []YouTubeEntry `xml:"entry"`