package octez-internal-libs

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

Module Irmin.ContentsSource

Contents specifies how user-defined contents need to be serializable and mergeable.

The user needs to provide:

  • a type t to be used as store contents.
  • a value type for t (built using the Irmin.Type combinators).
  • a 3-way merge function, to handle conflicts between multiple versions of the same contents.

Default implementations for idempotent string and JSON contents are provided.

Values.

Sourcemodule type S = sig ... end
Sourcemodule String : S with type t = string

Contents of type string, with the default 3-way merge strategy: assume that update operations are idempotent and conflict iff values are modified concurrently.

Sourcemodule String_v2 : S with type t = string

Similar to String above, but the hash computation is compatible with versions older than irmin.3.0

Sourcetype json = [
  1. | `Null
  2. | `Bool of bool
  3. | `String of string
  4. | `Float of float
  5. | `O of (string * json) list
  6. | `A of json list
]
Sourcemodule Json : S with type t = (string * json) list

Json contents are associations from strings to json values stored as JSON encoded strings. If the same JSON key has been modified concurrently with different values then the merge function conflicts.

Sourcemodule Json_value : S with type t = json

Json_value allows any kind of json value to be stored, not only objects.

Sourcemodule V1 : sig ... end
Sourcemodule type Store = sig ... end

Contents store.

Sourcemodule Store (S : Content_addressable.S) (H : Hash.S with type t = S.key) (C : S with type t = S.value) : Store with type 'a t = 'a S.t and type key = H.t and type hash = H.t and type value = C.t

Store creates a contents store.

Sourcemodule Store_indexable (S : Indexable.S) (H : Hash.S with type t = S.hash) (C : S with type t = S.value) : Store with type 'a t = 'a S.t and type key = S.key and type value = S.value and type hash = S.hash

Store_indexable is like Store but uses an indexable store as a backend (rather than a content-addressable one).

OCaml

Innovation. Community. Security.