Documentation
¶
Index ¶
- func CapDescription(desc string, maxLen int) string
- func EventToIcal(e *Event) string
- func TaskToIcal(t *Task) string
- type Alarm
- type Calendar
- type Client
- func (c *Client) DeleteEvent(eventHref, etag string) error
- func (c *Client) DeleteTask(taskHref, etag string) error
- func (c *Client) FindEventByUID(uid string) (*EventWithMeta, string, error)
- func (c *Client) FindTaskByUID(uid string) (*TaskWithMeta, string, error)
- func (c *Client) GetEvent(eventHref string) (*EventWithMeta, error)
- func (c *Client) GetTask(taskHref string) (*TaskWithMeta, error)
- func (c *Client) ListCalendars() ([]Calendar, error)
- func (c *Client) ListEvents(calendarHref string) (*EventListResult, error)
- func (c *Client) ListTasks(calendarHref string) (*TaskListResult, error)
- func (c *Client) MkCalendar(href, displayName, description string) error
- func (c *Client) PutEvent(eventHref, icalData, etag string) error
- func (c *Client) PutTask(taskHref, icalData, etag string) error
- type Config
- type Event
- type EventListResult
- type EventMetadata
- type EventWithMeta
- type Task
- type TaskListResult
- type TaskMetadata
- type TaskWithMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CapDescription ¶
CapDescription returns the description capped at maxLen characters.
func EventToIcal ¶
EventToIcal serializes an Event to a full VCALENDAR string.
Types ¶
type Alarm ¶
type Alarm struct {
Trigger string `json:"trigger"`
Action string `json:"action"`
Description string `json:"description,omitempty"`
}
Alarm represents a VALARM component.
type Calendar ¶
type Calendar struct {
Href string `json:"href"`
DisplayName string `json:"display_name"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
ComponentTypes []string `json:"component_types,omitempty"`
}
Calendar represents a CalDAV calendar collection.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a CalDAV HTTP client that supports PROPFIND, REPORT, PUT, DELETE, and MKCALENDAR operations.
func NewClient ¶
NewClient creates a CalDAV client from the given configuration.
func (*Client) DeleteEvent ¶
DeleteEvent removes a VEVENT by href.
func (*Client) DeleteTask ¶
DeleteTask removes a VTODO by href.
func (*Client) FindEventByUID ¶
func (c *Client) FindEventByUID(uid string) (*EventWithMeta, string, error)
FindEventByUID searches all calendars for an event with the given UID. Returns the event with metadata and the calendar href it was found in.
func (*Client) FindTaskByUID ¶
func (c *Client) FindTaskByUID(uid string) (*TaskWithMeta, string, error)
FindTaskByUID searches all calendars for a task with the given UID. Returns the task with metadata and the calendar href it was found in.
func (*Client) GetEvent ¶
func (c *Client) GetEvent(eventHref string) (*EventWithMeta, error)
GetEvent fetches a single VEVENT by its href.
func (*Client) GetTask ¶
func (c *Client) GetTask(taskHref string) (*TaskWithMeta, error)
GetTask fetches a single VTODO by its href.
func (*Client) ListCalendars ¶
ListCalendars performs a PROPFIND to discover all calendar collections.
func (*Client) ListEvents ¶
func (c *Client) ListEvents(calendarHref string) (*EventListResult, error)
ListEvents performs a REPORT calendar-query to list all VEVENTs in a calendar. Parse errors for individual events are collected in EventListResult.ParseErrors rather than causing the entire listing to fail.
func (*Client) ListTasks ¶
func (c *Client) ListTasks(calendarHref string) (*TaskListResult, error)
ListTasks performs a REPORT calendar-query to list all VTODOs in a calendar. Parse errors for individual tasks are collected in TaskListResult.ParseErrors rather than causing the entire listing to fail.
All tasks are returned regardless of STATUS. Server-side filtering via prop-filter is deferred until incremental sync is implemented — the haustoria's status-tags mapping requires completed tasks during checkin. https://github.com/amarbel-llc/dodder/issues/87
func (*Client) MkCalendar ¶
MkCalendar creates a new calendar collection via MKCALENDAR.
func (*Client) PutEvent ¶
PutEvent creates or updates a VEVENT at the given href.
type Config ¶
Config holds CalDAV connection parameters read from environment variables.
type Event ¶
type Event struct {
UID string `json:"uid"`
Summary string `json:"summary"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
Location string `json:"location,omitempty"`
Geo string `json:"geo,omitempty"`
DtStart string `json:"dtstart,omitempty"`
DtStartTZID string `json:"dtstart_tzid,omitempty"`
DtEnd string `json:"dtend,omitempty"`
DtEndTZID string `json:"dtend_tzid,omitempty"`
Duration string `json:"duration,omitempty"`
Organizer string `json:"organizer,omitempty"`
Attendees []string `json:"attendees,omitempty"`
Categories []string `json:"categories,omitempty"`
RRule string `json:"rrule,omitempty"`
RecurrenceID string `json:"recurrence_id,omitempty"`
Sequence int `json:"sequence,omitempty"`
Transp string `json:"transp,omitempty"`
Created string `json:"created,omitempty"`
LastModified string `json:"last_modified,omitempty"`
// Derived fields
Alarms []Alarm `json:"alarms,omitempty"`
HasDescription bool `json:"has_description"`
DescriptionTokens int `json:"description_tokens"`
// Server metadata
Href string `json:"href,omitempty"`
ETag string `json:"etag,omitempty"`
}
Event is the structured representation of a VEVENT component.
func ParseVEVENT ¶
ParseVEVENT parses a raw iCalendar string and extracts the first VEVENT as an Event.
func (*Event) ToMetadata ¶
func (e *Event) ToMetadata() EventMetadata
ToMetadata converts a full Event to its lightweight metadata representation.
type EventListResult ¶
type EventListResult struct {
Events []EventWithMeta
ParseErrors []string
}
EventListResult holds the results of listing events, including any parse errors for individual events that could not be parsed.
type EventMetadata ¶
type EventMetadata struct {
UID string `json:"uid"`
Summary string `json:"summary"`
Status string `json:"status,omitempty"`
DtStart string `json:"dtstart,omitempty"`
DtEnd string `json:"dtend,omitempty"`
Location string `json:"location,omitempty"`
Categories []string `json:"categories,omitempty"`
RRule string `json:"rrule,omitempty"`
HasDescription bool `json:"has_description"`
DescriptionTokens int `json:"description_tokens"`
}
EventMetadata is the lightweight tier-1 view of an event.
type EventWithMeta ¶
EventWithMeta pairs a parsed Event with its raw iCalendar text.
type Task ¶
type Task struct {
UID string `json:"uid"`
Summary string `json:"summary"`
Description string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
Priority int `json:"priority,omitempty"`
Due string `json:"due,omitempty"`
DueTZID string `json:"due_tzid,omitempty"`
DtStart string `json:"dtstart,omitempty"`
DtStartTZID string `json:"dtstart_tzid,omitempty"`
Completed string `json:"completed,omitempty"`
Created string `json:"created,omitempty"`
LastModified string `json:"last_modified,omitempty"`
Categories []string `json:"categories,omitempty"`
PercentComplete int `json:"percent_complete,omitempty"`
ParentUID string `json:"parent_uid,omitempty"`
RecurrenceID string `json:"recurrence_id,omitempty"`
RRule string `json:"rrule,omitempty"`
Location string `json:"location,omitempty"`
Geo string `json:"geo,omitempty"`
SortOrder int `json:"sort_order,omitempty"`
Sequence int `json:"sequence,omitempty"`
Attachments []string `json:"attachments,omitempty"`
StructuredLocation string `json:"structured_location,omitempty"`
// Derived fields
SubtaskUIDs []string `json:"subtask_uids,omitempty"`
Alarms []Alarm `json:"alarms,omitempty"`
HasDescription bool `json:"has_description"`
DescriptionTokens int `json:"description_tokens"`
// Server metadata
Href string `json:"href,omitempty"`
ETag string `json:"etag,omitempty"`
}
Task is the structured representation of a VTODO component, covering all fields that tasks.org uses.
func ParseVTODO ¶
ParseVTODO parses a raw iCalendar string and extracts the first VTODO as a Task. For recurring tasks (RRULE), a single .ics resource may contain multiple VTODO components: a master plus overrides with RECURRENCE-ID. This function returns only the first (master) VTODO. Override components are not extracted because dodder maps each CalDAV resource to one zettel — the recurring pattern is the conceptual unit, not individual instances.
func (*Task) ToMetadata ¶
func (t *Task) ToMetadata() TaskMetadata
ToMetadata converts a full Task to its lightweight metadata representation.
type TaskListResult ¶
type TaskListResult struct {
Tasks []TaskWithMeta
ParseErrors []string
}
TaskListResult holds the results of listing tasks, including any parse errors for individual tasks that could not be parsed.
type TaskMetadata ¶
type TaskMetadata struct {
UID string `json:"uid"`
Summary string `json:"summary"`
Status string `json:"status,omitempty"`
Priority int `json:"priority,omitempty"`
Due string `json:"due,omitempty"`
Categories []string `json:"categories,omitempty"`
RRule string `json:"rrule,omitempty"`
HasDescription bool `json:"has_description"`
DescriptionTokens int `json:"description_tokens"`
ParentUID string `json:"parent_uid,omitempty"`
AttachmentCount int `json:"attachment_count,omitempty"`
Location string `json:"location,omitempty"`
}
TaskMetadata is the lightweight tier-1 view of a task.
Source Files
¶
- auth.go
- client.go
- event.go
- parser.go