package conex

  1. Overview
  2. Docs

IO operations

Conex relies on providers to read data from and write data to. Each access consists of a Path used as key. Only basic file types are supported (no symbolic links).

IO provider

type t = {
  1. basedir : string;
  2. description : string;
  3. file_type : Conex_utils.path -> (Conex_utils.file_type, string) result;
  4. read : Conex_utils.path -> (string, string) result;
  5. write : Conex_utils.path -> string -> (unit, string) result;
  6. read_dir : Conex_utils.path -> (Conex_utils.item list, string) result;
  7. exists : Conex_utils.path -> bool;
}

A provider contains its base directory, a description, and read/write/exist functionality. TODO: define this as a module type.

pp t is a pretty printer for t.

Reading of resource files

type r_err = [
  1. | `NotFound of Conex_resource.typ * Conex_resource.name
  2. | `ParseError of Conex_resource.typ * Conex_resource.name * string
  3. | `NameMismatch of Conex_resource.typ * Conex_resource.name * Conex_resource.name
  4. | `InvalidPath of Conex_resource.name * Conex_utils.path
]

The variant of read and parse errors.

val pp_r_err : r_err Conex_utils.fmt

pp_r_err is a pretty printer for r_err.

val read_root : t -> Conex_resource.name -> (Conex_resource.Root.t * string list, [> r_err ]) result
val write_root : t -> Conex_resource.Root.t -> (unit, string) result
val read_targets : t -> Conex_resource.Root.t -> bool -> Conex_resource.identifier -> (Conex_resource.Targets.t * string list, [> r_err ]) result
val write_targets : t -> Conex_resource.Root.t -> Conex_resource.Targets.t -> (unit, string) result
val compute_checksum : ?prefix:Conex_utils.path -> t -> bool -> (string -> Conex_resource.Digest.t) -> Conex_utils.path -> (Conex_resource.Target.t list, string) result
val compute_checksum_tree : ?prefix:Conex_utils.path -> t -> (string -> Conex_resource.Digest.t) -> ((Conex_resource.Digest.t * Conex_utils.Uint.t) Conex_utils.Tree.t, string) result
OCaml

Innovation. Community. Security.