Skip to content

Commit e49bc09

Browse files
authored
Combine workspace into a unicrate (#402)
Signed-off-by: Andy Lok <andylokandy@hotmail.com>
1 parent bae5ee9 commit e49bc09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+346
-655
lines changed

Cargo.toml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,20 @@ fail = "0.4"
2626
futures = { version = "0.3" }
2727
lazy_static = "1"
2828
log = "0.4"
29+
pin-project = "1"
2930
prometheus = { version = "0.13", features = ["push"], default-features = false }
31+
prost = "0.11"
3032
rand = "0.8"
3133
regex = "1"
3234
semver = "1.0"
3335
serde = "1.0"
3436
serde_derive = "1.0"
35-
slog = { version = "2.3", features = [
36-
"max_level_trace",
37-
"release_max_level_debug",
38-
] }
39-
slog-term = { version = "2.4" }
4037
thiserror = "1"
41-
tikv-client-common = { version = "0.2.0", path = "tikv-client-common" }
42-
tikv-client-pd = { version = "0.2.0", path = "tikv-client-pd" }
43-
tikv-client-proto = { version = "0.2.0", path = "tikv-client-proto" }
44-
tikv-client-store = { version = "0.2.0", path = "tikv-client-store" }
4538
tokio = { version = "1", features = ["sync", "rt-multi-thread", "macros"] }
46-
tonic = "0.9"
39+
tonic = { version = "0.9", features = ["tls"] }
4740

4841
[dev-dependencies]
42+
tempfile = "3.6"
4943
clap = "2"
5044
env_logger = "0.10"
5145
fail = { version = "0.4", features = ["failpoints"] }
@@ -59,13 +53,11 @@ serial_test = "0.5.0"
5953
simple_logger = "1"
6054
tokio = { version = "1", features = ["sync", "rt-multi-thread", "macros"] }
6155

62-
[workspace]
63-
members = [
64-
"tikv-client-common",
65-
"tikv-client-pd",
66-
"tikv-client-proto",
67-
"tikv-client-store",
68-
]
56+
[build-dependencies]
57+
glob = "0.3"
58+
tonic-build = "0.9"
59+
# Suppress doctest bug (https://stackoverflow.com/questions/66074003/how-to-turn-off-cargo-doc-test-and-compile-for-a-specific-module-in-rust)
60+
tonic-disable-doctest = "0.1.0"
6961

7062
[[test]]
7163
name = "failpoint_tests"
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
22

3+
use tonic_disable_doctest::BuilderEx;
4+
35
fn main() {
46
tonic_build::configure()
7+
.disable_doctests_for_types([".google.api.HttpRule"])
58
.build_server(false)
69
.include_file("mod.rs")
710
.compile(
811
&glob::glob("proto/*.proto")
912
.unwrap()
1013
.collect::<Result<Vec<_>, _>>()
1114
.unwrap(),
12-
&["include", "proto"],
15+
&["proto/include", "proto"],
1316
)
1417
.unwrap();
1518
}

examples/pessimistic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async fn main() {
2727
};
2828

2929
// init
30-
let client = Client::new_with_config(args.pd, config, None)
30+
let client = Client::new_with_config(args.pd, config)
3131
.await
3232
.expect("Could not connect to tikv");
3333

examples/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async fn main() -> Result<()> {
3535

3636
// When we first create a client we receive a `Connect` structure which must be resolved before
3737
// the client is actually connected and usable.
38-
let client = Client::new_with_config(args.pd, config, None).await?;
38+
let client = Client::new_with_config(args.pd, config).await?;
3939

4040
// Requests are created from the connected client. These calls return structures which
4141
// implement `Future`. This means the `Future` must be resolved before the action ever takes

examples/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async fn main() {
8989
Config::default()
9090
};
9191

92-
let txn = Client::new_with_config(args.pd, config, None)
92+
let txn = Client::new_with_config(args.pd, config)
9393
.await
9494
.expect("Could not connect to tikv");
9595

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)