MQTT 3.1 and 5 in OCaml using Eio
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nox-toml

+19 -19
+1 -1
dune-project
··· 23 23 (cmdliner (>= 1.2)) 24 24 nox-tls 25 25 nox-xdge 26 - tomlt 26 + nox-toml 27 27 (logs (>= 0.7)) 28 28 (fmt (>= 0.9)) 29 29 (alcotest :with-test)
+2 -2
lib/cmd/dune
··· 5 5 mqtte 6 6 mqtte_eio 7 7 nox-xdge 8 - tomlt 9 - tomlt.eio 8 + nox-toml 9 + nox-toml.eio 10 10 eio 11 11 conpool 12 12 nox-ca-certs
+7 -7
lib/cmd/mqtte_cmd.ml
··· 58 58 59 59 let empty = { mqtt = empty_mqtt_config; pool = empty_pool_config } 60 60 61 - let mqtt_codec : mqtt_config Tomlt.t = 62 - Tomlt.( 61 + let mqtt_codec : mqtt_config Toml.Codec.t = 62 + Toml.Codec.( 63 63 Table.( 64 64 obj 65 65 (fun ··· 98 98 |> opt_mem "protocol_version" string ~enc:(fun c -> c.protocol_version) 99 99 |> finish)) 100 100 101 - let pool_codec : pool_config Tomlt.t = 102 - Tomlt.( 101 + let pool_codec : pool_config Toml.Codec.t = 102 + Toml.Codec.( 103 103 Table.( 104 104 obj (fun min_connections max_connections idle_timeout -> 105 105 { min_connections; max_connections; idle_timeout }) ··· 108 108 |> opt_mem "idle_timeout" float ~enc:(fun c -> c.idle_timeout) 109 109 |> finish)) 110 110 111 - let codec : t Tomlt.t = 112 - Tomlt.( 111 + let codec : t Toml.Codec.t = 112 + Toml.Codec.( 113 113 Table.( 114 114 obj (fun mqtt pool -> 115 115 { ··· 124 124 125 125 let load_from_path path = 126 126 try 127 - let config = Tomlt_eio.decode_path_exn codec ~fs:path "" in 127 + let config = Toml_eio.decode_path_exn codec ~fs:path "" in 128 128 Log.debug (fun m -> m "Loaded config from %s" (Eio.Path.native_exn path)); 129 129 Some config 130 130 with
+8 -8
lib/cmd/mqtte_cmd.mli
··· 152 152 val empty_mqtt_config : mqtt_config 153 153 (** Empty MQTT config with all fields set to [None]. *) 154 154 155 - val mqtt_codec : mqtt_config Tomlt.t 156 - (** Tomlt codec for the [[mqtt]] section. Use this to compose with your 155 + val mqtt_codec : mqtt_config Toml.Codec.t 156 + (** TOML codec for the [[mqtt]] section. Use this to compose with your 157 157 application's config codec. *) 158 158 159 159 (** {2 Pool Configuration} *) ··· 168 168 val empty_pool_config : pool_config 169 169 (** Empty pool config with all fields set to [None]. *) 170 170 171 - val pool_codec : pool_config Tomlt.t 172 - (** Tomlt codec for the [[pool]] section. *) 171 + val pool_codec : pool_config Toml.Codec.t 172 + (** TOML codec for the [[pool]] section. *) 173 173 174 174 (** {2 Combined Configuration} *) 175 175 ··· 179 179 val empty : t 180 180 (** Empty configuration. *) 181 181 182 - val codec : t Tomlt.t 183 - (** Tomlt codec for the full config file (both [[mqtt]] and [[pool]] 182 + val codec : t Toml.Codec.t 183 + (** TOML codec for the full config file (both [[mqtt]] and [[pool]] 184 184 sections). Use this when loading a standalone config.toml, or use 185 185 {!mqtt_codec} and {!pool_codec} separately to compose with 186 186 application-specific sections. *) ··· 213 213 pool : Mqtte_cmd.Config_file.pool_config; 214 214 } 215 215 216 - let codec = Tomlt.Table.( 216 + let codec = Toml.Codec.Table.( 217 217 obj (fun app_setting mqtt pool -> { app_setting; mqtt; pool }) 218 - |> mem "app_setting" Tomlt.string ~enc:(fun c -> c.app_setting) 218 + |> mem "app_setting" Toml.Codec.string ~enc:(fun c -> c.app_setting) 219 219 |> opt_mem "mqtt" Mqtte_cmd.Config_file.mqtt_codec 220 220 ~enc:(fun c -> Some c.mqtt) 221 221 |> opt_mem "pool" Mqtte_cmd.Config_file.pool_codec
+1 -1
mqtte.opam
··· 19 19 "cmdliner" {>= "1.2"} 20 20 "nox-tls" 21 21 "nox-xdge" 22 - "tomlt" 22 + "nox-toml" 23 23 "logs" {>= "0.7"} 24 24 "fmt" {>= "0.9"} 25 25 "alcotest" {with-test}