webdav: add very basic Client

This commit is contained in:
Simon Ser
2020-01-14 18:51:17 +01:00
parent 055a297f6e
commit 3beb076950
4 changed files with 160 additions and 0 deletions

29
internal/elements.go Normal file
View File

@@ -0,0 +1,29 @@
package internal
import (
"encoding/xml"
)
// https://tools.ietf.org/html/rfc4918#section-14.16
type multistatus struct {
XMLName xml.Name `xml:"DAV: multistatus"`
Responses []Response `xml:"DAV: response"`
// TODO: responsedescription?
}
// https://tools.ietf.org/html/rfc4918#section-14.24
type Response struct {
XMLName xml.Name `xml:"DAV: response"`
Href string `xml:"DAV: href"`
Propstats []Propstat `xml:"DAV: propstat"`
// TODO: (href*, status)
// TODO: error?, responsedescription? , location?
}
// https://tools.ietf.org/html/rfc4918#section-14.22
type Propstat struct {
XMLName xml.Name `xml:"DAV: propstat"`
Prop RawXMLValue `xml:"DAV: prop"`
Status string `xml:"DAV: status"`
// TODO: error?, responsedescription?
}