Last active
February 21, 2025 11:35
-
-
Save timofurrer/e40665d3c57d8f79bec3e2efaf79bf19 to your computer and use it in GitHub Desktop.
cal query, event by uid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query := &caldav.CalendarQuery{ | |
CompRequest: caldav.CalendarCompRequest{ | |
Name: ical.CompCalendar, | |
Comps: []caldav.CalendarCompRequest{{ | |
Name: ical.CompEvent, | |
Props: []string{ | |
ical.PropUID, | |
ical.PropAttendee, | |
}, | |
}}, | |
}, | |
CompFilter: caldav.CompFilter{ | |
Name: ical.CompCalendar, | |
Comps: []caldav.CompFilter{ | |
{ | |
Name: ical.CompEvent, | |
Props: []caldav.PropFilter{ | |
{ | |
Name: ical.PropUID, | |
TextMatch: &caldav.TextMatch{ | |
Text: calUID, | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
} | |
events, err := t.caldav.QueryCalendar(context.Background(), "...mycalendar...", query) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<calendar-query | |
xmlns="urn:ietf:params:xml:ns:caldav"> | |
<prop | |
xmlns="DAV:"> | |
<calendar-data | |
xmlns="urn:ietf:params:xml:ns:caldav"> | |
<comp | |
xmlns="urn:ietf:params:xml:ns:caldav" name="VCALENDAR"> | |
<comp | |
xmlns="urn:ietf:params:xml:ns:caldav" name="VEVENT"> | |
<prop | |
xmlns="urn:ietf:params:xml:ns:caldav" name="UID"> | |
</prop> | |
<prop | |
xmlns="urn:ietf:params:xml:ns:caldav" name="ATTENDEE"> | |
</prop> | |
</comp> | |
</comp> | |
</calendar-data> | |
<getlastmodified | |
xmlns="DAV:"> | |
</getlastmodified> | |
<getetag | |
xmlns="DAV:"> | |
</getetag> | |
</prop> | |
<filter | |
xmlns="urn:ietf:params:xml:ns:caldav"> | |
<comp-filter | |
xmlns="urn:ietf:params:xml:ns:caldav" name="VCALENDAR"> | |
<comp-filter | |
xmlns="urn:ietf:params:xml:ns:caldav" name="VEVENT"> | |
</comp-filter> | |
</comp-filter> | |
</filter> | |
</calendar-query> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment