feat: implement caldav search
This commit is contained in:
18
vendor/github.com/dolanor/caldav-go/webdav/entities/error.go
generated
vendored
Normal file
18
vendor/github.com/dolanor/caldav-go/webdav/entities/error.go
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
package entities
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
// a WebDAV error
|
||||
type Error struct {
|
||||
XMLName xml.Name `xml:"DAV: error"`
|
||||
Description string `xml:"error-description,omitempty"`
|
||||
Message string `xml:"message,omitempty"`
|
||||
}
|
||||
|
||||
func (e *Error) Error() string {
|
||||
if e.Description != "" {
|
||||
return e.Description
|
||||
} else {
|
||||
return e.Message
|
||||
}
|
||||
}
|
23
vendor/github.com/dolanor/caldav-go/webdav/entities/multistatus.go
generated
vendored
Normal file
23
vendor/github.com/dolanor/caldav-go/webdav/entities/multistatus.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
package entities
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
// metadata about a property
|
||||
type PropStat struct {
|
||||
XMLName xml.Name `xml:"propstat"`
|
||||
Status string `xml:"status"`
|
||||
Prop *Prop `xml:",omitempty"`
|
||||
}
|
||||
|
||||
// a multistatus response entity
|
||||
type Response struct {
|
||||
XMLName xml.Name `xml:"response"`
|
||||
Href string `xml:"href"`
|
||||
PropStats []*PropStat `xml:"propstat,omitempty"`
|
||||
}
|
||||
|
||||
// a request to find properties on an an entity or collection
|
||||
type Multistatus struct {
|
||||
XMLName xml.Name `xml:"DAV: multistatus"`
|
||||
Responses []*Response `xml:"response,omitempty"`
|
||||
}
|
32
vendor/github.com/dolanor/caldav-go/webdav/entities/prop.go
generated
vendored
Normal file
32
vendor/github.com/dolanor/caldav-go/webdav/entities/prop.go
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
package entities
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
)
|
||||
|
||||
// a property of a resource
|
||||
type Prop struct {
|
||||
XMLName xml.Name `xml:"DAV: prop"`
|
||||
GetContentType string `xml:"getcontenttype,omitempty"`
|
||||
DisplayName string `xml:"displayname,omitempty"`
|
||||
ResourceType *ResourceType `xml:",omitempty"`
|
||||
CTag string `xml:"http://calendarserver.org/ns/ getctag,omitempty"`
|
||||
ETag string `xml:"http://calendarserver.org/ns/ getetag,omitempty"`
|
||||
}
|
||||
|
||||
// the type of a resource
|
||||
type ResourceType struct {
|
||||
XMLName xml.Name `xml:"resourcetype"`
|
||||
Collection *ResourceTypeCollection `xml:",omitempty"`
|
||||
Calendar *ResourceTypeCalendar `xml:",omitempty"`
|
||||
}
|
||||
|
||||
// A calendar resource type
|
||||
type ResourceTypeCalendar struct {
|
||||
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:caldav calendar"`
|
||||
}
|
||||
|
||||
// A collection resource type
|
||||
type ResourceTypeCollection struct {
|
||||
XMLName xml.Name `xml:"collection"`
|
||||
}
|
20
vendor/github.com/dolanor/caldav-go/webdav/entities/propfind.go
generated
vendored
Normal file
20
vendor/github.com/dolanor/caldav-go/webdav/entities/propfind.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
package entities
|
||||
|
||||
import "encoding/xml"
|
||||
|
||||
// a request to find properties on an an entity or collection
|
||||
type Propfind struct {
|
||||
XMLName xml.Name `xml:"DAV: propfind"`
|
||||
AllProp *AllProp `xml:",omitempty"`
|
||||
Props []*Prop `xml:"prop,omitempty"`
|
||||
}
|
||||
|
||||
// a propfind property representing all properties
|
||||
type AllProp struct {
|
||||
XMLName xml.Name `xml:"allprop"`
|
||||
}
|
||||
|
||||
// a convenience method for searching all properties
|
||||
func NewAllPropsFind() *Propfind {
|
||||
return &Propfind{AllProp: new(AllProp)}
|
||||
}
|
Reference in New Issue
Block a user