123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162(*
* Copyright (c) 2013-2022 Thomas Gazagnaire <thomas@gazagnaire.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)moduletypeS=sigincludeIrmin_git.SwithtypeBackend.Remote.endpoint=Mimic.ctx*Smart_git.Endpoint.tvalremote:?ctx:Mimic.ctx->?headers:(string*string)list->string->Irmin.remoteendmoduletypeMaker=sigmoduleG:Irmin_git.Gtypeendpoint=Mimic.ctx*Smart_git.Endpoint.tmoduleMake(Schema:Irmin_git.Schema.SwithtypeHash.t=G.hashwithtypeNode.t=G.Value.Tree.tandtypeCommit.t=G.Value.Commit.t):SwithmoduleGit=GandtypeBackend.Remote.endpoint=endpointandmoduleSchema:=SchemaendmoduletypeKV_maker=sigmoduleG:Irmin_git.Gtypeendpoint=Mimic.ctx*Smart_git.Endpoint.ttypebranchmoduleMake(C:Irmin.Contents.S):SwithmoduleGit=GandtypeSchema.Contents.t=C.tandmoduleSchema.Metadata=Irmin_git.MetadataandtypeSchema.Info.t=Irmin.Info.defaultandtypeSchema.Path.step=stringandtypeSchema.Path.t=stringlistandtypeSchema.Hash.t=G.hashandtypeSchema.Branch.t=branchandtypeBackend.Remote.endpoint=endpointendmoduletypeKV_RO=sigtypegitincludeMirage_kv.ROvalconnect:?depth:int->?branch:string->?root:key->?ctx:Mimic.ctx->?headers:(string*string)list->git->string->tLwt.t(** [connect ?depth ?branch ?path g uri] clones the given [uri] into [g]
repository, using the given [branch], [depth] and ['/']-separated
sub-[path]. By default, [branch] is main, [depth] is [1] and [path] is
empty, ie. reads will be relative to the root of the repository. *)endmoduletypeKV_RW=sigtypegitincludeMirage_kv.RWvalbatch:t->?retries:int->(t->'aLwt.t)->'aLwt.t(** [batch t f] run [f] in batch. Ensure the durability of operations.
Since a batch is applied at once, the readings inside a batch will return
the state before the entire batch. Concurrent operations will not affect
other ones executed during the batch.
Batch applications can fail to apply if other operations are happening
concurrently. In case of failure, [f] will run again with the most recent
version of [t]. The result is [Error `Too_many_retries] if [f] is run for
more then [retries] attemps (default is [42]). *)valconnect:?depth:int->?branch:string->?root:key->?ctx:Mimic.ctx->?headers:(string*string)list->?author:(unit->string)->?msg:([`Setofkey|`Removeofkey|`Batch]->string)->git->string->tLwt.t(** [connect ?depth ?branch ?path ?author ?msg g c uri] clones the given [uri]
into [g] repository, using the given [branch], [depth] and ['/']-separated
sub-[path]. By default, [branch] is main, [depth] is [1] and [path] is
empty, ie. reads will be relative to the root of the repository. [author],
[msg] and [c] are used to create new commit info values on every update.
By defaut [author] is [fun () -> "irmin" <irmin@mirage.io>] and [msg]
returns basic information about the kind of operations performed. *)endmoduletypeSigs=sigmoduletypeS=SmoduletypeMaker=MakermoduletypeKV_maker=KV_makermoduletypeKV_RO=KV_ROmoduletypeKV_RW=KV_RWmoduleMaker(G:Irmin_git.G):MakerwithmoduleG:=GmoduleKV(G:Irmin_git.G):KV_makerwithtypebranch=stringandmoduleG:=GmoduleRef(G:Irmin_git.G):KV_makerwithtypebranch=Irmin_git.referenceandmoduleG:=G(** Functor to create a MirageOS' KV_RO store from a Git repository. The key
["/HEAD"] always shows the current HEAD. *)moduleKV_RO(G:Irmin_git.G):KV_ROwithtypegit:=G.t(** Functor to create a MirageOS' KV_RW store from a Git repository. *)moduleKV_RW(G:Irmin_git.G)(C:Mirage_clock.PCLOCK):KV_RWwithtypegit:=G.t(** Embed an Irmin store into an in-memory Git repository. *)moduleMem:sigmoduleG:Irmin_git.Gtypeendpoint=Mimic.ctx*Smart_git.Endpoint.tmoduleMake(Schema:Irmin_git.Schema.SwithtypeHash.t=G.hashandtypeNode.t=G.Value.Tree.tandtypeCommit.t=G.Value.Commit.t):SwithmoduleGit=GandtypeBackend.Remote.endpoint=endpointandmoduleSchema:=SchemamoduleRef:KV_makerwithtypebranch=Irmin_git.referencemoduleKV:KV_makerwithtypebranch=stringmoduleKV_RO:KV_ROwithtypegit:=G.tmoduleKV_RW(C:Mirage_clock.PCLOCK):KV_RWwithtypegit:=G.tendend