Irmin_mirage_git.KV_RW
include Mirage_kv.RW
val pp_error : error Fmt.t
val disconnect : t -> unit Lwt.t
val pp_write_error : write_error Fmt.t
val allocate :
t ->
key ->
?last_modified:Ptime.t ->
Optint.Int63.t ->
(unit, write_error) Stdlib.result Lwt.t
val set : t -> key -> string -> (unit, write_error) Stdlib.result Lwt.t
val set_partial :
t ->
key ->
offset:Optint.Int63.t ->
string ->
(unit, write_error) Stdlib.result Lwt.t
val remove : t -> key -> (unit, write_error) Stdlib.result Lwt.t
val rename :
t ->
source:key ->
dest:key ->
(unit, write_error) Stdlib.result Lwt.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
).
val connect :
?depth:int ->
?branch:string ->
?root:key ->
?ctx:Mimic.ctx ->
?headers:(string * string) list ->
?author:(unit -> string) ->
?msg:([ `Set of key | `Remove of key | `Batch ] -> string) ->
git ->
string ->
t Lwt.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.