From 85473656174b1b1d6221d3bb76cc12fa5f7f7e8d Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 1 Jan 2021 14:46:54 +0100 Subject: Initial commit --- atom/atom.go | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 atom/atom.go (limited to 'atom') diff --git a/atom/atom.go b/atom/atom.go new file mode 100644 index 0000000..a74a981 --- /dev/null +++ b/atom/atom.go @@ -0,0 +1,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 +} -- cgit v1.2.3-70-g09d2