Documentation ¶
Index ¶
- func Hash(s string) uint64
- func IsSameEvent(a, b Event) bool
- func NewEventID(seed string) string
- func TimeFromConfig(syncTime config.SyncTime) (time.Time, error)
- type Attendee
- type Attendees
- type Calendar
- type Event
- type Metadata
- type Reminder
- type ReminderActions
- type ReminderTrigger
- type Reminders
- type TimeIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSameEvent ¶
This implementation evalutes the differences after event transformation rather than comparing the content versions
func NewEventID ¶
Types ¶
type Event ¶
type Event struct { ICalUID string // RFC5545 iCal UID which is valid across calendaring-systems ID string // a unique ID which is calculated from source event-data. Provides a common ID between original and synced event(s) Title string Description string Location string StartTime time.Time EndTime time.Time AllDay bool Metadata *Metadata Attendees Attendees Reminders Reminders MeetingLink string Accepted bool }
Event describes a calendar event which can be processed in a Controller via Transformer funcs.
TODO: Is Event an interface or a concrete type? @ljarosch: I think for the time being, it is fine going with a struct.
But in the future it might be very handy to create different events (maybe because the source provides more/less capabilities).
func NewSyncEvent ¶
NewSyncEvent derives a new Event from a given source Event. The derived event is as bare as possible, it only contains required metadata and the event times. It can be aggregated by Transformers with additional data if desired.
func (*Event) ShortTitle ¶
ShortTitle returns the title with a capped max length of maxLen. If the title is too long, the string is cut to maxLen and '...' is added
type Metadata ¶
type Metadata struct { // SyncID is a unique ID which links the original event with the synced copy/copies SyncID string `json:"SyncID"` // OriginalEventUri is an URI which points to the original event which was synced. This is usually an URL. OriginalEventUri string `json:"OriginalEventUri"` // SourceID contains the ID of the source which this event was imported from SourceID string `json:"SourceID"` }
Metadata describes the metadata which is added to events read from the source. The data is either calculated from the original event or given in the config file.
func NewEventMetadata ¶
type Reminder ¶
type Reminder struct { Actions ReminderActions Trigger ReminderTrigger }
type ReminderActions ¶
type ReminderActions int
const (
ReminderActionDisplay ReminderActions = iota
)
type ReminderTrigger ¶
type TimeIdentifier ¶
type TimeIdentifier string
const ( MonthStart TimeIdentifier = "MonthStart" MonthEnd TimeIdentifier = "MonthEnd" )