Documentation ¶
Overview ¶
Package carddav provides a client and server CardDAV implementation.
CardDAV is defined in RFC 6352.
Index ¶
- func Discover(domain string) (string, error)
- type AddressBook
- type AddressBookMultiGet
- type AddressBookQuery
- type AddressDataRequest
- type AddressDataType
- type AddressObject
- type Backend
- type Client
- func (c *Client) FindAddressBookHomeSet(principal string) (string, error)
- func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, error)
- func (c *Client) GetAddressObject(path string) (*AddressObject, error)
- func (c *Client) HasSupport() error
- func (c *Client) MultiGetAddressBook(path string, multiGet *AddressBookMultiGet) ([]AddressObject, error)
- func (c *Client) PutAddressObject(path string, card vcard.Card) (*AddressObject, error)
- func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) ([]AddressObject, error)
- func (c *Client) SyncCollection(path string, query *SyncQuery) (*SyncResponse, error)
- type FilterTest
- type Handler
- type MatchType
- type ParamFilter
- type PropFilter
- type SyncQuery
- type SyncResponse
- type TextMatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressBook ¶
type AddressBook struct { Path string Name string Description string MaxResourceSize int64 SupportedAddressData []AddressDataType }
func (*AddressBook) SupportsAddressData ¶ added in v0.3.0
func (ab *AddressBook) SupportsAddressData(contentType, version string) bool
type AddressBookMultiGet ¶ added in v0.2.0
type AddressBookMultiGet struct { Paths []string DataRequest AddressDataRequest }
type AddressBookQuery ¶ added in v0.2.0
type AddressBookQuery struct { DataRequest AddressDataRequest PropFilters []PropFilter FilterTest FilterTest // defaults to FilterAnyOf Limit int // <= 0 means unlimited }
type AddressDataRequest ¶ added in v0.2.0
type AddressDataType ¶ added in v0.3.0
type AddressObject ¶
type Backend ¶ added in v0.2.0
type Backend interface { AddressBook() (*AddressBook, error) GetAddressObject(path string, req *AddressDataRequest) (*AddressObject, error) ListAddressObjects(req *AddressDataRequest) ([]AddressObject, error) QueryAddressObjects(query *AddressBookQuery) ([]AddressObject, error) PutAddressObject(path string, card vcard.Card) (loc string, err error) DeleteAddressObject(path string) error }
Backend is a CardDAV server backend.
type Client ¶ added in v0.2.0
type Client struct { *webdav.Client // contains filtered or unexported fields }
Client provides access to a remote CardDAV server.
func (*Client) FindAddressBookHomeSet ¶ added in v0.2.0
func (*Client) FindAddressBooks ¶ added in v0.2.0
func (c *Client) FindAddressBooks(addressBookHomeSet string) ([]AddressBook, error)
func (*Client) GetAddressObject ¶ added in v0.3.0
func (c *Client) GetAddressObject(path string) (*AddressObject, error)
func (*Client) HasSupport ¶ added in v0.3.0
func (*Client) MultiGetAddressBook ¶ added in v0.2.0
func (c *Client) MultiGetAddressBook(path string, multiGet *AddressBookMultiGet) ([]AddressObject, error)
func (*Client) PutAddressObject ¶ added in v0.3.0
func (c *Client) PutAddressObject(path string, card vcard.Card) (*AddressObject, error)
func (*Client) QueryAddressBook ¶ added in v0.2.0
func (c *Client) QueryAddressBook(addressBook string, query *AddressBookQuery) ([]AddressObject, error)
func (*Client) SyncCollection ¶ added in v0.3.1
func (c *Client) SyncCollection(path string, query *SyncQuery) (*SyncResponse, error)
SyncCollection do a sync-collection operation on resource(path), it returns a SyncResponse
type FilterTest ¶ added in v0.2.0
type FilterTest string
const ( FilterAnyOf FilterTest = "anyof" FilterAllOf FilterTest = "allof" )
type Handler ¶
type Handler struct {
Backend Backend
}
Handler handles CardDAV HTTP requests. It can be used to create a CardDAV server.
type ParamFilter ¶ added in v0.2.0
type PropFilter ¶ added in v0.2.0
type PropFilter struct { Name string Test FilterTest // defaults to FilterAnyOf // if IsNotDefined is set, TextMatches and Params need to be unset IsNotDefined bool TextMatches []TextMatch Params []ParamFilter }
type SyncQuery ¶ added in v0.3.1
type SyncQuery struct { DataRequest AddressDataRequest SyncToken string Limit int // <= 0 means unlimited }
SyncQuery is the query struct represents a sync-collection request
type SyncResponse ¶ added in v0.3.1
type SyncResponse struct { SyncToken string Updated []AddressObject Deleted []string }
SyncResponse contains the returned sync-token for next time
Click to show internal directories.
Click to hide internal directories.