This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
atom.go
53 lines (46 loc) · 1.56 KB
/
atom.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
package atom
import (
"encoding/xml"
"github.com/Azure/go-autorest/autorest/date"
)
type (
// Feed is an Atom feed which contains entries
Feed struct {
XMLName xml.Name `xml:"feed"`
ID string `xml:"id"`
Title string `xml:"title"`
Updated *date.Time `xml:"updated,omitempty"`
Entries []Entry `xml:"entry"`
}
// Entry is the Atom wrapper for a management request
Entry struct {
XMLName xml.Name `xml:"entry"`
ID string `xml:"id,omitempty"`
Title string `xml:"title,omitempty"`
Published *date.Time `xml:"published,omitempty"`
Updated *date.Time `xml:"updated,omitempty"`
Author *Author `xml:"author,omitempty"`
Link *Link `xml:"link,omitempty"`
Content *Content `xml:"content"`
DataServiceSchema string `xml:"xmlns:d,attr,omitempty"`
DataServiceMetadataSchema string `xml:"xmlns:m,attr,omitempty"`
AtomSchema string `xml:"xmlns,attr"`
}
// Author is an Atom author used in an entry
Author struct {
XMLName xml.Name `xml:"author"`
Name *string `xml:"name,omitempty"`
}
// Link is an Atom link used in an entry
Link struct {
XMLName xml.Name `xml:"link"`
Rel string `xml:"rel,attr"`
HREF string `xml:"href,attr"`
}
// Content is a generic body for an Atom entry
Content struct {
XMLName xml.Name `xml:"content"`
Type string `xml:"type,attr"`
Body string `xml:",innerxml"`
}
)