package irmin-client

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

Module Make.BatchSource

The batch API is used to have better control of when data is sent between the client and server when manipulating trees.

Sourcetype store = t
Sourcetype t = (path * [ `Contents of [ `Hash of hash | `Value of contents ] * metadata option | `Tree of Request_tree.t | `Remove ]) list

A batch is list of updates and their associated paths

Sourceval v : unit -> t

val () creates a new batch

Sourceval add_value : path -> ?metadata:metadata -> contents -> t -> t

add_value path ~metadata value batch will add value at path with associated metadata when batch is apply'd

Sourceval add_hash : path -> ?metadata:metadata -> hash -> t -> t

add_hash path ~metadata hash batch will add hash at path with associated metadata when batch is apply'd

Sourceval add_tree : path -> tree -> t -> t Lwt.t

add_tree path batch will add tree at path when batch is apply'd

Note: if tree has been modified locally, calls to the server may be made.

Sourceval remove : path -> t -> t

remove path batch will remove path when batch is apply'd

Sourceval apply : info:Info.f -> ?path:path -> store -> t -> commit_key Lwt.t

apply ~info ~path store batch applies batch to the subtree at path (defaults to the root) in store. The key of the commit is returned.

OCaml

Innovation. Community. Security.