package git

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

The functor to make the Client by a specific hash implementation.

Parameters

module Hash : sig ... end
module Reference : Reference.S with module Hash := Hash

Signature

module Common : COMMON with type hash := Hash.t and type reference := Reference.t
module Decoder : DECODER with module Hash := Hash and module Reference := Reference and module Common := Common

The Decoder module constrained by the same Hash module.

module Encoder : ENCODER with module Hash := Hash and module Reference := Reference and module Common := Common

The Encoder module constrained by the same Hash module.

type context

The type context.

val capabilities : context -> Capability.t list

capabilities context returns the current shared capabilities between the client and the server.

val set_capabilities : context -> Capability.t list -> unit

set_capabilities context cs sets the current capabilities of the context.

type result = [
  1. | `Refs of Common.advertised_refs
  2. | `ShallowUpdate of Common.shallow_update
  3. | `Negociation of Common.acks
  4. | `NegociationResult of Common.negociation_result
  5. | `PACK of Decoder.flow
  6. | `Flush
  7. | `Nothing
  8. | `ReadyPACK of Cstruct.t
  9. | `ReportStatus of Common.report_status
  10. | `SmartError of string
]

The possible repsonse of the server.

type process = [
  1. | `Read of Cstruct.t * int * int * (int -> process)
  2. | `Write of Cstruct.t * int * int * (int -> process)
  3. | `Error of Decoder.error * Cstruct.t * int
  4. | result
]

The expected actions by the context.

val encode : Encoder.action -> (context -> process) -> context -> process

encode action k ctx starts to encode an action in the context ctx and call k at the end of the encoding.

val decode : 'a Decoder.transaction -> ('a -> context -> process) -> context -> process

decode t k ctx starts to decode an expected Decoder.transaction t and call k at the end of the decoding.

val pp_result : result Fmt.t

Pretty-print of result.

type action = [
  1. | `GitProtoRequest of Common.git_proto_request
  2. | `Shallow of Hash.t list
  3. | `UploadRequest of Common.upload_request
  4. | `UpdateRequest of Common.update_request
  5. | `Has of Hash.Set.t
  6. | `Done
  7. | `Flush
  8. | `ReceivePACK
  9. | `SendPACK of int
  10. | `FinishPACK of Reference.Set.t
]

Close to Encoder.action but more exhaustive and context-dependant.

val run : context -> action -> process

run ctx action sends an action to the server and schedule a specific Decoder.transaction then.

context request makes a new context and the continuation of the transport.

OCaml

Innovation. Community. Security.