From d830839cf1007ae9d82d5c35c9e7f3bf31562cc4 Mon Sep 17 00:00:00 2001 From: Minoru Osuka Date: Wed, 13 May 2020 00:27:52 +0900 Subject: [PATCH] Migrate to Actix web from Iron --- Cargo.lock | 851 +++++++++++++++++++++++++- bayard-rest/Cargo.toml | 12 +- bayard-rest/src/main.rs | 23 +- bayard-rest/src/rest/handler.rs | 368 ++++++----- bayard-rest/src/rest/mod.rs | 11 - bayard-rest/src/rest/server.rs | 80 +-- bayard-server/Cargo.toml | 5 +- bayard-server/src/metric/handler.rs | 12 +- bayard-server/src/metric/server.rs | 42 +- bayard/Cargo.toml | 1 + bayard/src/main.rs | 32 +- docs_src/reference/api/search.md | 218 +------ docs_src/reference/cli/bayard-rest.md | 3 + docs_src/reference/cli/bayard.md | 7 +- 14 files changed, 1138 insertions(+), 527 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27b8e69..3564e09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,289 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "actix" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-http 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix_derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-connect" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-http" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-connect 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-threadpool 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-router" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytestring 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-rt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-macros 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-threadpool 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-server" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-service" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-testing" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-macros 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-server 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-threadpool" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "threadpool 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-utils" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-web" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-http 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-macros 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-router 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-server 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-testing 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-threadpool 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-web-codegen 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "awc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix-web-codegen" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "actix_derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ahash" version = "0.2.18" @@ -24,6 +308,11 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arc-swap" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "async-std" version = "1.5.0" @@ -57,6 +346,16 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "async-trait" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "atomicwrites" version = "0.2.5" @@ -87,6 +386,28 @@ name = "autocfg" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "awc" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-http 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "backtrace" version = "0.3.46" @@ -125,6 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "bayard" version = "0.8.0" dependencies = [ + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bayard-client 0.8.0", "bayard-common 0.8.0", "bayard-proto 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -191,40 +513,41 @@ dependencies = [ name = "bayard-rest" version = "0.8.0" dependencies = [ + "actix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-server 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-web 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "bayard-client 0.8.0", "bayard-common 0.8.0", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "ctrlc 3.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "persistent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "router 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", - "urlencoded 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_qs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "bayard-server" version = "0.8.0" dependencies = [ + "actix-server 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "actix-web 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "async-std 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "bayard-proto 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cang-jie 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", - "iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "jieba-rs 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lindera-tantivy 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "raft 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "router 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", "stringreader 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -254,15 +577,21 @@ dependencies = [ ] [[package]] -name = "bodyparser" -version = "0.8.0" +name = "brotli-sys" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "persistent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "brotli2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -275,6 +604,14 @@ name = "bytes" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytestring" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cang-jie" version = "0.7.0" @@ -375,6 +712,11 @@ dependencies = [ "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "copyless" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "crc32fast" version = "1.2.0" @@ -462,11 +804,31 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "data-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "derive_more" +version = "0.99.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "downcast-rs" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "either" version = "1.5.3" @@ -529,6 +891,25 @@ name = "encoding_index_tests" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "enum-as-inner" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "env_logger" version = "0.7.1" @@ -541,6 +922,15 @@ dependencies = [ "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "error-chain" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fail" version = "0.3.0" @@ -582,6 +972,17 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "flate2" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fnv" version = "1.0.6" @@ -768,10 +1169,28 @@ name = "grpcio-sys" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", - "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "h2" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -783,6 +1202,14 @@ dependencies = [ "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "hermit-abi" version = "0.1.11" @@ -791,11 +1218,31 @@ dependencies = [ "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "match_cfg 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "htmlescape" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.4" @@ -837,6 +1284,24 @@ dependencies = [ "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "indexmap" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "inotify" version = "0.7.0" @@ -863,6 +1328,17 @@ dependencies = [ "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "socket2 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "iron" version = "0.6.1" @@ -1017,6 +1493,19 @@ dependencies = [ "tantivy 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "log" version = "0.3.9" @@ -1043,6 +1532,19 @@ dependencies = [ "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "matches" version = "0.1.8" @@ -1083,6 +1585,11 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "mime_guess" version = "1.8.8" @@ -1094,6 +1601,14 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.6.21" @@ -1256,19 +1771,37 @@ dependencies = [ ] [[package]] -name = "percent-encoding" -version = "1.0.1" +name = "parking_lot" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] -name = "persistent" -version = "0.4.0" +name = "parking_lot_core" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "phf" version = "0.7.24" @@ -1304,6 +1837,24 @@ dependencies = [ "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pin-project" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pin-project-internal 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pin-project-lite" version = "0.1.4" @@ -1614,6 +2165,15 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "resolv-conf" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hostname 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "route-recognizer" version = "0.1.13" @@ -1694,6 +2254,42 @@ dependencies = [ "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_qs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "data-encoding 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "signal-hook-registry" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arc-swap 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "siphasher" version = "0.2.3" @@ -1714,6 +2310,17 @@ name = "snap" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "spin" version = "0.5.2" @@ -1884,6 +2491,14 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "threadpool" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.43" @@ -1893,11 +2508,94 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-util" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "traitobject" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "trust-dns-proto" +version = "0.18.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "enum-as-inner 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "socket2 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.18.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ipconfig 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "resolv-conf 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "typeable" version = "0.1.2" @@ -1935,6 +2633,11 @@ dependencies = [ "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-segmentation" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-width" version = "0.1.7" @@ -1964,14 +2667,13 @@ dependencies = [ ] [[package]] -name = "urlencoded" -version = "0.6.0" +name = "url" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bodyparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1998,6 +2700,11 @@ name = "version_check" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "version_check" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "void" version = "1.0.2" @@ -2018,6 +2725,11 @@ name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "widestring" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.2.8" @@ -2055,6 +2767,14 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -2065,15 +2785,35 @@ dependencies = [ ] [metadata] +"checksum actix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4af87564ff659dee8f9981540cac9418c45e910c8072fdedd643a262a38fcaf" +"checksum actix-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "09e55f0a5c2ca15795035d90c46bd0e73a5123b72f68f12596d6ba5282051380" +"checksum actix-connect 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c" +"checksum actix-http 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019" +"checksum actix-macros 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "21705adc76bbe4bc98434890e73a89cd00c6015e5704a60bb6eea6c3b72316b6" +"checksum actix-router 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9d7a10ca4d94e8c8e7a87c5173aba1b97ba9a6563ca02b0e1cd23531093d3ec8" +"checksum actix-rt 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" +"checksum actix-server 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "582a7173c281a4f46b5aa168a11e7f37183dcb71177a39312cc2264da7a632c9" +"checksum actix-service 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3e4fc95dfa7e24171b2d0bb46b85f8ab0e8499e4e3caec691fc4ea65c287564" +"checksum actix-testing 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48494745b72d0ea8ff0cf874aaf9b622a3ee03d7081ee0c04edea4f26d32c911" +"checksum actix-threadpool 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4082192601de5f303013709ff84d81ca6a1bc4af7fb24f367a500a23c6e84e" +"checksum actix-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8" +"checksum actix-utils 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fcf8f5631bf01adec2267808f00e228b761c60c0584cc9fa0b5364f41d147f4e" +"checksum actix-web 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635" +"checksum actix-web-codegen 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4f00371942083469785f7e28c540164af1913ee7c96a4534acb9cea92c39f057" +"checksum actix_derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b95aceadaf327f18f0df5962fedc1bde2f870566a0b9f65c89508a3b1f79334c" +"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" "checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arc-swap 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b585a98a234c46fc563103e9278c9391fde1f4e6850334da895d27edb9580f62" "checksum async-std 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "538ecb01eb64eecd772087e5b6f7540cbc917f047727339a472dafed2185b267" "checksum async-task 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" +"checksum async-trait 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "da71fef07bc806586090247e971229289f64c210a278ee5ae419314eb386b31d" "checksum atomicwrites 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6a2baf2feb820299c53c7ad1cc4f5914a220a1cb76d7ce321d2522a94b54651f" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum awc 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5" "checksum backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)" = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" "checksum backtrace-sys 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "7de8aba10a69c8e8d7622c5710229485ec32e9d55fdad160ea559c086fdcd118" "checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" @@ -2082,9 +2822,11 @@ dependencies = [ "checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum bitpacking 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3744aff20a3437a99ebc0bb7733e9e60c7bf590478c9b897e95b38d57e5acb68" -"checksum bodyparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f023abfa58aad6f6bc4ae0630799e24d5ee0ab8bb2e49f651d9b1f9aa4f52f30" +"checksum brotli-sys 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" +"checksum brotli2 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +"checksum bytestring 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363" "checksum cang-jie 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6cba53b536ecec7977fe14dd1a14b2956cb39c24f6f49d1c752bd19431a1fb4b" "checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" "checksum cedarwood 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "963e82c7b94163808ca3a452608d260b64ba5bc7b5653b4af1af59887899f48d" @@ -2097,6 +2839,7 @@ dependencies = [ "checksum combine 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c875843236b5e2eb535fd0b696387bfb623f896479b10ed626cf442b836e8032" "checksum const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" "checksum const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +"checksum copyless 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" "checksum crossbeam 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" "checksum crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" @@ -2106,7 +2849,10 @@ dependencies = [ "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" "checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" "checksum ctrlc 3.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7a4ba686dff9fa4c1c9636ce1010b0cf98ceb421361b0bb3d6faeec43bd217a7" +"checksum data-encoding 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "11c0346158a19b3627234e15596f5e465c360fcdb97d817bcb255e0510f5a788" +"checksum derive_more 0.99.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" "checksum downcast-rs 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" +"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" @@ -2115,11 +2861,15 @@ dependencies = [ "checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +"checksum enum-as-inner 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4bfcfacb61d231109d1d55202c1f33263319668b168843e02ad4652725ec9c" "checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" "checksum fail 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f63eec71a3013ee912a0ecb339ff0c5fa5ed9660df04bfefa10c250b885d018c" "checksum failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b" "checksum failure_derive 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231" "checksum filetime 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f59efc38004c988e4201d11d263b8171f49a2e7ec0bdbb71773433f271504a5e" +"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" "checksum fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" @@ -2143,16 +2893,23 @@ dependencies = [ "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum grpcio 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9ac757a85603e4f8c40a9f94be06a5ad412acab80b39b4e8895ca931b6619910" "checksum grpcio-sys 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7b2f22fb0327f153acccedbe91894dd0fb15bb6f202d8195665cd206af0402b0" +"checksum h2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" +"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" "checksum hermit-abi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8a0d737e0f947a1864e93d33fdef4af8445a00d1ed8dc0c8ddb73139ea6abf15" +"checksum hostname 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" +"checksum http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" "checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +"checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" "checksum inotify 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24e40d6fd5d64e2082e0c796495c8ef5ad667a96d03e5aaa0becfd9d47bcbfb8" "checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +"checksum ipconfig 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" "checksum iron 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c6d308ca2d884650a8bf9ed2ff4cb13fbb2207b71f64cda11dc9b892067295e8" "checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" @@ -2170,16 +2927,22 @@ dependencies = [ "checksum lindera-fst 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6f0f4e2978dc4e3f4065be40d5ef2a10014aff1723e9fed2269d6de3507f99" "checksum lindera-ipadic 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f12f44c385a6f4c1ff0863a2f0a91ce5f1ff6c2e0e44c69b37051b56fece112" "checksum lindera-tantivy 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1c2ed099bb82c08eca7fac436191b4bc7d96348ec681c54f11ecdcfe4dc1d1a8" +"checksum linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +"checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6c9172cb4c2f6c52117e25570983edcbb322f130b1031ae5d5d6b1abe7eeb493" +"checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +"checksum match_cfg 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" "checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" "checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" "checksum mime_guess 1.8.8 (registry+https://github.com/rust-lang/crates.io-index)" = "216929a5ee4dd316b1702eedf5e74548c123d370f47841ceaac38ca154690ca3" +"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" "checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" @@ -2196,12 +2959,16 @@ dependencies = [ "checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" "checksum owned-read 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b66d1e235abcebc845cf93550b89b74f468c051496fafb433ede4104b9f71ba1" "checksum owning_ref 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +"checksum parking_lot 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +"checksum parking_lot_core 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum persistent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e8fa0009c4f3d350281309909c618abddf10bb7e3145f28410782f6a5ec74c5" +"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" "checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" "checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" "checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" "checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" +"checksum pin-project 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "81d480cb4e89522ccda96d0eed9af94180b7a5f93fb28f66e1fd7d68431663d1" +"checksum pin-project-internal 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)" = "a82996f11efccb19b685b14b5df818de31c1edcee3daa256ab5775dd98e72feb" "checksum pin-project-lite 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" @@ -2239,6 +3006,7 @@ dependencies = [ "checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" "checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum resolv-conf 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a" "checksum route-recognizer 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ea509065eb0b3c446acdd0102f0d46567dc30902dc0be91d6552035d92b0f4f8" "checksum router 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc63b6f3b8895b0d04e816b2b1aa58fdba2d5acca3cbb8f0ab8e017347d57397" "checksum rust-stemmers 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" @@ -2250,10 +3018,15 @@ dependencies = [ "checksum serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" "checksum serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" "checksum serde_json 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)" = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" +"checksum serde_qs 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d43eef44996bbe16e99ac720e1577eefa16f7b76b5172165c98ced20ae9903e1" +"checksum serde_urlencoded 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" +"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" "checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05720e22615919e4734f6a99ceae50d00226c3c5aca406e102ebc33298214e0a" "checksum snap 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fb9b0bb877b35a1cc1474a3b43d9c226a2625311760cdda2cbccbc0c7a8376" +"checksum socket2 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum stringreader 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "913e7b03d63752f6cdd2df77da36749d82669904798fe8944b9ec3d23f159905" @@ -2270,29 +3043,39 @@ dependencies = [ "checksum thiserror 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "d12a1dae4add0f0d568eebc7bf142f145ba1aa2544cafb195c76f0f409091b60" "checksum thiserror-impl 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3f34e0c1caaa462fd840ec6b768946ea1e7842620d94fe29d5b847138f521269" "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum threadpool 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e8dae184447c15d5a6916d973c642aec485105a13cd238192a6927ae3e077d66" "checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +"checksum tokio 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1" +"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +"checksum tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum trust-dns-proto 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f" +"checksum trust-dns-resolver 0.18.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" "checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum urlencoded 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a52f50139118b60ae91af08bf15ed158817d34b91b9d24c11ffbe21195d33e3" +"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" "checksum utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" "checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-util 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fa515c5163a99cc82bab70fd3bfdd36d827be85de63737b40fcef2ce084a436e" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/bayard-rest/Cargo.toml b/bayard-rest/Cargo.toml index 9421831..debfd22 100644 --- a/bayard-rest/Cargo.toml +++ b/bayard-rest/Cargo.toml @@ -17,16 +17,18 @@ name = "bayard-rest" path = "src/main.rs" [dependencies] +actix = "0.9.0" +actix-rt = "1.1.1" +actix-server = "1.0.2" +actix-web = "2.0.0" clap = "2.33.0" crossbeam-channel = "0.4.2" ctrlc = { version = "3.1.4", features = ["termination"] } -iron = "0.6.1" log = "0.4.8" -logger = "0.4.0" -persistent = "0.4.0" -router = "0.6.0" +num_cpus = "1.13.0" +serde = { version = "1.0.106", features = ["derive"] } serde_json = "1.0.51" -urlencoded = "0.6.0" +serde_qs = "0.5.2" bayard-client = { version = "0.8.0", path = "../bayard-client" } bayard-common = { version = "0.8.0", path = "../bayard-common" } diff --git a/bayard-rest/src/main.rs b/bayard-rest/src/main.rs index 950f138..141fc47 100644 --- a/bayard-rest/src/main.rs +++ b/bayard-rest/src/main.rs @@ -9,9 +9,12 @@ use bayard_common::log::set_logger; use bayard_common::signal::sigterm_channel; use bayard_rest::rest::server::RestServer; -fn main() -> Result<(), std::io::Error> { +#[actix_rt::main] +async fn main() -> std::io::Result<()> { set_logger(); + let threads = format!("{}", num_cpus::get().to_owned()); + let app = App::new(crate_name!()) .setting(AppSettings::DeriveDisplayOrder) .version(crate_version!()) @@ -46,6 +49,15 @@ fn main() -> Result<(), std::io::Error> { .value_name("IP:PORT") .default_value("0.0.0.0:5000") .takes_value(true), + ) + .arg( + Arg::with_name("HTTP_WORKER_THREADS") + .help("Number of HTTP worker threads. By default http server uses number of available logical cpu as threads count.") + .short("w") + .long("http-worker-threads") + .value_name("HTTP_WORKER_THREADS") + .default_value(&threads) + .takes_value(true), ); let matches = app.get_matches(); @@ -53,10 +65,15 @@ fn main() -> Result<(), std::io::Error> { let host = matches.value_of("HOST").unwrap(); let port = matches.value_of("PORT").unwrap().parse::().unwrap(); let server = matches.value_of("SERVER").unwrap(); + let http_worker_threads = matches + .value_of("HTTP_WORKER_THREADS") + .unwrap() + .parse::() + .unwrap(); let rest_address = format!("{}:{}", host, port); - let mut rest_server = RestServer::new(rest_address.as_str(), server); + let mut rest_server = RestServer::new(rest_address.as_str(), server, http_worker_threads); info!("start rest service on {}", rest_address.as_str()); // Wait for signals for termination (SIGINT, SIGTERM). @@ -70,7 +87,7 @@ fn main() -> Result<(), std::io::Error> { } } - match rest_server.shutdown() { + match rest_server.shutdown().await { Ok(_) => { info!("stop rest service on {}:{}", host, port); Ok(()) diff --git a/bayard-rest/src/rest/handler.rs b/bayard-rest/src/rest/handler.rs index 75ac3d2..15d3383 100644 --- a/bayard-rest/src/rest/handler.rs +++ b/bayard-rest/src/rest/handler.rs @@ -1,233 +1,229 @@ -use std::io::Read; - -use iron::headers::ContentType; -use iron::prelude::*; -use iron::{status, IronError, IronResult, Request, Response}; -use persistent::Write; -use router::Router; +use actix_web::{delete, get, post, put, web, Error, HttpRequest, HttpResponse}; +use serde::Deserialize; use serde_json::Value; -use urlencoded::UrlEncodedQuery; - -use crate::rest::Client; - -pub fn get(req: &mut Request) -> IronResult { - let id = req - .extensions - .get::() - .unwrap() - .find("id") - .unwrap_or("") - .to_owned(); - - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.get(id) { - Ok(s) => Ok(Response::with((ContentType::json().0, status::Ok, s))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to get document"), - )), + +use crate::rest::server::AppState; + +#[get("/v1/documents/{id}")] +pub async fn get(state: AppState, id: web::Path) -> Result { + match state.index_client.lock().unwrap().get(id.into_inner()) { + Ok(s) => { + let res = HttpResponse::Ok().body(s); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn set(req: &mut Request) -> IronResult { - let id = req - .extensions - .get::() - .unwrap() - .find("id") - .unwrap_or("") - .to_owned(); - let mut body = String::new(); - req.body - .read_to_string(&mut body) - .expect("Failed to read line"); - - let mut doc_json: Value = serde_json::from_str(body.as_str()).unwrap(); - doc_json["_id"] = Value::String(id); - let doc = serde_json::to_string(&doc_json).unwrap(); - - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.set(doc) { - Ok(()) => Ok(Response::with((ContentType::json().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to set document"), - )), +#[put("/v1/documents/{id}")] +pub async fn set( + state: AppState, + body: web::Bytes, + id: web::Path, +) -> Result { + let json_str = String::from_utf8(body.to_vec()).unwrap(); + let mut value: Value = serde_json::from_str(json_str.as_str()).unwrap(); + value["_id"] = Value::String(id.into_inner()); + + let doc = serde_json::to_string(&value).unwrap(); + + match state.index_client.lock().unwrap().set(doc) { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn delete(req: &mut Request) -> IronResult { - let id = req - .extensions - .get::() - .unwrap() - .find("id") - .unwrap_or("") - .to_owned(); - - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.delete(id) { - Ok(()) => Ok(Response::with((ContentType::json().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to delete document"), - )), +#[delete("/v1/documents/{id}")] +pub async fn delete(state: AppState, id: web::Path) -> Result { + match state.index_client.lock().unwrap().delete(id.into_inner()) { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn bulk_set(req: &mut Request) -> IronResult { - let mut docs = String::new(); - req.body - .read_to_string(&mut docs) - .expect("Failed to read line"); - - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.bulk_set(docs) { - Ok(()) => Ok(Response::with((ContentType::json().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - ( - status::InternalServerError, - "failed to set documents in bulk", - ), - )), +#[put("/v1/documents")] +pub async fn bulk_set(state: AppState, body: web::Bytes) -> Result { + let docs = String::from_utf8(body.to_vec()).unwrap(); + + match state.index_client.lock().unwrap().bulk_set(docs) { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn bulk_delete(req: &mut Request) -> IronResult { - let mut docs = String::new(); - req.body - .read_to_string(&mut docs) - .expect("Failed to read line"); - - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.bulk_delete(docs) { - Ok(()) => Ok(Response::with((ContentType::json().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - ( - status::InternalServerError, - "failed to delete documents in bulk", - ), - )), +#[delete("/v1/documents")] +pub async fn bulk_delete(state: AppState, body: web::Bytes) -> Result { + let docs = String::from_utf8(body.to_vec()).unwrap(); + + match state.index_client.lock().unwrap().bulk_delete(docs) { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn commit(req: &mut Request) -> IronResult { - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.commit() { - Ok(()) => Ok(Response::with((ContentType::plaintext().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to commit index"), - )), +#[get("/v1/commit")] +pub async fn commit(state: AppState) -> Result { + match state.index_client.lock().unwrap().commit() { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn rollback(req: &mut Request) -> IronResult { - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.rollback() { - Ok(()) => Ok(Response::with((ContentType::plaintext().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to rollback index"), - )), +#[get("/v1/rollback")] +pub async fn rollback(state: AppState) -> Result { + match state.index_client.lock().unwrap().rollback() { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn merge(req: &mut Request) -> IronResult { - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.merge() { - Ok(()) => Ok(Response::with((ContentType::plaintext().0, status::Ok, ""))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to merge index"), - )), +#[get("/v1/merge")] +pub async fn merge(state: AppState) -> Result { + match state.index_client.lock().unwrap().merge() { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn schema(req: &mut Request) -> IronResult { - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.schema() { - Ok(s) => Ok(Response::with((ContentType::json().0, status::Ok, s))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to get schema"), - )), +#[get("/v1/schema")] +pub async fn schema(state: AppState) -> Result { + match state.index_client.lock().unwrap().schema() { + Ok(_) => { + let res = HttpResponse::Ok().await.unwrap(); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn search(req: &mut Request) -> IronResult { - let map = req.get_ref::().unwrap().to_owned(); - let query = map.get("query").unwrap().get(0).unwrap(); +#[derive(Deserialize)] +pub struct SearchQueryParams { + from: Option, + limit: Option, + exclude_count: Option, + exclude_docs: Option, + facet_field: Option, + facet_prefix: Option>, +} + +#[post("/v1/search")] +pub async fn search( + state: AppState, + req: HttpRequest, + body: web::Bytes, +) -> Result { + let params = serde_qs::from_str::(&req.query_string()).unwrap(); let mut from = 0; - if map.contains_key("from") { - from = map - .get("from") - .unwrap() - .get(0) - .unwrap_or(&String::from("0")) - .parse::() - .unwrap(); + if let Some(_from) = params.from { + from = _from; } + let mut limit = 10; - if map.contains_key("limit") { - limit = map - .get("limit") - .unwrap() - .get(0) - .unwrap_or(&String::from("10")) - .parse::() - .unwrap(); - } - let exclude_count = map.contains_key("exclude_count"); - let exclude_docs = map.contains_key("exclude_docs"); - let mut facet_field: &str = ""; - if map.contains_key("facet_field") { - facet_field = map.get("facet_field").unwrap().get(0).unwrap(); + if let Some(_limit) = params.limit { + limit = _limit; + } + + let mut exclude_count = false; + if let Some(_exclude_count) = params.exclude_count { + exclude_count = _exclude_count; } + + let mut exclude_docs = false; + if let Some(_exclude_docs) = params.exclude_docs { + exclude_docs = _exclude_docs; + } + + let mut facet_field = String::from(""); + if let Some(_facet_field) = params.facet_field { + facet_field = _facet_field; + } + let mut facet_prefixes = Vec::new(); - if map.contains_key("facet_prefix") { - facet_prefixes = map.get("facet_prefix").cloned().unwrap(); + if let Some(_facet_prefix) = params.facet_prefix { + facet_prefixes = _facet_prefix; } - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.search( - query, + let query = String::from_utf8(body.to_vec()).unwrap(); + + match state.index_client.lock().unwrap().search( + query.as_str(), from, limit, exclude_count, exclude_docs, - facet_field, + facet_field.as_str(), facet_prefixes, ) { - Ok(s) => Ok(Response::with((ContentType::json().0, status::Ok, s))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to search index"), - )), + Ok(s) => { + let res = HttpResponse::Ok().body(s); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } -pub fn status(req: &mut Request) -> IronResult { - let client = req.get::>().unwrap(); - let mut index_client = client.lock().unwrap(); - match index_client.status() { - Ok(s) => Ok(Response::with((ContentType::json().0, status::Ok, s))), - Err(e) => Err(IronError::new( - e, - (status::InternalServerError, "failed to get status"), - )), +#[get("/v1/status")] +pub async fn status(state: AppState) -> Result { + match state.index_client.lock().unwrap().status() { + Ok(s) => { + let res = HttpResponse::Ok().body(s); + Ok(res) + } + Err(e) => { + let res = HttpResponse::InternalServerError().body(format!("{}", e)); + Ok(res) + } } } diff --git a/bayard-rest/src/rest/mod.rs b/bayard-rest/src/rest/mod.rs index 8c70a36..918a0f0 100644 --- a/bayard-rest/src/rest/mod.rs +++ b/bayard-rest/src/rest/mod.rs @@ -1,13 +1,2 @@ -use iron::typemap::Key; - -use bayard_client::index::client::IndexClient; - pub mod handler; pub mod server; - -#[derive(Copy, Clone)] -pub struct Client; - -impl Key for Client { - type Value = IndexClient; -} diff --git a/bayard-rest/src/rest/server.rs b/bayard-rest/src/rest/server.rs index e9e6a49..d81f63f 100644 --- a/bayard-rest/src/rest/server.rs +++ b/bayard-rest/src/rest/server.rs @@ -1,53 +1,59 @@ -use std::io::{Error, ErrorKind}; +use std::io; +use std::sync::Mutex; -use iron::{Chain, Iron, Listening}; -use logger::Logger; -use persistent::Write; -use router::Router; +use actix_server::Server; +use actix_web::{middleware, web, App, HttpServer}; use bayard_client::index::client::IndexClient; use crate::rest::handler::{ bulk_delete, bulk_set, commit, delete, get, merge, rollback, schema, search, set, status, }; -use crate::rest::Client; + +pub struct AppData { + pub index_client: Mutex, +} + +pub type AppState = web::Data; pub struct RestServer { - listening: Listening, + server: Server, } impl RestServer { - pub fn new(address: &str, server: &str) -> RestServer { - let index_client = IndexClient::new(server); - - let (logger_before, logger_after) = Logger::new(None); - let mut router = Router::new(); - router.get("/v1/documents/:id", get, "get"); - router.put("/v1/documents/:id", set, "set"); - router.delete("/v1/documents/:id", delete, "delete"); - router.put("/v1/documents", bulk_set, "bulk_set"); - router.delete("/v1/documents", bulk_delete, "bulk_delete"); - router.get("/v1/commit", commit, "commit"); - router.get("/v1/rollback", rollback, "rollback"); - router.get("/v1/merge", merge, "merge"); - router.get("/v1/schema", schema, "schema"); - router.post("/v1/search", search, "search"); - router.get("/v1/status", status, "status"); - - let mut chain = Chain::new(router); - chain.link_before(logger_before); - chain.link(Write::::both(index_client)); - chain.link_after(logger_after); - - let listening = Iron::new(chain).http(address).unwrap(); - - RestServer { listening } + pub fn new(address: &str, index_server_address: &str, worker_num: usize) -> RestServer { + let index_client = IndexClient::new(index_server_address); + let app_data = web::Data::new(AppData { + index_client: Mutex::new(index_client), + }); + + let server = HttpServer::new(move || { + App::new() + .app_data(app_data.clone()) + .wrap(middleware::DefaultHeaders::new().header("X-Version", "0.2")) + .wrap(middleware::Compress::default()) + .wrap(middleware::Logger::default()) + .service(get) + .service(set) + .service(delete) + .service(bulk_set) + .service(bulk_delete) + .service(commit) + .service(rollback) + .service(merge) + .service(schema) + .service(search) + .service(status) + }) + .bind(address) + .unwrap() + .workers(worker_num) + .run(); + + RestServer { server } } - pub fn shutdown(&mut self) -> Result<(), std::io::Error> { - match self.listening.close() { - Ok(_) => Ok(()), - Err(e) => Err(Error::new(ErrorKind::Other, e)), - } + pub async fn shutdown(&mut self) -> io::Result<()> { + Ok(self.server.stop(true).await) } } diff --git a/bayard-server/Cargo.toml b/bayard-server/Cargo.toml index 79a8aa4..aba5cb1 100644 --- a/bayard-server/Cargo.toml +++ b/bayard-server/Cargo.toml @@ -13,21 +13,20 @@ categories = ["database"] license = "MIT" [dependencies] +actix-server = "1.0.2" +actix-web = "2.0.0" async-std = "1.5.0" bincode = "1.2.1" cang-jie = "0.7.0" futures = "0.1.29" grpcio = { version = "0.4.7", features = [ "secure" ] } -iron = "0.6.1" jieba-rs = "0.4.10" lazy_static = "1.4.0" lindera-tantivy = "0.1.1" log = "0.4.8" -logger = "0.4.0" prometheus = "0.8.0" protobuf = "2.14.0" raft = "0.4.3" -router = "0.6.0" serde = { version = "1.0.106", features = ["derive"] } serde_json = "1.0.51" stringreader = "0.1.1" diff --git a/bayard-server/src/metric/handler.rs b/bayard-server/src/metric/handler.rs index 521506a..e893162 100644 --- a/bayard-server/src/metric/handler.rs +++ b/bayard-server/src/metric/handler.rs @@ -1,16 +1,14 @@ -use iron::{status, IronResult, Request, Response}; +use actix_web::{get, Error, HttpResponse}; use prometheus::{Encoder, TextEncoder}; -pub fn metrics(_req: &mut Request) -> IronResult { +#[get("/metrics")] +pub async fn metrics() -> Result { let metric_families = prometheus::gather(); let mut buffer = Vec::::new(); let encoder = TextEncoder::new(); encoder.encode(&metric_families, &mut buffer).unwrap(); let metrics_text = String::from_utf8(buffer.clone()).unwrap(); - Ok(Response::with(( - encoder.format_type(), - status::Ok, - metrics_text, - ))) + let res = HttpResponse::Ok().body(metrics_text); + Ok(res) } diff --git a/bayard-server/src/metric/server.rs b/bayard-server/src/metric/server.rs index 3a5a618..c5ffb4b 100644 --- a/bayard-server/src/metric/server.rs +++ b/bayard-server/src/metric/server.rs @@ -1,34 +1,32 @@ -use std::io::{Error, ErrorKind}; +use std::io; -use iron::{Chain, Iron, Listening}; -use logger::Logger; -use router::Router; +use actix_server::Server; +use actix_web::{middleware, App, HttpServer}; use crate::metric::handler::metrics; pub struct MetricsServer { - listening: Listening, + server: Server, } impl MetricsServer { - pub fn new(address: &str) -> MetricsServer { - let (logger_before, logger_after) = Logger::new(None); - let mut router = Router::new(); - router.get("/metrics", metrics, "metrics"); - - let mut chain = Chain::new(router); - chain.link_before(logger_before); - chain.link_after(logger_after); - - let listening = Iron::new(chain).http(address).unwrap(); - - MetricsServer { listening } + pub fn new(address: &str, worker_num: usize) -> MetricsServer { + let server = HttpServer::new(move || { + App::new() + .wrap(middleware::DefaultHeaders::new().header("X-Version", "0.2")) + .wrap(middleware::Compress::default()) + .wrap(middleware::Logger::default()) + .service(metrics) + }) + .bind(address) + .unwrap() + .workers(worker_num) + .run(); + + MetricsServer { server } } - pub fn shutdown(&mut self) -> Result<(), std::io::Error> { - match self.listening.close() { - Ok(_) => Ok(()), - Err(e) => Err(Error::new(ErrorKind::Other, e)), - } + pub async fn shutdown(&mut self) -> io::Result<()> { + Ok(self.server.stop(true).await) } } diff --git a/bayard/Cargo.toml b/bayard/Cargo.toml index 5703484..3277107 100644 --- a/bayard/Cargo.toml +++ b/bayard/Cargo.toml @@ -17,6 +17,7 @@ name = "bayard" path = "src/main.rs" [dependencies] +actix-rt = "1.1.1" clap = "2.33.0" crossbeam-channel = "0.4.2" futures = "0.1.29" diff --git a/bayard/src/main.rs b/bayard/src/main.rs index 51ad0c6..94f4827 100644 --- a/bayard/src/main.rs +++ b/bayard/src/main.rs @@ -20,16 +20,11 @@ use bayard_server::index::server::IndexServer; use bayard_server::metric::server::MetricsServer; use bayard_server::raft::config::NodeAddress; -fn main() -> Result<(), std::io::Error> { +#[actix_rt::main] +async fn main() -> std::io::Result<()> { set_logger(); - let cpus = num_cpus::get().to_owned(); - let threads; - if cpus > 1 { - threads = format!("{}", cpus - 1); - } else { - threads = format!("{}", cpus); - } + let threads = format!("{}", num_cpus::get().to_owned()); let app = App::new(crate_name!()) .setting(AppSettings::DeriveDisplayOrder) @@ -118,7 +113,7 @@ fn main() -> Result<(), std::io::Error> { ) .arg( Arg::with_name("INDEXER_THREADS") - .help("Number of indexer threads.") + .help("Number of indexer threads. By default indexer uses number of available logical cpu as threads count.") .short("t") .long("indexer-threads") .value_name("INDEXER_THREADS") @@ -133,6 +128,15 @@ fn main() -> Result<(), std::io::Error> { .value_name("INDEXER_MEMORY_SIZE") .default_value("1000000000") .takes_value(true), + ) + .arg( + Arg::with_name("HTTP_WORKER_THREADS") + .help("Number of HTTP worker threads. By default http server uses number of available logical cpu as threads count.") + .short("w") + .long("http-worker-threads") + .value_name("HTTP_WORKER_THREADS") + .default_value(&threads) + .takes_value(true), ); let matches = app.get_matches(); @@ -171,6 +175,11 @@ fn main() -> Result<(), std::io::Error> { .unwrap() .parse::() .unwrap(); + let http_worker_threads = matches + .value_of("HTTP_WORKER_THREADS") + .unwrap() + .parse::() + .unwrap(); let raft_address = format!("{}:{}", host, raft_port); let index_address = format!("{}:{}", host, index_port); @@ -188,7 +197,6 @@ fn main() -> Result<(), std::io::Error> { let mut client = RaftClient::new(peer_address); match client.join(id, node_address.clone()) { Ok(_addresses) => addresses = _addresses, - // Err(e) => return Err(Box::try_from(e).unwrap()), Err(e) => return Err(e), }; } @@ -241,7 +249,7 @@ fn main() -> Result<(), std::io::Error> { } // metrics service - let mut metrics_server = MetricsServer::new(metrics_address.as_str()); + let mut metrics_server = MetricsServer::new(metrics_address.as_str(), http_worker_threads); info!("start metrics service on {}", metrics_address.as_str()); // Wait for signals for termination (SIGINT, SIGTERM). @@ -255,7 +263,7 @@ fn main() -> Result<(), std::io::Error> { } } - match metrics_server.shutdown() { + match metrics_server.shutdown().await { Ok(_) => { info!("stop metrics service on {}:{}", host, metrics_port); } diff --git a/docs_src/reference/api/search.md b/docs_src/reference/api/search.md index 05a515f..606bbe8 100644 --- a/docs_src/reference/api/search.md +++ b/docs_src/reference/api/search.md @@ -36,69 +36,15 @@ Hierarchical facet field value prefix. To search documents from the index: ```text -$ curl -X POST 'http://localhost:8000/v1/search?query=search&from=0&limit=10&facet_field=category&facet_prefix=/language&facet_prefix=/category/search' +$ curl -X POST 'http://localhost:8000/v1/search?from=0&limit=10&facet_field=category&facet_prefix[]=/language&facet_prefix[]=/category/search' --data-binary 'description:rust' | jq . ``` You'll see the result in JSON format. The result of the above command is: ```json { - "count": 9, + "count": 2, "docs": [ - { - "fields": { - "_id": [ - "3" - ], - "category": [ - "/category/search/server", - "/language/java" - ], - "description": [ - "Elasticsearch is a distributed, open source search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured." - ], - "name": [ - "Elasticsearch" - ], - "popularity": [ - 46054 - ], - "timestamp": [ - "2019-12-18T23:19:00+00:00" - ], - "url": [ - "https://www.elastic.co/products/elasticsearch" - ] - }, - "score": 10.516742 - }, - { - "fields": { - "_id": [ - "1" - ], - "category": [ - "/category/search/server", - "/language/rust" - ], - "description": [ - "Bayard is a full text search and indexing server, written in Rust, built on top of Tantivy." - ], - "name": [ - "Bayard" - ], - "popularity": [ - 1152 - ], - "timestamp": [ - "2019-12-19T01:41:00+00:00" - ], - "url": [ - "https://github.com/bayard-search/bayard" - ] - }, - "score": 1.4125781 - }, { "fields": { "_id": [ @@ -124,179 +70,41 @@ You'll see the result in JSON format. The result of the above command is: "https://github.com/tantivy-search/tantivy" ] }, - "score": 1.4125781 + "score": 1.5945008 }, { "fields": { "_id": [ - "6" - ], - "category": [ - "/category/search/server", - "/language/rust" - ], - "description": [ - "Toshi is meant to be a full-text search engine similar to Elasticsearch. Toshi strives to be to Elasticsearch what Tantivy is to Lucene." - ], - "name": [ - "Toshi" - ], - "popularity": [ - 2448 - ], - "timestamp": [ - "2019-12-01T19:00:00+00:00" - ], - "url": [ - "https://github.com/toshi-search/Toshi" - ] - }, - "score": 1.389255 - }, - { - "fields": { - "_id": [ - "11" - ], - "category": [ - "/category/search/library", - "/language/python" - ], - "description": [ - "Whoosh is a fast, pure Python search engine library." - ], - "name": [ - "Whoosh" - ], - "popularity": [ - 0 - ], - "timestamp": [ - "2019-10-07T20:30:26+00:00" - ], - "url": [ - "https://bitbucket.org/mchaput/whoosh/wiki/Home" - ] - }, - "score": 0.2778122 - }, - { - "fields": { - "_id": [ - "7" + "1" ], "category": [ "/category/search/server", "/language/rust" ], "description": [ - "Sonic is a fast, lightweight and schema-less search backend." - ], - "name": [ - "Sonic" - ], - "popularity": [ - 7895 - ], - "timestamp": [ - "2019-12-10T14:13:00+00:00" - ], - "url": [ - "https://github.com/valeriansaliou/sonic" - ] - }, - "score": 0.2778122 - }, - { - "fields": { - "_id": [ - "4" - ], - "category": [ - "/category/search/server", - "/language/go" - ], - "description": [ - "Blast is a full text search and indexing server, written in Go, built on top of Bleve." - ], - "name": [ - "Blast" - ], - "popularity": [ - 654 - ], - "timestamp": [ - "2019-10-18T10:50:00+00:00" - ], - "url": [ - "https://github.com/mosuka/blast" - ] - }, - "score": 0.23746987 - }, - { - "fields": { - "_id": [ - "5" - ], - "category": [ - "/category/search/server", - "/language/go" - ], - "description": [ - "Riot is Go Open Source, Distributed, Simple and efficient full text search engine." - ], - "name": [ - "Riot" - ], - "popularity": [ - 4948 - ], - "timestamp": [ - "2019-12-15T22:12:00+00:00" - ], - "url": [ - "https://github.com/go-ego/riot" - ] - }, - "score": 0.23746987 - }, - { - "fields": { - "_id": [ - "9" - ], - "category": [ - "/category/search/library", - "/language/java" - ], - "description": [ - "Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java." + "Bayard is a full text search and indexing server, written in Rust, built on top of Tantivy." ], "name": [ - "Lucene" + "Bayard" ], "popularity": [ - 3135 + 1152 ], "timestamp": [ - "2019-12-19T05:08:00+00:00" + "2019-12-19T01:41:00+00:00" ], "url": [ - "https://lucene.apache.org/" + "https://github.com/bayard-search/bayard" ] }, - "score": 0.22139496 + "score": 1.5945008 } ], "facet": { "category": { - "/language/java": 2, - "/language/python": 1, - "/category/search/library": 3, - "/language/rust": 4, - "/category/search/server": 6, - "/language/go": 2 + "/category/search/server": 1, + "/language/rust": 2, + "/category/search/library": 1 } } } diff --git a/docs_src/reference/cli/bayard-rest.md b/docs_src/reference/cli/bayard-rest.md index cf69584..2d11ebf 100644 --- a/docs_src/reference/cli/bayard-rest.md +++ b/docs_src/reference/cli/bayard-rest.md @@ -23,6 +23,9 @@ bayard-rest [OPTIONS] - `-s`, `--server` ``      Index service address. [default: 127.0.0.1:5000] +- `-w`, `--http-worker-threads` `` +     Number of HTTP worker threads. By default http server uses number of available logical cpu as threads count. [default: 8] + ## EXAMPLES To start a server with default options: diff --git a/docs_src/reference/cli/bayard.md b/docs_src/reference/cli/bayard.md index 2cf1989..295241e 100644 --- a/docs_src/reference/cli/bayard.md +++ b/docs_src/reference/cli/bayard.md @@ -38,12 +38,15 @@ bayard [OPTIONS] [ID] - `-T`, `--tokenizer-file` ``      Tokenizer file. Must specify An existing file name. [default: ./etc/tokenizer.json] -- `-t`, `--indexer-threads` `` -     Number of indexer threads. [default: 7] +- `-t`, `--indexer-threads` `` +     Number of indexer threads. By default indexer uses number of available logical cpu as threads count. [default: 8] - `-m`, `--indexer-memory-size` ``      Total memory size (in bytes) used by the indexer. [default: 1000000000] +- `-w`, `--http-worker-threads` `` +     Number of HTTP worker threads. By default http server uses number of available logical cpu as threads count. [default: 8] + ## ARGS - ``      Node ID.