/
feed.go
60 lines (52 loc) · 1.43 KB
/
feed.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package model
import (
"encoding/xml"
"time"
)
type Opml struct {
XMLName xml.Name `xml:"opml"`
Text string `xml:",chardata"`
Version string `xml:"version,attr"`
Head OpmlHead `xml:"head"`
Body OpmlBody `xml:"body"`
}
type OpmlHead struct {
Text string `xml:",chardata"`
Title string `xml:"title"`
OwnerEmail string `xml:"ownerEmail"`
}
type OpmlBody struct {
Text string `xml:",chardata"`
OutlineOuter OutlineOuter `xml:"outline"`
}
type OutlineOuter struct {
Text string `xml:",chardata"`
AttrText string `xml:"text,attr"`
Title string `xml:"title,attr"`
Outline []OpmlOutline `xml:"outline"`
}
type OpmlOutline struct {
Text string `xml:",chardata"`
Type string `xml:"type,attr"`
XmlUrl string `xml:"xmlUrl,attr"`
AttrText string `xml:"text,attr"`
HtmlUrl string `xml:"htmlUrl,attr"`
Title string `xml:"title,attr"`
}
type Feed struct {
ID string `json:"id" clover:"id"`
Title string `json:"title" clover:"title"`
Description string `json:"description" clover:"description"`
Text string `json:"text" clover:"text"`
Type string `json:"type" clover:"type"`
HtmlUrl string `json:"html_url" clover:"html_url"`
XMLUrl string `json:"xml_url" clover:"xml_url"`
}
type BlogRoll struct {
ID string
Title string
Tag string
Category string
DateCreated time.Time
Feeds []Feed
}