Skip to content

Commit da94cd3

Browse files
committed
Merge branch 'main' of github.com:cloudwego/volo
2 parents 1e56fa4 + 18ee8b1 commit da94cd3

37 files changed

Lines changed: 309 additions & 208 deletions

File tree

Cargo.lock

Lines changed: 189 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@ rust-version = "1.80.0"
2727
pilota = "0.11"
2828
pilota-build = "0.11"
2929
pilota-thrift-parser = "0.11"
30-
# pilota = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
31-
# pilota-build = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
32-
# pilota-thrift-parser = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
33-
3430
motore = "0.4"
35-
# motore = { git = "https://github.com/cloudwego/motore.git", branch = "main" }
36-
3731
metainfo = "0.7"
3832

3933
ahash = "0.8"
@@ -58,11 +52,11 @@ futures = "0.3"
5852
futures-util = "0.3"
5953
flate2 = "1"
6054
git2 = { version = "0.20", default-features = false }
61-
governor = "0.8"
55+
governor = "0.10"
6256
h2 = "0.4"
6357
heck = "0.5"
6458
hex = "0.4"
65-
hickory-resolver = "0.24"
59+
hickory-resolver = "0.25"
6660
http = "1"
6761
http-body = "1"
6862
http-body-util = "0.1"
@@ -110,17 +104,17 @@ serde_urlencoded = "0.7"
110104
serde_yaml = "0.9"
111105
simdutf8 = "0.1"
112106
socket2 = "0.5"
113-
sonic-rs = "0.3"
107+
sonic-rs = "0.5"
114108
syn = "2"
115-
sysinfo = "0.33"
109+
sysinfo = "0.34"
116110
tempfile = "3"
117111
thiserror = "2"
118112
tokio = "1"
119113
tokio-stream = "0.1"
120114
tokio-test = "0.4"
121115
tokio-util = "0.7"
122-
tonic = "0.12"
123-
tonic-web = "0.12"
116+
tonic = "0.13"
117+
tonic-web = "0.13"
124118
tower = "0.5"
125119
tracing = "0.1"
126120
tracing-subscriber = "0.3"
@@ -152,3 +146,10 @@ codegen-units = 1
152146
panic = 'unwind'
153147
incremental = false
154148
overflow-checks = false
149+
150+
[patch.crates-io]
151+
# pilota = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
152+
# pilota-build = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
153+
# pilota-thrift-parser = { git = "https://github.com/cloudwego/pilota.git", branch = "main" }
154+
# motore = { git = "https://github.com/cloudwego/motore.git", branch = "main" }
155+
# metainfo = { git = "https://github.com/cloudwego/metainfo.git", branch = "main"}

benchmark/src/runner/counter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ impl Counter {
103103
total
104104
)
105105
};
106-
println!("{}", result);
106+
println!("{result}");
107107
}
108108
}

benchmark/src/runner/processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ pub async fn process_request(recoder: &Recoder, req: Request) -> Response {
3535

3636
pub fn process_response(action: &str, msg: &str) {
3737
if action == REPORT_ACTION {
38-
println!("{}", msg);
38+
println!("{msg}");
3939
}
4040
}

examples/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ volo-http = { path = "../volo-http", features = [
140140
volo-gen = { path = "./volo-gen" }
141141

142142
[features]
143+
tls = ["rustls"]
144+
143145
__tls = []
144146
rustls = ["__tls", "volo/rustls", "volo-grpc/rustls", "volo-http/rustls"]
145147
native-tls = [

examples/src/grpc/grpc-web/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ fn build_request(base_uri: &str, content_type: &str, accept: &str) -> Request<Fu
4343

4444
let bytes = match content_type {
4545
"grpc-web" => encode_body(),
46-
_ => panic!("invalid content type {}", content_type),
46+
_ => panic!("invalid content type {content_type}"),
4747
};
4848

4949
Request::builder()
5050
.method(Method::POST)
51-
.header(CONTENT_TYPE, format!("application/{}", content_type))
52-
.header(ACCEPT, format!("application/{}", accept))
51+
.header(CONTENT_TYPE, format!("application/{content_type}"))
52+
.header(ACCEPT, format!("application/{accept}"))
5353
.uri(request_uri)
5454
.body(Full::new(bytes))
5555
.unwrap()

examples/src/grpc/tls/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ async fn main() {
1919
let tls_config = ClientTlsConfig::new("example.com", connector);
2020

2121
let addr: SocketAddr = "127.0.0.1:8080".parse().unwrap();
22-
let client = volo_gen::proto_gen::hello::GreeterClientBuilder::new("hello")
22+
let client = volo_gen::proto_gen::helloworld::GreeterClientBuilder::new("hello")
2323
.tls_config(tls_config)
2424
.address(addr)
2525
.build();
2626

27-
let req = volo_gen::proto_gen::hello::HelloRequest {
27+
let req = volo_gen::proto_gen::helloworld::HelloRequest {
2828
name: FastStr::from_static_str("Volo"),
2929
};
3030
let resp = client.say_hello(req).await;

examples/src/grpc/tls/server.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use volo_grpc::server::{Server, ServiceBuilder};
77

88
pub struct S;
99

10-
impl volo_gen::proto_gen::hello::Greeter for S {
10+
impl volo_gen::proto_gen::helloworld::Greeter for S {
1111
async fn say_hello(
1212
&self,
13-
req: volo_grpc::Request<volo_gen::proto_gen::hello::HelloRequest>,
14-
) -> Result<volo_grpc::Response<volo_gen::proto_gen::hello::HelloReply>, volo_grpc::Status>
13+
req: volo_grpc::Request<volo_gen::proto_gen::helloworld::HelloRequest>,
14+
) -> Result<volo_grpc::Response<volo_gen::proto_gen::helloworld::HelloReply>, volo_grpc::Status>
1515
{
16-
let resp = volo_gen::proto_gen::hello::HelloReply {
16+
let resp = volo_gen::proto_gen::helloworld::HelloReply {
1717
message: format!("Hello, {}!", req.get_ref().name).into(),
1818
};
1919
Ok(volo_grpc::Response::new(resp))
@@ -39,7 +39,9 @@ async fn main() {
3939

4040
Server::new()
4141
.tls_config(tls_config)
42-
.add_service(ServiceBuilder::new(volo_gen::proto_gen::hello::GreeterServer::new(S)).build())
42+
.add_service(
43+
ServiceBuilder::new(volo_gen::proto_gen::helloworld::GreeterServer::new(S)).build(),
44+
)
4345
.run(addr)
4446
.await
4547
.unwrap();

examples/src/http/example-http-server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async fn box_body_test() -> Body {
176176
}
177177

178178
async fn full_uri(uri: FullUri) -> String {
179-
format!("{}\n", uri)
179+
format!("{uri}\n")
180180
}
181181

182182
async fn redirect_to_index() -> Redirect {

examples/src/http/http-tls-client.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ async fn main() {
1919
let client = {
2020
let mut builder = Client::builder();
2121
builder.set_tls_config(connector);
22-
builder.build()
22+
builder.build().expect("failed to build client")
2323
};
2424

2525
let resp = client
2626
.get("https://[::1]:8080/")
27-
.expect("invalid uri")
2827
.send()
2928
.await
3029
.expect("request failed")

0 commit comments

Comments
 (0)