Up

module Pack

: sig

Pack files.

#
type t = (SHA.t * Packed_value.PIC.t) list

A pack value is an ordered list of position-independant packed values and the SHA of the corresponding inflated objects.

include Object.S with type t := t
#
val input : Mstruct.t -> index:Pack_index.t option -> t

The usual Object.S.input function, but with an additional index argument. When index is None, recompute the whole index: that's very costly so provide the index when possible.

#
val keys : t -> SHA.Set.t

Return the keys present in the pack.

#
val read : t -> SHA.t -> Value.t option

Return the value stored in the pack file.

#
val read_exn : t -> SHA.t -> Value.t

Return the value stored in the pack file.

#
val unpack : write:(Value.t -> SHA.t Lwt.t) -> Cstruct.t -> SHA.Set.t Lwt.t

Unpack a whole pack file. write should returns the SHA of the marshaled value. Return the IDs of the written objects.

#
val pack : (SHA.t * Value.t) list -> t

Create a (compressed) pack file.

#
module Raw : sig

Raw pack file: they contains a pack index and a list of position-dependant deltas.

include Object.S
#
val input : Mstruct.t -> index:Pack_index.t option -> t

Same as the top-level input function but for raw packs.

#
val sha1 : t -> SHA.t

Return the name of the pack.

#
val index : t -> Pack_index.t

Return the pack index.

#
val keys : t -> SHA.Set.t

Return the keys present in the raw pack.

end
#
val to_pic : Raw.t -> t

Transform a raw pack file into a position-independant pack file.

#
val of_pic : t -> Raw.t

Transform a position-independant pack file into a raw one.

end