Command-line and Emacs Calendar Client
1(** Functions for managing calendar directories with strings of .ics files *)
2
3type t
4(** A directory of strings, where each calendar_name is a subdirectory
5 containing .ics files *)
6
7val create :
8 fs:Eio.Fs.dir_ty Eio.Path.t -> string -> (t, [> `Msg of string ]) result
9(** Create a calendar_dir from a directory path. Returns Ok with the
10 calendar_dir if successful, or Error with a message if the directory cannot
11 be created or accessed. *)
12
13val list_calendar_names :
14 fs:Eio.Fs.dir_ty Eio.Path.t -> t -> (string list, [> `Msg of string ]) result
15(** List available strings in the calendar_dir. Returns Ok with the list of
16 string names if successful, or Error with a message if the directory cannot
17 be read. *)
18
19val get_calendar_events :
20 fs:Eio.Fs.dir_ty Eio.Path.t ->
21 t ->
22 string ->
23 (Event.t list, [> `Msg of string | `Not_found ]) result
24(** Get all calendar files in a string. If the calendar_name doesn't exist in
25 the cache, it will be loaded from disk. *)
26
27val get_events :
28 fs:Eio.Fs.dir_ty Eio.Path.t -> t -> (Event.t list, [> `Msg of string ]) result
29(** Get all events in all calendar_names. This will load any strings that
30 haven't been loaded yet. *)
31
32val add_event :
33 fs:Eio.Fs.dir_ty Eio.Path.t ->
34 t ->
35 Event.t ->
36 (unit, [> `Msg of string ]) result
37
38val edit_event :
39 fs:Eio.Fs.dir_ty Eio.Path.t ->
40 t ->
41 Event.t ->
42 (unit, [> `Msg of string ]) result
43
44val delete_event :
45 fs:Eio.Fs.dir_ty Eio.Path.t ->
46 t ->
47 Event.t ->
48 (unit, [> `Msg of string ]) result
49
50val get_path : t -> string