package git

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Hash : sig ... end
module Reference : Reference.S with module Hash := Hash
module Common : COMMON with type hash := Hash.t and type reference := Reference.t
type encoder

The type encoder.

val set_pos : encoder -> int -> unit

set_pos encoder pos is unsafe and change the internal position of the encoder. Don't use it.

val free : encoder -> Cstruct.t

free encoder returns the free internal buffer of the encoder. Don't use it.

type 'a state =
  1. | Write of {
    1. buffer : Cstruct.t;
    2. off : int;
    3. len : int;
    4. continue : int -> 'a state;
    }
    (*

    Means that we want to flush the internal buffer of the encoder. We provide and Cstruct.t with an offset and a length. The client is able to Cstruct.blit this buffer to e output in this range. Then, he can call continue with how many byte(s) he wrote.

    *)
  2. | Ok of 'a
    (*

    The end value of the encoding.

    *)
type action = [
  1. | `GitProtoRequest of Common.git_proto_request
  2. | `UploadRequest of Common.upload_request
  3. | `HttpUploadRequest of [ `Done | `Flush ] * Common.http_upload_request
  4. | `Advertised_refs of Common.advertised_refs
  5. | `Shallow_update of Common.shallow_update
  6. | `Negociation of Common.acks
  7. | `Negociation_result of Common.negociation_result
  8. | `Report_status of [ `No_multiplexe | `Side_band | `Side_band_64k ] * Common.report_status
  9. | `UpdateRequest of Common.update_request
  10. | `HttpUpdateRequest of Common.update_request
  11. | `Has of Hash.Set.t
  12. | `Done
  13. | `Flush
  14. | `Shallow of Hash.t list
  15. | `PACK of int
]

The type action to describe what is expected to encode/send.

val encode : encoder -> action -> unit state

encode encoder action encodes to an output represented by encoder in the way of the action and returns an unit value.

val encoder : unit -> encoder

encoder () makes a new decoder.

val to_string : action -> string