Documentation
¶
Index ¶
- Variables
- func NormalizeURL(raw string) (*url.URL, error)
- type CardEmail
- type CardPhoto
- type Client
- func (c *Client) Discover(ctx context.Context, start *url.URL, creds Credentials) (string, []DiscoveredCollection, error)
- func (c *Client) FetchCards(ctx context.Context, home *url.URL, colHref string, hrefs []string, ...) ([]FetchedCard, error)
- func (c *Client) ListCollectionETags(ctx context.Context, home *url.URL, colHref string, creds Credentials) (map[string]string, string, string, error)
- func (c *Client) ListCollections(ctx context.Context, home *url.URL, creds Credentials, countCards bool) ([]DiscoveredCollection, error)
- func (c *Client) SyncCollection(ctx context.Context, home *url.URL, colHref, syncToken string, ...) (SyncDelta, error)
- type Credentials
- type DiscoveredCollection
- type FetchedCard
- type ParsedCard
- type SyncDelta
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidURL = errors.New("invalid CardDAV server URL") ErrScheme = errors.New("CardDAV server URL must use https") ErrUntrustedOrigin = errors.New("CardDAV discovery target outside server domain") ErrAuthFailed = errors.New("CardDAV authentication failed") ErrNoAddressBooks = errors.New("no CardDAV address books found") ErrSyncTokenInvalid = errors.New("CardDAV sync-token expired or unsupported") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(transport http.RoundTripper) *Client
func (*Client) Discover ¶
func (c *Client) Discover(ctx context.Context, start *url.URL, creds Credentials) (string, []DiscoveredCollection, error)
Discover resolves an addressbook-home-set URL and its addressbook collections following RFC 6764 (/.well-known/carddav) and RFC 6352 (principal -> home-set).
func (*Client) FetchCards ¶
func (c *Client) FetchCards(ctx context.Context, home *url.URL, colHref string, hrefs []string, creds Credentials) ([]FetchedCard, error)
FetchCards downloads vCard payloads for hrefs in batches via card:addressbook-multiget REPORT.
func (*Client) ListCollectionETags ¶
func (c *Client) ListCollectionETags(ctx context.Context, home *url.URL, colHref string, creds Credentials) (map[string]string, string, string, error)
ListCollectionETags lists every member vCard href -> ETag in colHref via PROPFIND Depth: 1.
func (*Client) ListCollections ¶
func (c *Client) ListCollections(ctx context.Context, home *url.URL, creds Credentials, countCards bool) ([]DiscoveredCollection, error)
ListCollections lists all card:addressbook collections under home (or home itself if it is one).
func (*Client) SyncCollection ¶
func (c *Client) SyncCollection(ctx context.Context, home *url.URL, colHref, syncToken string, creds Credentials) (SyncDelta, error)
SyncCollection queries incremental changes since syncToken via RFC 6578 sync-collection REPORT. Returns ErrSyncTokenInvalid when the token is expired or the server does not support sync-collection.
type Credentials ¶
type DiscoveredCollection ¶
type FetchedCard ¶
type ParsedCard ¶
ParsedCard holds the subset of vCard 3.0 / 4.0 fields Godwit caches (ADR 0040).
func ParseVCard ¶
func ParseVCard(raw string) ParsedCard
ParseVCard extracts FN (falling back to ORG when blank), ORG, TITLE, EMAIL (with TYPE=PREF and PREF=1..100), and PHOTO from a vCard 3.0 or 4.0 payload.