mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-23 00:34:23 +00:00
carddav: add allprop and propname support to query and multiget in server
This commit is contained in:
parent
0a251a8dfb
commit
7e29f37bd8
@ -56,7 +56,8 @@ type maxResourceSize struct {
|
|||||||
type addressbookQuery struct {
|
type addressbookQuery struct {
|
||||||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:carddav addressbook-query"`
|
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:carddav addressbook-query"`
|
||||||
Prop *internal.Prop `xml:"DAV: prop,omitempty"`
|
Prop *internal.Prop `xml:"DAV: prop,omitempty"`
|
||||||
// TODO: DAV:allprop | DAV:propname
|
AllProp *struct{} `xml:"DAV: allprop,omitempty"`
|
||||||
|
PropName *struct{} `xml:"DAV: propname,omitempty"`
|
||||||
// TODO: filter, limit?
|
// TODO: filter, limit?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +66,8 @@ type addressbookMultiget struct {
|
|||||||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:carddav addressbook-multiget"`
|
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:carddav addressbook-multiget"`
|
||||||
Hrefs []internal.Href `xml:"DAV: href"`
|
Hrefs []internal.Href `xml:"DAV: href"`
|
||||||
Prop *internal.Prop `xml:"DAV: prop,omitempty"`
|
Prop *internal.Prop `xml:"DAV: prop,omitempty"`
|
||||||
// TODO: DAV:allprop | DAV:propname
|
AllProp *struct{} `xml:"DAV: allprop,omitempty"`
|
||||||
|
PropName *struct{} `xml:"DAV: propname,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func newProp(name string, noValue bool) *internal.RawXMLValue {
|
func newProp(name string, noValue bool) *internal.RawXMLValue {
|
||||||
|
@ -87,7 +87,8 @@ func (h *Handler) handleQuery(w http.ResponseWriter, query *addressbookQuery) er
|
|||||||
b := backend{h.Backend}
|
b := backend{h.Backend}
|
||||||
propfind := internal.Propfind{
|
propfind := internal.Propfind{
|
||||||
Prop: query.Prop,
|
Prop: query.Prop,
|
||||||
// TODO: Allprop, Propnames
|
AllProp: query.AllProp,
|
||||||
|
PropName: query.PropName,
|
||||||
}
|
}
|
||||||
resp, err := b.propfindAddressObject(&propfind, &ao)
|
resp, err := b.propfindAddressObject(&propfind, &ao)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -111,7 +112,8 @@ func (h *Handler) handleMultiget(w http.ResponseWriter, multiget *addressbookMul
|
|||||||
b := backend{h.Backend}
|
b := backend{h.Backend}
|
||||||
propfind := internal.Propfind{
|
propfind := internal.Propfind{
|
||||||
Prop: multiget.Prop,
|
Prop: multiget.Prop,
|
||||||
// TODO: Allprop, Propnames
|
AllProp: multiget.AllProp,
|
||||||
|
PropName: multiget.PropName,
|
||||||
}
|
}
|
||||||
resp, err := b.propfindAddressObject(&propfind, ao)
|
resp, err := b.propfindAddressObject(&propfind, ao)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user