@@ -41,24 +41,25 @@ type RssTextInput struct {
41
41
}
42
42
43
43
type RssFeed struct {
44
- XMLName xml.Name `xml:"channel"`
45
- Title string `xml:"title"` // required
46
- Link string `xml:"link"` // required
47
- Description string `xml:"description"` // required
48
- Language string `xml:"language,omitempty"`
49
- Copyright string `xml:"copyright,omitempty"`
50
- ManagingEditor string `xml:"managingEditor,omitempty"` // Author used
51
- WebMaster string `xml:"webMaster,omitempty"`
52
- PubDate string `xml:"pubDate,omitempty"` // created or updated
53
- LastBuildDate string `xml:"lastBuildDate,omitempty"` // updated used
54
- Category string `xml:"category,omitempty"`
55
- Generator string `xml:"generator,omitempty"`
56
- Docs string `xml:"docs,omitempty"`
57
- Cloud string `xml:"cloud,omitempty"`
58
- Ttl int `xml:"ttl,omitempty"`
59
- Rating string `xml:"rating,omitempty"`
60
- SkipHours string `xml:"skipHours,omitempty"`
61
- SkipDays string `xml:"skipDays,omitempty"`
44
+ XMLName xml.Name `xml:"channel"`
45
+ Attrs []xml.Attr `xml:",attr"`
46
+ Title string `xml:"title"` // required
47
+ Link string `xml:"link"` // required
48
+ Description string `xml:"description"` // required
49
+ Language string `xml:"language,omitempty"`
50
+ Copyright string `xml:"copyright,omitempty"`
51
+ ManagingEditor string `xml:"managingEditor,omitempty"` // Author used
52
+ WebMaster string `xml:"webMaster,omitempty"`
53
+ PubDate string `xml:"pubDate,omitempty"` // created or updated
54
+ LastBuildDate string `xml:"lastBuildDate,omitempty"` // updated used
55
+ Category string `xml:"category,omitempty"`
56
+ Generator string `xml:"generator,omitempty"`
57
+ Docs string `xml:"docs,omitempty"`
58
+ Cloud string `xml:"cloud,omitempty"`
59
+ Ttl int `xml:"ttl,omitempty"`
60
+ Rating string `xml:"rating,omitempty"`
61
+ SkipHours string `xml:"skipHours,omitempty"`
62
+ SkipDays string `xml:"skipDays,omitempty"`
62
63
Image * RssImage
63
64
TextInput * RssTextInput
64
65
Items []* RssItem
@@ -77,6 +78,7 @@ type RssItem struct {
77
78
Guid string `xml:"guid,omitempty"` // Id used
78
79
PubDate string `xml:"pubDate,omitempty"` // created or updated
79
80
Source string `xml:"source,omitempty"`
81
+ Extensions interface {}
80
82
}
81
83
82
84
type RssEnclosure struct {
@@ -99,6 +101,7 @@ func newRssItem(i *Item) *RssItem {
99
101
Description : i .Description ,
100
102
Guid : i .Id ,
101
103
PubDate : anyTimeFormat (time .RFC1123Z , i .Created , i .Updated ),
104
+ Extensions : i .Extension ,
102
105
}
103
106
if len (i .Content ) > 0 {
104
107
item .Content = & RssContent {Content : i .Content }
@@ -136,6 +139,7 @@ func (r *Rss) RssFeed() *RssFeed {
136
139
}
137
140
138
141
channel := & RssFeed {
142
+ Attrs : r .Attrs ,
139
143
Title : r .Title ,
140
144
Link : r .Link .Href ,
141
145
Description : r .Description ,
0 commit comments