package irmin

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Private contents.

include Irmin.AO with type value = value

Append-only stores

include Irmin.RO with type value = value

Read-only stores

type t

Type for stores.

type key

Type for keys.

type value = value

Type for values.

val read : t -> key -> value option Lwt.t

Read a value from the store.

val read_exn : t -> key -> value Lwt.t

Same as read but raise Invalid_argument if the key does not exist.

val mem : t -> key -> bool Lwt.t

Check if a key exists.

val iter : t -> (key -> value Lwt.t -> unit Lwt.t) -> unit Lwt.t

iter t fn call the function fn on all t's keys and values.

val add : t -> value -> key Lwt.t

Write the contents of a value to the store. It's the responsibility of the append-only store to generate a consistent key.

module Path = Key

The type for store paths.

val merge : Path.t -> t -> key option Irmin.Merge.t

merge t lifts the merge functions defined on contents values to contents key. The merge function will: (i) read the values associated with the given keys, (ii) use the merge function defined on values and (iii) write the resulting values into the store to get the resulting key. See Contents.S.merge.

If any of these operations fail, return `Conflict.

module Key : Irmin.Hash.S with type t = key

Key provides base functions for user-defined contents keys.

module Val : Irmin.Contents.S with type t = value and module Path = Path

Val provides base functions for user-defined contents values.

OCaml

Innovation. Community. Security.