/
json.go
39 lines (31 loc) · 875 Bytes
/
json.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
package gcontacts
import (
_ "encoding/xml"
)
// Minimal set of fields that are needed by other projects.
type Feed struct {
Entries []Entry `xml:"entry"`
}
type Entry struct {
Id string `xml:"id"`
Name Name `xml:"name"`
PhoneNumbers []PhoneNumber `xml:"phoneNumber"`
GroupMembershipInfo []GroupMembershipInfo `xml:"groupMembershipInfo"`
Links []Link `xml:"link"`
}
type Name struct {
GivenName string `xml:"givenName"`
FamilyName string `xml:"familyName"`
}
type PhoneNumber struct {
Value string `xml:",chardata"`
}
type GroupMembershipInfo struct {
Deleted string `xml:"deleted,attr"`
Href string `xml:"href,attr"`
}
type Link struct {
Rel string `xml:"rel,attr,omitempty"`
Type string `xml:"type,attr"`
Href string `xml:"href,attr"`
}