Module Smart

Implementation of smart protocol.

This module does not have any Git logics. It provides a light implementation of the Smart protocol to be able to fetch/pull or push with a Git server.

module Capability : sig ... end

Capabilities module.

module Advertised_refs : sig ... end
module Proto_request : sig ... end
module Want : sig ... end
module Have : sig ... end
module Result : sig ... end
module Negotiation : sig ... end
module Commands : sig ... end
module Status : sig ... end
module Shallow : sig ... end
type ('a, 'err) t =
  1. | Read of {
    1. buffer : bytes;
    2. off : int;
    3. len : int;
    4. k : int -> ('a, 'err) t;
    5. eof : unit -> ('a, 'err) t;
    }
  2. | Write of {
    1. buffer : string;
    2. off : int;
    3. len : int;
    4. k : int -> ('a, 'err) t;
    }
  3. | Return of 'a
  4. | Error of 'err
type error = [
  1. | `End_of_input
  2. | `Expected_char of char
  3. | `Unexpected_char of char
  4. | `Expected_string of string
  5. | `Expected_eol
  6. | `Expected_eol_or_space
  7. | `Unexpected_end_of_input
  8. | `No_enough_space
  9. | `Assert_predicate of char -> bool
  10. | `Invalid_advertised_ref of string
  11. | `Invalid_shallow of string
  12. | `Invalid_negotiation_result of string
  13. | `Invalid_side_band of string
  14. | `Invalid_ack of string
  15. | `Invalid_result of string
  16. | `Invalid_command_result of string
  17. | `Invalid_command of string
  18. | `Invalid_want of string
  19. | `Invalid_have of string
  20. | `No_enough_space
  21. | `Unexpected_pkt_line of string
  22. | `Unexpected_flush
  23. | `Invalid_pkt_line of string
]
val pp_error : error Fmt.t
module Context : sig ... end
type 'a send
val proto_request : Proto_request.t send
val send_want : (string, string) Want.t send
val negotiation_done : unit send
val flush : unit send
val commands : (string, string) Commands.t send
val send_pack : ?stateless:bool -> bool -> string send
type 'a recv
val advertised_refs : (string, string) Advertised_refs.t recv
val negotiation_result : string Result.t recv
val recv_pack : ?push_stdout:(string -> unit) -> ?push_stderr:(string -> unit) -> bool -> [ `Payload of string * int * int | `End_of_transmission | `Stdout | `Stderr ] recv
val recv_flush : unit recv
val recv_commands : (string, string) Commands.t option recv
val send_acks : string Negotiation.t list send
val recv_ack : string Negotiation.t recv
val shallows : string Shallow.t list recv
val status : bool -> string Status.t recv
val packet : trim:bool -> string recv
val send_advertised_refs : (string, string) Advertised_refs.t send
val recv_want : (string, string) Want.t option recv
val recv_have : string Have.t recv
val bind : ('a, 'err) t -> f:('a -> ('b, 'err) t) -> ('b, 'err) t
val let* : ('a, 'err) t -> ('a -> ('b, 'err) t) -> ('b, 'err) t
val (>>=) : ('a, 'err) t -> ('a -> ('b, 'err) t) -> ('b, 'err) t
val encode : Context.t -> 'a send -> 'a -> (Context.t -> ('b, [> `Protocol of error ] as 'err) t) -> ('b, 'err) t
val decode : Context.t -> 'a recv -> (Context.t -> 'a -> ('b, [> `Protocol of error ] as 'err) t) -> ('b, 'err) t
val send : Context.t -> 'a send -> 'a -> (unit, [> `Protocol of error ]) t
val recv : Context.t -> 'a recv -> ('a, [> `Protocol of error ]) t
val return : 'v -> ('v, 'err) t
val fail : 'err -> ('v, 'err) t
val reword_error : ('err0 -> 'err1) -> ('v, 'err0) t -> ('v, 'err1) t
val error_msgf : ('a, Stdlib.Format.formatter, unit, ('b, [> `Msg of string ]) t) Stdlib.format4 -> 'a