internal: remove unnecessary namespaces in structs

This commit is contained in:
Simon Ser 2020-01-14 21:32:43 +01:00
parent 5748fec4d0
commit 388377dfca
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -31,8 +31,8 @@ func (s Status) Err() error {
// https://tools.ietf.org/html/rfc4918#section-14.16 // https://tools.ietf.org/html/rfc4918#section-14.16
type Multistatus struct { type Multistatus struct {
XMLName xml.Name `xml:"DAV: multistatus"` XMLName xml.Name `xml:"DAV: multistatus"`
Responses []Response `xml:"DAV: response"` Responses []Response `xml:"response"`
ResponseDescription string `xml:"DAV: responsedescription,omitempty"` ResponseDescription string `xml:"responsedescription,omitempty"`
} }
func (ms *Multistatus) Get(href string) (*Response, error) { func (ms *Multistatus) Get(href string) (*Response, error) {
@ -51,12 +51,12 @@ func (ms *Multistatus) Get(href string) (*Response, error) {
// https://tools.ietf.org/html/rfc4918#section-14.24 // https://tools.ietf.org/html/rfc4918#section-14.24
type Response struct { type Response struct {
XMLName xml.Name `xml:"DAV: response"` XMLName xml.Name `xml:"DAV: response"`
Href []string `xml:"DAV: href"` Href []string `xml:"href"`
Propstats []Propstat `xml:"DAV: propstat,omitempty"` Propstats []Propstat `xml:"propstat,omitempty"`
ResponseDescription string `xml:"DAV: responsedescription,omitempty"` ResponseDescription string `xml:"responsedescription,omitempty"`
Status Status `xml:"DAV: status,omitempty"` Status Status `xml:"status,omitempty"`
Error *RawXMLValue `xml:"DAV: error,omitempty"` Error *RawXMLValue `xml:"error,omitempty"`
Location *Location `xml:"DAV: location,omitempty"` Location *Location `xml:"location,omitempty"`
} }
func (resp *Response) DecodeProp(name xml.Name, v interface{}) error { func (resp *Response) DecodeProp(name xml.Name, v interface{}) error {
@ -81,16 +81,16 @@ func (resp *Response) DecodeProp(name xml.Name, v interface{}) error {
// https://tools.ietf.org/html/rfc4918#section-14.9 // https://tools.ietf.org/html/rfc4918#section-14.9
type Location struct { type Location struct {
XMLName xml.Name `xml:"DAV: location"` XMLName xml.Name `xml:"DAV: location"`
Href string `xml:"DAV: href"` Href string `xml:"href"`
} }
// https://tools.ietf.org/html/rfc4918#section-14.22 // https://tools.ietf.org/html/rfc4918#section-14.22
type Propstat struct { type Propstat struct {
XMLName xml.Name `xml:"DAV: propstat"` XMLName xml.Name `xml:"DAV: propstat"`
Prop Prop `xml:"DAV: prop"` Prop Prop `xml:"prop"`
Status Status `xml:"DAV: status"` Status Status `xml:"status"`
ResponseDescription string `xml:"DAV: responsedescription,omitempty"` ResponseDescription string `xml:"responsedescription,omitempty"`
Error *RawXMLValue `xml:"DAV: error,omitempty"` Error *RawXMLValue `xml:"error,omitempty"`
} }
// https://tools.ietf.org/html/rfc4918#section-14.18 // https://tools.ietf.org/html/rfc4918#section-14.18
@ -102,7 +102,7 @@ type Prop struct {
// https://tools.ietf.org/html/rfc4918#section-14.20 // https://tools.ietf.org/html/rfc4918#section-14.20
type Propfind struct { type Propfind struct {
XMLName xml.Name `xml:"DAV: propfind"` XMLName xml.Name `xml:"DAV: propfind"`
Prop *Prop `xml:"DAV: prop,omitempty"` Prop *Prop `xml:"prop,omitempty"`
// TODO: propname | (allprop, include?) // TODO: propname | (allprop, include?)
} }