@@ -8,40 +8,34 @@ import (
8
8
type Request struct {
9
9
XMLName xml.Name `xml:"request" json:"xml_name,omitempty"`
10
10
Text string `xml:",chardata" json:"text,omitempty"`
11
- RrList * RrList `xml:"rr-list" json:"rr_list,omitempty"`
11
+ RRList * RrList `xml:"rr-list" json:"rr_list,omitempty"`
12
12
}
13
13
14
14
type RrList struct {
15
15
Text string `xml:",chardata" json:"text,omitempty"`
16
- Rr []* RR `xml:"rr" json:"rr,omitempty"`
16
+ RR []* RR `xml:"rr" json:"rr,omitempty"`
17
17
}
18
18
19
19
type RR struct {
20
- Text string `xml:",chardata" json:"text,omitempty"`
21
- ID string `xml:"id,attr,omitempty" json:"id,omitempty"`
22
- Name string `xml:"name" json:"name,omitempty"`
23
- IdnName string `xml:"idn-name,omitempty" json:"idn_name,omitempty"`
24
- Ttl string `xml:"ttl" json:"ttl,omitempty"`
25
- Type string `xml:"type" json:"type,omitempty"`
26
- Soa * Soa `xml:"soa" json:"soa,omitempty"`
27
- A * Address `xml:"a" json:"a,omitempty"`
28
- AAAA * Address `xml:"aaaa" json:"aaaa,omitempty"`
29
- Cname * Cname `xml:"cname" json:"cname,omitempty"`
30
- Ns * Ns `xml:"ns" json:"ns,omitempty"`
31
- Mx * Mx `xml:"mx" json:"mx,omitempty"`
32
- Srv * Srv `xml:"srv" json:"srv,omitempty"`
33
- Ptr * Ptr `xml:"ptr" json:"ptr,omitempty"`
34
- Txt * Txt `xml:"txt" json:"txt,omitempty"`
35
- Dname * Dname `xml:"dname" json:"dname,omitempty"`
36
- Hinfo * Hinfo `xml:"hinfo" json:"hinfo,omitempty"`
37
- Naptr * Naptr `xml:"naptr" json:"naptr,omitempty"`
38
- Rp * Rp `xml:"rp" json:"rp,omitempty"`
39
- }
40
-
41
- type Address string
42
-
43
- func (address * Address ) String () string {
44
- return string (* address )
20
+ Text string `xml:",chardata" json:"text,omitempty"`
21
+ ID string `xml:"id,attr,omitempty" json:"id,omitempty"`
22
+ Name string `xml:"name" json:"name,omitempty"`
23
+ IdnName string `xml:"idn-name,omitempty" json:"idn_name,omitempty"`
24
+ TTL string `xml:"ttl" json:"ttl,omitempty"`
25
+ Type string `xml:"type" json:"type,omitempty"`
26
+ Soa * Soa `xml:"soa" json:"soa,omitempty"`
27
+ A * string `xml:"a" json:"a,omitempty"`
28
+ AAAA * string `xml:"aaaa" json:"aaaa,omitempty"`
29
+ CName * CName `xml:"cname" json:"cname,omitempty"`
30
+ Ns * Ns `xml:"ns" json:"ns,omitempty"`
31
+ Mx * Mx `xml:"mx" json:"mx,omitempty"`
32
+ Srv * Srv `xml:"srv" json:"srv,omitempty"`
33
+ Ptr * Ptr `xml:"ptr" json:"ptr,omitempty"`
34
+ Txt * Txt `xml:"txt" json:"txt,omitempty"`
35
+ DName * DName `xml:"dname" json:"dname,omitempty"`
36
+ HInfo * HInfo `xml:"hinfo" json:"hinfo,omitempty"`
37
+ Naptr * Naptr `xml:"naptr" json:"naptr,omitempty"`
38
+ RP * RP `xml:"rp" json:"rp,omitempty"`
45
39
}
46
40
47
41
type Service struct {
@@ -54,28 +48,28 @@ type Service struct {
54
48
Name string `xml:"name,attr" json:"name,omitempty"`
55
49
Payer string `xml:"payer,attr" json:"payer,omitempty"`
56
50
Tariff string `xml:"tariff,attr" json:"tariff,omitempty"`
57
- RrLimit string `xml:"rr-limit,attr" json:"rr_limit,omitempty"`
58
- RrNum string `xml:"rr-num,attr" json:"rr_num,omitempty"`
51
+ RRLimit string `xml:"rr-limit,attr" json:"rr_limit,omitempty"`
52
+ RRNum string `xml:"rr-num,attr" json:"rr_num,omitempty"`
59
53
}
60
54
61
55
type Soa struct {
62
56
Text string `xml:",chardata" json:"text,omitempty"`
63
- Mname * Mname `xml:"mname" json:"mname,omitempty"`
64
- Rname * Rname `xml:"rname" json:"rname,omitempty"`
57
+ MName * MName `xml:"mname" json:"mname,omitempty"`
58
+ RName * RName `xml:"rname" json:"rname,omitempty"`
65
59
Serial string `xml:"serial" json:"serial,omitempty"`
66
60
Refresh string `xml:"refresh" json:"refresh,omitempty"`
67
61
Retry string `xml:"retry" json:"retry,omitempty"`
68
62
Expire string `xml:"expire" json:"expire,omitempty"`
69
63
Minimum string `xml:"minimum" json:"minimum,omitempty"`
70
64
}
71
65
72
- type Mname struct {
66
+ type MName struct {
73
67
Text string `xml:",chardata" json:"text,omitempty"`
74
68
Name string `xml:"name" json:"name,omitempty"`
75
69
IdnName string `xml:"idn-name,omitempty" json:"idn_name,omitempty"`
76
70
}
77
71
78
- type Rname struct {
72
+ type RName struct {
79
73
Text string `xml:",chardata" json:"text,omitempty"`
80
74
Name string `xml:"name" json:"name,omitempty"`
81
75
IdnName string `xml:"idn-name,omitempty" json:"idn_name,omitempty"`
@@ -116,10 +110,10 @@ type Ptr struct {
116
110
Name string `xml:"name" json:"name,omitempty"`
117
111
}
118
112
119
- type Hinfo struct {
113
+ type HInfo struct {
120
114
Text string `xml:",chardata" json:"text,omitempty"`
121
115
Hardware string `xml:"hardware" json:"hardware,omitempty"`
122
- Os string `xml:"os" json:"os,omitempty"`
116
+ OS string `xml:"os" json:"os,omitempty"`
123
117
}
124
118
125
119
type Naptr struct {
@@ -137,29 +131,29 @@ type Replacement struct {
137
131
Name string `xml:"name" json:"name,omitempty"`
138
132
}
139
133
140
- type Rp struct {
134
+ type RP struct {
141
135
Text string `xml:",chardata" json:"text,omitempty"`
142
- MboxDname * MboxDname `xml:"mbox-dname" json:"mbox_dname,omitempty"`
143
- TxtDname * TxtDname `xml:"txt-dname" json:"txt_dname,omitempty"`
136
+ MboxDName * MboxDName `xml:"mbox-dname" json:"mbox_dname,omitempty"`
137
+ TxtDName * TxtDName `xml:"txt-dname" json:"txt_dname,omitempty"`
144
138
}
145
139
146
- type MboxDname struct {
140
+ type MboxDName struct {
147
141
Text string `xml:",chardata" json:"text,omitempty"`
148
142
Name string `xml:"name" json:"name,omitempty"`
149
143
}
150
144
151
- type TxtDname struct {
145
+ type TxtDName struct {
152
146
Text string `xml:",chardata" json:"text,omitempty"`
153
147
Name string `xml:"name" json:"name,omitempty"`
154
148
}
155
149
156
- type Cname struct {
150
+ type CName struct {
157
151
Text string `xml:",chardata" json:"text,omitempty"`
158
152
Name string `xml:"name" json:"name,omitempty"`
159
153
IdnName string `xml:"idn-name,omitempty" json:"idn_name,omitempty"`
160
154
}
161
155
162
- type Dname struct {
156
+ type DName struct {
163
157
Text string `xml:",chardata" json:"text,omitempty"`
164
158
Name string `xml:"name" json:"name,omitempty"`
165
159
}
@@ -180,13 +174,13 @@ type Zone struct {
180
174
Name string `xml:"name,attr" json:"name,omitempty"`
181
175
Payer string `xml:"payer,attr" json:"payer,omitempty"`
182
176
Service string `xml:"service,attr" json:"service,omitempty"`
183
- Rr []* RR `xml:"rr" json:"rr,omitempty"`
177
+ RR []* RR `xml:"rr" json:"rr,omitempty"`
184
178
}
185
179
186
180
type Revision struct {
187
181
Text string `xml:",chardata" json:"text,omitempty"`
188
182
Date string `xml:"date,attr" json:"date,omitempty"`
189
- Ip string `xml:"ip,attr" json:"ip,omitempty"`
183
+ IP string `xml:"ip,attr" json:"ip,omitempty"`
190
184
Number string `xml:"number,attr" json:"number,omitempty"`
191
185
}
192
186
@@ -195,8 +189,8 @@ type Error struct {
195
189
Code string `xml:"code,attr" json:"code,omitempty"`
196
190
}
197
191
198
- func describeError (e Error ) string {
199
- return fmt .Sprintf (` %s (code %s)` , e .Text , e .Code )
192
+ func (e Error ) Error ( ) string {
193
+ return fmt .Sprintf (" %s (code %s)" , e .Text , e .Code )
200
194
}
201
195
202
196
type Response struct {
@@ -214,6 +208,6 @@ type Data struct {
214
208
Text string `xml:",chardata" json:"text,omitempty"`
215
209
Service []* Service `xml:"service" json:"service,omitempty"`
216
210
Zone []* Zone `xml:"zone" json:"zone,omitempty"`
217
- Address []* Address `xml:"address" json:"address,omitempty"`
211
+ Address []* string `xml:"address" json:"address,omitempty"`
218
212
Revision []* Revision `xml:"revision" json:"revision,omitempty"`
219
213
}
0 commit comments