summaryrefslogtreecommitdiff
path: root/pim/lib/cal/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'pim/lib/cal/backend.go')
-rw-r--r--pim/lib/cal/backend.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/pim/lib/cal/backend.go b/pim/lib/cal/backend.go
index 6ed488c..91f793a 100644
--- a/pim/lib/cal/backend.go
+++ b/pim/lib/cal/backend.go
@@ -1,6 +1,10 @@
package cal
-import "time"
+import (
+ "time"
+
+ "github.com/emersion/go-ical"
+)
// A Backend supplies a calendar's events and, where the protocol allows
// it, accepts changes back.
@@ -49,6 +53,17 @@ type Identity interface {
Me() []string
}
+// Creator is implemented by a backend that can add an event.
+//
+// It takes a whole object rather than fields, because that is what the
+// protocols underneath take: CalDAV PUTs an entire icalendar object and
+// JMAP patches a whole JSCalendar one. Building an event field by field
+// and hoping the server knows when you have finished is a shape that
+// fits neither.
+type Creator interface {
+ Create(c *ical.Calendar) error
+}
+
// RSVPer is implemented by a backend that can answer an invitation.
//
// Accepting is two writes: update your own copy, and tell the organiser.