module Hash : sig ... end
module Reference : Reference.S with module Hash := Hash
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.
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 = [
| `Refs of Common.advertised_refs |
| `ShallowUpdate of Common.shallow_update |
| `Negociation of Common.acks |
| `NegociationResult of Common.negociation_result |
| `PACK of Decoder.flow |
| `Flush |
| `Nothing |
| `ReadyPACK of Cstruct.t |
| `ReportStatus of Common.report_status |
| `SmartError of string |
]
The possible repsonse of the server.
type process = [
| `Read of Cstruct.t * int * int * (int -> process) |
| `Write of Cstruct.t * int * int * (int -> process) |
| `Error of Decoder.error * Cstruct.t * int |
| 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.
type action = [
| `GitProtoRequest of Common.git_proto_request |
| `Shallow of Hash.t list |
| `UploadRequest of Common.upload_request |
| `UpdateRequest of Common.update_request |
| `Has of Hash.Set.t |
| `Done |
| `Flush |
| `ReceivePACK |
| `SendPACK of int |
| `FinishPACK of Reference.Set.t |
]
Close to Encoder.action
but more exhaustive and context-dependant.
run ctx action
sends an action to the server and schedule a specific Decoder.transaction
then.
val context : Common.git_proto_request -> context * process
context request
makes a new context and the continuation of the transport.