Module Carddavz.Store

File-backed address book store using Eio.

Stores vCards as individual .vcf files in a directory hierarchy:

/addressbooks/<name>/*.vcf

Implements Webdavz.STORE for use with the WebDAV handler.

type t

The file-backed store.

val create : Eio.Fs.dir_ty Eio.Path.t -> t

create root creates a store rooted at root. The directory should already exist.

STORE Implementation

include Webdavz.STORE with type t := t
val is_collection : t -> path:string -> bool

is_collection store ~path returns true if path is a collection (directory).

val exists : t -> path:string -> bool

exists store ~path returns true if path exists as any resource type.

val get_properties : t -> path:string -> ((string * string) * Webdavz__.Webdavz_xml.tree list) list

get_properties store ~path returns all properties for the resource. Called by PROPFIND handlers.

val read : t -> path:string -> string option

read store ~path returns the resource content, or None if the resource doesn't exist or is a collection.

val children : t -> path:string -> string list

children store ~path returns the names of immediate children of a collection. Returns [] for non-collections.

val write : t -> path:string -> content_type:string -> string -> unit

write store ~path ~content_type data creates or overwrites a non-collection resource.

val delete : t -> path:string -> bool

delete store ~path removes a resource (or collection with contents). Returns true on success, false if the resource doesn't exist.

val mkdir : t -> path:string -> unit

mkdir store ~path creates a collection.