parse events

This commit is contained in:
2026-07-31 12:12:15 -07:00
parent 539916aaf8
commit 22815cd523
5 changed files with 38 additions and 16 deletions
+9 -10
View File
@@ -27,7 +27,7 @@ func init_dav_client() {
}
type Event struct {
Link string
CalData string
}
type Calandar struct {
@@ -95,19 +95,18 @@ const XML_cal string = `
xmlns:C="urn:ietf:params:xml:ns:caldav">
<D:prop>
<D:getetag/>
<C:calendar-data/>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT"/>
</C:comp-filter>
</C:filter>
</C:calendar-query>
`
// <C:calendar-data/>
// <C:filter>
// <C:comp-filter name="VCALENDAR">
// <C:comp-filter name="VEVENT"/>
// </C:comp-filter>
// </C:filter>
func get_calandar_data(cal Calandar, username string, password string) Calandar {
req, _ := http.NewRequest(
"REPORT",
@@ -138,7 +137,7 @@ func get_calandar_data(cal Calandar, username string, password string) Calandar
for i := range len(davResp.Responses) {
newEvent := Event{
Link: serverConfig.URL + davResp.Responses[i].Href,
CalData: davResp.Responses[i].PropStat[0].Prop.CalendarData,
}
cal.Events = append(cal.Events, newEvent)
}