Behaviour for CalDAV storage adapters.
Adapters return plain maps so the protocol layer is agnostic of any
particular ORM. A reference Postgres adapter ships in
ExDav.Storage.Postgres.
Adapters are paired with the plug via the :storage opt:
plug ExDav.CalDav.Plug,
storage: ExDav.Storage.Postgres,
authenticator: {ExDav.Authenticator.Basic,
verify: {ExDav.Storage.Postgres, :authenticate}}
Summary
Types
Callbacks
@callback create_calendar(username(), calendar_name(), create_calendar_opts()) :: {:ok, calendar()} | {:error, :no_user | :already_exists | :invalid}
@callback delete_calendar(username(), calendar_name()) :: :ok | {:error, :not_found}
@callback delete_object(username(), calendar_name(), object_name()) :: :ok | {:error, :not_found | :precondition_failed}
@callback get_calendar(username(), calendar_name()) :: calendar() | nil
@callback get_calendar_with_objects(username(), calendar_name()) :: calendar() | nil
@callback get_object(username(), calendar_name(), object_name()) :: object() | nil
@callback put_object(username(), calendar_name(), object_name(), ical :: String.t()) :: {:ok, object()} | {:error, :not_found | :invalid}
@callback sync_changes(username(), calendar_name(), since :: non_neg_integer() | nil) :: {[object()], [object_name()], non_neg_integer()} | {:error, :not_found}
@callback update_calendar(username(), calendar_name(), update_props()) :: {:ok, calendar()} | {:error, :not_found | :invalid}