package irmin-pack

  1. Overview
  2. Docs
Irmin backend which stores values in a pack file

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.3.1.tbz
sha256=535254ca443858bfc9e540535977fed63e9206d4b78c5cac0239d1e6657b5c78
sha512=fa18557fcf808121a0495de707c6f7bff4a69197b310480816648adafd4a659b5673a1f5bbf4574f517b7d93253735ef7798b0c365d87afac60675007ef19b54

doc/src/irmin-pack.unix/pack_store_intf.ml.html

Source file pack_store_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
open! Import

(** A [Pack_store.S] is a closeable, persistent implementation of {!Indexable.S}
    that uses an append-only file of variable-length data blocks.

    Certain values in the data file are indexed by hash via a {!Pack_index.S}
    implementation, but not all of them need be. *)
module type S = sig
  include Irmin_pack.Indexable.S

  type file_manager
  type dict

  val v :
    config:Irmin.Backend.Conf.t -> fm:file_manager -> dict:dict -> read t Lwt.t

  val cast : read t -> read_write t

  (** @inline *)
  include Irmin_pack.S.Checkable with type 'a t := 'a t and type hash := hash

  module Entry_prefix : sig
    type t = {
      hash : hash;
      kind : Pack_value.Kind.t;
      size_of_value_and_length_header : int option;
          (** Remaining bytes in the entry after reading the hash and the kind
              (i.e. the length of the length header + the value of the length
              header), if the entry has a length header (otherwise [None]).

              NOTE: the length stored in the index and in direct pack keys is
              the {!total_entry_length} (including the hash and the kind). *)
    }

    val total_entry_length : t -> int option
  end

  val read_and_decode_entry_prefix : off:int63 -> file_manager -> Entry_prefix.t
  (** Read the entry prefix at offset [off]. *)

  val index_direct_with_kind : 'a t -> hash -> (key * Pack_value.Kind.t) option
  (** Returns the key and the kind of an object indexed by hash. *)
end

module type Sigs = sig
  module type S = S

  module Make
      (Fm : File_manager.S)
      (Dict : Dict.S with module Fm = Fm)
      (Hash : Irmin.Hash.S with type t = Fm.Index.key)
      (Val : Pack_value.Persistent
               with type hash := Hash.t
                and type key := Hash.t Pack_key.t)
      (Errs : Errors.S with module Io = Fm.Io) :
    S
      with type key = Hash.t Pack_key.t
       and type hash = Hash.t
       and type value = Val.t
       and type file_manager = Fm.t
       and type dict = Dict.t
end
OCaml

Innovation. Community. Security.