summaryrefslogtreecommitdiff
path: root/atom/atom.go
blob: a74a981401caa23cb3185b3ce16998db0bc147a0 (plain)
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
package atom

import "time"

type Link struct {
	XMLName struct{} `xml:"link"`

	Href string `xml:"href,attr"`
	Rel  string `xml:"rel,attr,omitempty"`
}

type Summary struct {
	XMLName struct{} `xml:"summary"`

	Type    string `xml:"type,attr"`
	Content string `xml:",chardata"`
}

type Entry struct {
	XMLName struct{} `xml:"entry"`

	Title   string    `xml:"title"`
	Id      string    `xml:"id"`
	Updated time.Time `xml:"updated"`
	Summary Summary
	Links   []Link
}

type Feed struct {
	XMLName struct{} `xml:"http://www.w3.org/2005/Atom feed"`

	Title       string `xml:"title"`
	Links       []Link
	Id          string    `xml:"id"`
	AuthorName  string    `xml:"author>name"`
	AuthorEmail string    `xml:"author>email"`
	AuthorUri   string    `xml:"author>uri"`
	Updated     time.Time `xml:"updated"`
	Entries     []Entry
}