package irmin

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

The default Sync implementation.

Parameters

module S : S

Signature

Native Synchronization

type db = S.t

Type type for store handles.

type commit_id = S.commit_id

The type for store heads.

val fetch : db -> ?depth:int -> remote -> [ `Head of commit_id | `No_head | `Error ] Lwt.t

fetch t ?depth r populate the local store t with objects for the remote store r, using t's current branch. The depth parameter limits the history depth. Return None if either the local or remote store do not have a valid head.

val fetch_exn : db -> ?depth:int -> remote -> commit_id Lwt.t

Same as fetch but raise Invalid_argument if either the local or remote store do not have a valid head.

val pull : db -> ?depth:int -> remote -> [ `Merge | `Update ] -> [ `Ok | `No_head | `Error ] Merge.result Lwt.t

pull t ?depth r s is similar to fetch but it also updates t's current branch. s is the update strategy:

  • `Merge uses S.merge_head. This strategy can return a conflict.
  • `Update uses S.update_head.
val pull_exn : db -> ?depth:int -> remote -> [ `Merge | `Update ] -> unit Lwt.t

Same as pull but raise Merge.Conflict in case of conflict.

val push : db -> ?depth:int -> remote -> [ `Ok | `Error ] Lwt.t

push t ?depth r populates the remote store r with objects from the current store t, using t's current branch. If b is t's current branch, push also updates the head of b in r to be the same as in t.

Note: Git semantics is to update b only if the new head if more recent. This is not the case in Irmin.

val push_exn : db -> ?depth:int -> remote -> unit Lwt.t

Same as push but raise Invalid_argument if an error happens.

OCaml

Innovation. Community. Security.