this repo has no description
1type node_id = Node_id of string [@@unboxed] 2 3val node_id_to_string : node_id -> string 4val node_id_of_string : string -> node_id 5val equal_node_id : node_id -> node_id -> bool 6val compare_node_id : node_id -> node_id -> int 7 8type incarnation = Incarnation of int [@@unboxed] 9 10val incarnation_to_int : incarnation -> int 11val incarnation_of_int : int -> incarnation 12val zero_incarnation : incarnation 13val compare_incarnation : incarnation -> incarnation -> int 14val incr_incarnation : incarnation -> incarnation 15 16type addr = Eio.Net.Sockaddr.datagram 17type node_info = { id : node_id; addr : addr; meta : string } 18 19val make_node_info : id:node_id -> addr:addr -> meta:string -> node_info 20 21type member_state = Alive | Suspect | Dead | Left 22 23val member_state_to_string : member_state -> string 24val member_state_to_int : member_state -> int 25val member_state_of_int : int -> member_state 26 27type member_snapshot = { 28 node : node_info; 29 state : member_state; 30 incarnation : incarnation; 31 state_change : Mtime.span; 32} 33 34type protocol_msg = 35 | Ping of { seq : int; target : node_id; sender : node_info } 36 | Ping_req of { seq : int; target : node_id; sender : node_info } 37 | Ack of { seq : int; responder : node_info; payload : string option } 38 | Alive of { node : node_info; incarnation : incarnation } 39 | Suspect of { 40 node : node_id; 41 incarnation : incarnation; 42 suspector : node_id; 43 } 44 | Dead of { node : node_id; incarnation : incarnation; declarator : node_id } 45 | User_msg of { topic : string; payload : string; origin : node_id } 46 47type packet = { 48 cluster : string; 49 primary : protocol_msg; 50 piggyback : protocol_msg list; 51} 52 53type decode_error = 54 | Invalid_magic 55 | Unsupported_version of int 56 | Truncated_message 57 | Invalid_tag of int 58 | Decryption_failed 59 | Msgpack_error of string 60 | Invalid_crc 61 62val decode_error_to_string : decode_error -> string 63 64type send_error = Node_unreachable | Timeout | Connection_reset 65 66val send_error_to_string : send_error -> string 67 68type node_event = 69 | Join of node_info 70 | Leave of node_info 71 | Update of node_info 72 | Suspect_event of node_info 73 | Alive_event of node_info 74 75type config = { 76 bind_addr : string; 77 bind_port : int; 78 node_name : string option; 79 protocol_interval : float; 80 probe_timeout : float; 81 indirect_checks : int; 82 suspicion_mult : int; 83 suspicion_max_timeout : float; 84 retransmit_mult : int; 85 udp_buffer_size : int; 86 tcp_timeout : float; 87 send_buffer_count : int; 88 recv_buffer_count : int; 89 secret_key : string; 90 cluster_name : string; 91 label : string; 92 encryption_enabled : bool; 93 gossip_verify_incoming : bool; 94 gossip_verify_outgoing : bool; 95} 96 97val default_config : config 98 99type 'a env = { 100 stdenv : 'a; 101 sw : Eio.Switch.t; 102} 103 constraint 104 'a = 105 < clock : _ Eio.Time.clock 106 ; mono_clock : _ Eio.Time.Mono.t 107 ; net : _ Eio.Net.t 108 ; secure_random : _ Eio.Flow.source 109 ; .. > 110 111type stats = { 112 nodes_alive : int; 113 nodes_suspect : int; 114 nodes_dead : int; 115 msgs_sent : int; 116 msgs_received : int; 117 msgs_dropped : int; 118 queue_depth : int; 119 buffers_available : int; 120 buffers_total : int; 121} 122 123val empty_stats : stats 124 125module Wire : sig 126 type message_type = 127 | Ping_msg 128 | Indirect_ping_msg 129 | Ack_resp_msg 130 | Suspect_msg 131 | Alive_msg 132 | Dead_msg 133 | Push_pull_msg 134 | Compound_msg 135 | User_msg 136 | Compress_msg 137 | Encrypt_msg 138 | Nack_resp_msg 139 | Has_crc_msg 140 | Err_msg 141 | Has_label_msg 142 143 val message_type_to_int : message_type -> int 144 val message_type_of_int : int -> (message_type, int) result 145 146 type ping = { 147 seq_no : int; 148 node : string; 149 source_addr : string; 150 source_port : int; 151 source_node : string; 152 } 153 154 type indirect_ping_req = { 155 seq_no : int; 156 target : string; 157 port : int; 158 node : string; 159 nack : bool; 160 source_addr : string; 161 source_port : int; 162 source_node : string; 163 } 164 165 type ack_resp = { seq_no : int; payload : string } 166 type nack_resp = { seq_no : int } 167 type suspect = { incarnation : int; node : string; from : string } 168 169 type alive = { 170 incarnation : int; 171 node : string; 172 addr : string; 173 port : int; 174 meta : string; 175 vsn : int list; 176 } 177 178 type dead = { incarnation : int; node : string; from : string } 179 type compress = { algo : int; buf : string } 180 181 type protocol_msg = 182 | Ping of ping 183 | Indirect_ping of indirect_ping_req 184 | Ack of ack_resp 185 | Nack of nack_resp 186 | Suspect of suspect 187 | Alive of alive 188 | Dead of dead 189 | User_data of string 190 | Compound of string list 191 | Compressed of compress 192 | Err of string 193end 194 195val ip_to_bytes : Eio.Net.Ipaddr.v4v6 -> string 196val ip_of_bytes : string -> Eio.Net.Ipaddr.v4v6 197val default_vsn : int list 198 199val node_info_to_wire : 200 node_info -> source_node:string -> string * int * string * string 201 202val node_info_of_wire : 203 name:string -> addr:string -> port:int -> meta:string -> node_info 204 205val msg_to_wire : 206 self_name:string -> self_port:int -> protocol_msg -> Wire.protocol_msg 207 208val msg_of_wire : default_port:int -> Wire.protocol_msg -> protocol_msg option