Documentation
¶
Index ¶
- func DecodeCalendar(icsData []byte) (*goical.Calendar, error)
- func EncodeCalendar(cal *goical.Calendar) ([]byte, error)
- func NewCalendar() *goical.Calendar
- func ValidateEvent(rawIcalData []byte) error
- func ValidateUID(uid string) error
- type Calendar
- type ComparisonResult
- type Component
- type Event
- type Prop
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCalendar ¶
DecodeCalendar parses iCalendar data into a Calendar object
func EncodeCalendar ¶
EncodeCalendar encodes a Calendar object to bytes
func ValidateEvent ¶
TestEventDecodeAndEncode attempts to decode and re-encode the event to validate that it can be properly stored without errors
func ValidateUID ¶
ValidateUID validates that a UID contains only valid characters and is within length limits. Common restrictions: - Maximum length of 255 characters (common CalDAV limitation) - Should contain only printable ASCII characters - Should not contain control characters or line breaks
Types ¶
type ComparisonResult ¶
type ComparisonResult int
ComparisonResult indicates the result of comparing two calendar events
const ( // FirstEventNewer indicates the first event is newer than the second FirstEventNewer ComparisonResult = 1 // SecondEventNewer indicates the second event is newer than the first SecondEventNewer ComparisonResult = -1 // EventsEqual indicates the events have the same recency EventsEqual ComparisonResult = 0 )
func CompareEvents ¶
func CompareEvents(event1, event2 *Event) (ComparisonResult, error)
CompareEvents compares two calendar events to determine which one is more recent and should take precedence. The comparison is based on: 1. Sequence number (higher wins) 2. DTSTAMP (more recent wins) if sequence numbers are equal
Returns:
- FirstEventNewer (1) if event1 should take precedence
- SecondEventNewer (-1) if event2 should take precedence
- EventsEqual (0) if they have equal precedence
type Event ¶
type Event struct {
UID string
RawData []byte // Raw iCalendar data
Summary string
Start time.Time
End time.Time
Location string
Organizer string
Description string
Method string // Calendar method (REQUEST, REPLY, CANCEL, etc.)
Sequence int // Sequence number for event updates
}
Event represents calendar event information
func ParseCalendarData ¶
ParseCalendarData parses calendar data from an email MIME part
func ParseCalendarReader ¶
ParseCalendarReader parses calendar data from an io.Reader with optional encoding
func ParseICalData ¶
ParseICalData parses iCalendar data and extracts basic event information
func (*Event) IsRecurringUpdate ¶
IsRecurringUpdate checks if an event is a recurring event update