caldav: add prop-filter support to client

This commit is contained in:
Simon Ser 2020-02-05 18:38:46 +01:00
parent baf63fb1b7
commit 1d93353e3d
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 28 additions and 1 deletions

View File

@ -29,9 +29,19 @@ type CalendarCompRequest struct {
type CompFilter struct {
Name string
Start, End time.Time
Props []PropFilter
Comps []CompFilter
}
type PropFilter struct {
Name string
TextMatch *TextMatch
}
type TextMatch struct {
Text string
}
type CalendarQuery struct {
CompRequest CalendarCompRequest
CompFilter CompFilter

View File

@ -72,8 +72,25 @@ type compFilter struct {
Name string `xml:"name,attr"`
IsNotDefined *struct{} `xml:"is-not-defined,omitempty"`
TimeRange *timeRange `xml:"time-range,omitempty"`
PropFilters []propFilter `xml:"prop-filter,omitempty"`
CompFilters []compFilter `xml:"comp-filter,omitempty"`
// TODO: prop-filter
}
// https://tools.ietf.org/html/rfc4791#section-9.7.2
type propFilter struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:caldav prop-filter"`
Name string `xml:"name,attr"`
IsNotDefined *struct{} `xml:"is-not-defined,omitempty"`
TimeRange *timeRange `xml:"time-range,omitempty"`
TextMatch *textMatch `xml:"text-match,omitempty"`
// TODO: param-filter
}
// https://tools.ietf.org/html/rfc4791#section-9.7.5
type textMatch struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:caldav text-match"`
Text string `xml:",chardata"`
// TODO: collation, negate-condition
}
// https://tools.ietf.org/html/rfc4791#section-9.9