package git

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

Module Pack.StreamSource

Parameters

module Hash : sig ... end
module Deflate : sig ... end

Signature

include P with module Hash := Hash with module Deflate := Deflate
Sourcemodule Entry : ENTRY with module Hash := Hash
Sourcemodule Delta : DELTA with module Hash := Hash and module Entry := Entry
Sourcemodule Hunk : H with module Hash := Hash

The Map tree zhich zill represent the IDX file of the PACK stream.

Sourcetype error =
  1. | Deflate_error of Deflate.error
    (*

    Appears when the deflate algorithm raises an error.

    *)
  2. | Invalid_hash of Hash.t
    (*

    Appears when the hash requested does not exist.

    *)

The type error.

Sourceval pp_error : error Fmt.t

Pretty-printer for error.

Sourcetype t

The type of the encoder.

Sourceval used_out : t -> int

used_out ŧ returns how many byte t wrote in the current buffer noticed to the previous call of eval.

Sourceval used_in : t -> int

used_in ŧ returns how many byte t consumed in the current buffer noticed to the previous call of eval.

Sourceval flush : int -> int -> t -> t

flush off len t provides t with len bytes to write, starting at off. This byte range is written by calls to eval with t until `Flush is returned.

Sourceval refill : int -> int -> t -> t

refill off len t provides a new t with len bytes to read, starting at off. This byte range is read by calls to eval with t until `Await is returned. The client should fill by the expect git object.

Sourceval finish : t -> t

finish t provides a new t which terminate to serialize the current Git object. The next call of eval should not return an `Await value unless the output space is enough to start to serialize the next entry.

Sourceval expect : t -> Hash.t

expect t returns the object expected to the serialization. At this time, the serializer requests the inflated raw of this git object. The client is able to use it only when eval return `Await. The encoder does not wqnt the ownership of the inflated raw, it access on it only as a read-only flow (that means, the src Cstruct.t could be physicaly the same.

Sourceval idx : t -> (Checkseum.Crc32.t * int64) Hash.Map.t

idx t returns a Map tree which contains the CRC-32 checksum and the absolute offset for each Git object serialized. The client is able to use it only when eval returns `End.

Sourceval default : Cstruct.t -> (Entry.t * Delta.t) list -> t

Make a new encoder t of the PACK stream.

tmp is a Cstruct.t used as an internal output of the Hunk Encoder H. We let the user to allocate the optimized length for this temporary buffer and we take the ownership (so, you don't use it to another computer).

Then, the client need to notice the ordered list of what he wants to serialize.

Sourceval eval : Cstruct.t -> Cstruct.t -> t -> [ `Flush of t | `Await of t | `End of t * Hash.t | `Error of t * error ]

eval src t is:

  • `Await t iff t needs more input storage. The client must use refill to provide a new buffer and then call eval with `Await until other value returned.
  • `Flush t iff t needs more output storage. The client must use flush to provide a new buffer and then call eval with `Flush until other value returned.
  • `End (t, hash) when t is done. Then, t sticks on this situation, the client can remove it. hash is the hash calculated of the PACK stream.
  • `Error (t, exn) iff the encoder t meet an error exn. The encoder can't continue and sticks in this situation.
OCaml

Innovation. Community. Security.