1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Adapted from encoding/xml/read_test.go.
7 // Package atom defines XML data structures for an Atom feed.
8 package atom // import "golang.org/x/tools/blog/atom"
16 XMLName xml.Name `xml:"http://www.w3.org/2005/Atom feed"`
17 Title string `xml:"title"`
19 Link []Link `xml:"link"`
20 Updated TimeStr `xml:"updated"`
21 Author *Person `xml:"author"`
22 Entry []*Entry `xml:"entry"`
26 Title string `xml:"title"`
28 Link []Link `xml:"link"`
29 Published TimeStr `xml:"published"`
30 Updated TimeStr `xml:"updated"`
31 Author *Person `xml:"author"`
32 Summary *Text `xml:"summary"`
33 Content *Text `xml:"content"`
34 Category []Category `xml:"category,omitempty"`
38 Rel string `xml:"rel,attr,omitempty"`
39 Href string `xml:"href,attr"`
40 Type string `xml:"type,attr,omitempty"`
41 HrefLang string `xml:"hreflang,attr,omitempty"`
42 Title string `xml:"title,attr,omitempty"`
43 Length uint `xml:"length,attr,omitempty"`
47 Name string `xml:"name"`
48 URI string `xml:"uri,omitempty"`
49 Email string `xml:"email,omitempty"`
50 InnerXML string `xml:",innerxml"`
54 Type string `xml:"type,attr"`
55 Body string `xml:",chardata"`
60 func Time(t time.Time) TimeStr {
61 return TimeStr(t.Format("2006-01-02T15:04:05-07:00"))
64 type Category struct {
65 Term string `xml:"term,attr"`