parse events
This commit is contained in:
+9
-10
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user