go-webdav/carddav/carddav.go

82 lines
1.4 KiB
Go
Raw Normal View History

2020-01-21 20:01:18 +00:00
// Package carddav provides a client and server CardDAV implementation.
//
// CardDAV is defined in RFC 6352.
2020-01-14 21:19:54 +00:00
package carddav
2020-01-14 22:13:23 +00:00
import (
"time"
2020-01-14 22:44:21 +00:00
"github.com/emersion/go-vcard"
2020-01-14 22:13:23 +00:00
)
type AddressBook struct {
Path string
Name string
Description string
MaxResourceSize int64
2020-01-14 22:13:23 +00:00
}
type AddressBookQuery struct {
Props []string
AllProp bool
2020-01-24 10:25:58 +00:00
PropFilters []PropFilter
FilterTest FilterTest // defaults to FilterAnyOf
Limit int // <= 0 means unlimited
2020-01-14 22:44:21 +00:00
}
2020-01-24 10:25:58 +00:00
type PropFilter struct {
Name string
Test FilterTest // defaults to FilterAnyOf
2020-01-24 10:25:58 +00:00
// if IsNotDefined is set, TextMatches and Params need to be unset
IsNotDefined bool
TextMatches []TextMatch
Params []ParamFilter
}
type ParamFilter struct {
Name string
// if IsNotDefined is set, TextMatch needs to be unset
IsNotDefined bool
TextMatch *TextMatch
}
type TextMatch struct {
Text string
NegateCondition bool
MatchType MatchType // defaults to MatchContains
}
type FilterTest string
const (
FilterAnyOf FilterTest = "anyof"
FilterAllOf FilterTest = "allof"
)
type MatchType string
const (
MatchEquals MatchType = "equals"
MatchContains MatchType = "contains"
MatchStartsWith MatchType = "starts-with"
MatchEndsWith MatchType = "ends-with"
)
type AddressBookMultiGet struct {
Paths []string
Props []string
AllProp bool
}
type AddressObject struct {
Path string
ModTime time.Time
ETag string
Card vcard.Card
2020-01-14 22:13:23 +00:00
}