Releases: cloudwego/volo
Volo-HTTP 0.2.4
What's Changed
- chore(volo-http): refactor Target of discover for more scalability by @wfly1998 in #435
Full Changelog: volo-http-0.2.3...volo-http-0.2.4
Volo-HTTP 0.2.3
What's Changed
- bugfix(volo-http): add unit tests and fix bugs for dns and tls by @wfly1998 in #429
- chore(volo-http): refactor service discover related codes by @wfly1998 in #431
- feat(volo-http): support any body or error for server by @wfly1998 in #434
Full Changelog: volo-http-0.2.2...volo-http-0.2.3
Volo-HTTP 0.2.2
What's Changed
- chore(volo-http): refactor client configs by @wfly1998 in #423
- chore: add attributes for docsrs by @wfly1998 in #427
- chore(volo-http): bump volo-http to 0.2.2 by @wfly1998 in #428
Full Changelog: volo-http-0.2.1...volo-http-0.2.2
Volo-HTTP 0.2.1
What's Changed
Features
- feat(volo-http): update url param name to path param. by @liuxin231 in #417
- feat(volo-http): add handler for timeout layer by @wfly1998 in #420
Others
- chore(volo-http): update re-exported types and cli templates by @wfly1998 in #418
- chore(ci): update ci and selftest for checking cli templates by @wfly1998 in #419
New Contributors
- @liuxin231 made their first contribution in #417
Full Changelog: volo-http-0.2.0...volo-http-0.2.1
Volo-HTTP 0.2.0
What's Changed
Features
Supports HTTP client
Volo-HTTP supports HTTP client now, you can use get
function directly, or use ClientBuilder
to build a client with some configurations.
Example is available at example-http-client.rs
Support HTTPS by rustls
or native-tls
Volo-HTTP supports HTTPS by rustls
or native-tls
.
For simple applications, you can add one of rustls
, native-tls
or native-tls-vendored
, and use volo::net::tls::ServerTlsConfig
for server or volo::net::tls::TlsConnector
for client directly without caring the difference between rustls
or native-tls
.
For advanced usage, you can use one or more features and build configs for rustls
or native-tls
and wrap them for use by your client or server.
Examples are available at http-tls-client.rs
http-tls-server.rs
.
Details
For more details, please refer:
- feat(volo-http): support http client by @wfly1998 in #350
- feat(volo-http): use generic types for resp and err by @wfly1998 in #361
- feat(volo-http): record uri and method in server stats by @wfly1998 in #366
- feat(volo-http): support request with any body by @wfly1998 in #369
- feat(volo-http): support disabling stats by @wfly1998 in #370
- feat(volo-http): support config for server and client by @wfly1998 in #372
- feat(volo-http): remove connection info, add ext for parts by @wfly1998 in #379
- feat(volo-http): support https by @wfly1998 in #385
- feat(volo-http): support default target for client by @wfly1998 in #403
- feat(volo-http): support load balance on client-side by @wfly1998 in #408
- feat(volo-http): support setting query and form for client by @wfly1998 in #409
- feat(volo-http): support path extractor by @wfly1998 in #413
Break Changes
Move server related module path
For support Client, most server related modules are moved into mod server
. For example,
volo_http::route
->volo_http::server::route
volo_http::into_response
->volo_http::server::into_response
Introduce features client
and server
Considering that most users only use one of client
or server
, we do not provide all of them by default.
We provide features client
, server
, default_client
, default_server
. The client
and server
have basic functions only, the default_
s are including functions with serde
.
For upgrading from 0.1.x
to 0.2.0
, you should add the feature default_server
.
Remove MethodRouterBuilder
The MethodRouterBuilder
is inconvenient to use when creating a MethodRouter
for more than one method or using service or service_fn
.
We refer to the implementation of axum
, provide method
and method
_service
with chained calls.
For example,
MethodRouter::builder().get(from_handler(foo)).post(from_handler(foo)).build()
->get(foo).post(foo)
MethodRouter::builder().get(from_service(Bar)).build()
->get_service(Bar)
MethodRouterBuilder::new().get(from_handler(foo)).post(from_service(Bar)).build()
->get(foo).post_service(Bar)
Remove State
At the beginning of designing the server, we referred to some designs of axum
, including State
. But we found State
to be very intrusive, which means we need to adapt it everywhere. And the State
can be replaced by many things, e.g., lazy_static
or LazyCell
. So we removed it.
Considering that we have not exposed the with_state
interface before, all break changes are removing the generic type S
and the argument state: S
for all impl FromContext
and impl FromRequest
.
In short:
impl<S> FromContext<S> for YourTypes
->impl FromContext for YourTypes
impl<S> FromRequest<S> for YourTypes
->impl FromRequest for YourTypes
Use http::request::Parts
In the previous design, we saved anything to ServerContext
(or HttpContext
in older versions) from request including method, uri, headers and peer address. But we found it is not a good design, so keep it in Parts
and only save context related data in the ServerContext
, e.g., the peer address.
So methods in FromContext
and FromRequest
should be updated like this (considering removing State
):
fn from_context(cx: &mut ServerContext, state: &S)
->fn from_context(cx: &mut ServerContext, parts: &mut Parts)
fn from_request(cx: &mut ServerContext, body: BodyIncoming, state: &S)
->fn from_request(cx: &mut ServerContext, parts: Parts, body: BodyIncoming)
Remove ConnectionInfo
We referred actix-web
and introduced ConnectionInfo
, but we found that it has many hard-coded logic when processing Forwarded
and X-Forwarded-...
. We want to provide a more flexible interface, so we removed it and introduced trait RequestPartsExt
for Parts
including function forwarded
for parse the header Forwarded
to a struct Forwarded
.
Although this is not a convenient way, but it is flexible enough. For adapting the change, you should process the Forwarded
and X-Forwarded-...
by yourself.
Remove too many re-exported types
Re-exporting too many types from other crates is not a simple and elegant design, so we removed most of them. You should import Method
, Uri
, HeaderMap
from http
(or volo_http::http
), and import Incoming
from hyper
(or volo_http::hyper::body::Incoming
).
Others
- chore(volo-http): refactor context and service for server by @wfly1998 in #354
- chore(volo-http): separate client & server, split features by @wfly1998 in #362
- chore(volo-http): only make
Route<Infallible>
as Service by @wfly1998 in #368 - chore(volo-http): support
Body::from_body
with any error by @wfly1998 in #371 - fix(volo-http): fix misspelled type and variable by @wfly1998 in #386
- chore(volo-http): refactor config of context by @wfly1998 in #387
- chore(volo-http): refactor client error by @wfly1998 in #395
- chore(volo-http): adjust stats of client and server by @wfly1998 in #396
- chore(volo-http): use elegant way for creating method router by @wfly1998 in #410
- chore(volo-http): refactor server and remove common stats by @wfly1998 in #411
- chore(volo-http): add docs for important modules by @wfly1998 in #414
Full Changelog: volo-http-0.1.18...volo-http-0.2.0
Volo-build 0.10.3
What's Changed
- feat: grpc server add from_arc by @carllhw in #401
- feat(volo-http): support default target for client by @wfly1998 in #403
- fix(volo-cli): modify the local init service path relative to the yml by @Ggiggle in #404
- fix(volo-build): oneway init service build failed by @PureWhiteWu in #405
New Contributors
Full Changelog: volo-build-0.10.1...volo-build-0.10.3
Volo-http 0.2.0-rc.4
What's Changed
Features
- support default target for client by @wfly1998 in #403
- support load balance on client-side by @wfly1998 in #408
- support setting query and form for client by @wfly1998 in #409
Chores
- chore: refactor client error by @wfly1998 in #395
- chore: adjust stats of client and server by @wfly1998 in #396
Full Changelog: volo-http-0.2.0-rc.3...volo-http-0.2.0-rc.4
Volo-Thrift 0.10.0
What's Changed
- fix(volo-grpc): fix incorrect usage of
http_body::Body
by @wfly1998 in #294 - chore(volo-grpc): use
TokioTimer
from the latesthyper-util
by @wfly1998 in #295 - fix(volo-build/volo-cli): git should use relative path instead of absolute path by @PureWhiteWu in #297
- feat(volo-http): support
any
for routing any methods by @wfly1998 in #298 - chore(volo-http): bump volo-http to 0.1.5 by @wfly1998 in #299
- feat(volo-http): support extension by @wfly1998 in #302
- feat(volo-http): support cookie by @wfly1998 in #303
- chore(volo-http): bump volo-http by @wfly1998 in #304
- fix(volo-http): fix building problem by @wfly1998 in #305
- feat(volo-http): support extract
HeaderMap
by @wfly1998 in #306 - feat(volo-cli): add subcmd for creating http project by @wfly1998 in #307
- feat(volo-http): add feature for switching json lib by @wfly1998 in #308
- chore(volo): remove nightly toolchain requirement by @Millione in #309
- feat(volo-thrift): add rpc timeout error in BasicError by @Millione in #311
- chore(volo-http): bump volo-http to 0.1.8 by @wfly1998 in #312
- feat(volo): add feature
vendored
fornative-tls
by @ii64 in #301 - chore(volo-http): use
&mut HttpContext
for extractor by @wfly1998 in #315 - chore: bump dependences by @wfly1998 in #316
- chore(volo-build): Optimized folder readable judgment by @rogerogers in #318
- feat(volo-http): support
service_fn
by @wfly1998 in #317 - chore(volo-http): unwrap request and response by @wfly1998 in #319
- opt: multiplex pool by @bobozhengsir in #313
- chore(volo-thrift): bump version v0.9.2 by @bobozhengsir in #320
- chore(volo-http): add
prelude
module by @wfly1998 in #323 - chore(volo-http): make
prelude
public by @wfly1998 in #324 - feat(volo-http): support
FromRequest
forOption<T>
by @wfly1998 in #325 - feat: support snake case style yml config by @Millione in #326
- fix(volo-build): add missing
nonstandard_snake_case
for workspace by @Millione in #327 - chore(volo-grpc): bump volo-grpc to 0.9.1 by @wfly1998 in #328
- chore(volo-http): use
HashMap
andFastStr
forParams
by @wfly1998 in #329 - chore(volo-cli): remove
async-trait
in templates by @hohowt in #332 - feat(volo-http): refactor
HttpContext
withRpcCx
by @wfly1998 in #333 - stability: remove unwrap call in volo by @Ggiggle in #310
- feat(volo-grpc): use hyper-util Client by @Millione in #335
- fix(volo-grpc): make tls example compile by @Millione in #336
- feat(volo-http): add
stat_tracer
and some server stats by @wfly1998 in #334 - fix: conn count may not be decreased if task dropped without complete(e.g. panic) by @PureWhiteWu in #337
- feat(volo-http): export
stat_tracer
function by @wfly1998 in #339 - fix(volo-http): introduce
metainfo
forserve
by @wfly1998 in #340 - feat(volo-http): support
IntoResponse
forVec<u8>
by @wfly1998 in #341 - feat(volo-http): add getter functions for server context by @wfly1998 in #342
- chore(volo-http): remove state support by @wfly1998 in #343
- chore: update roadmap by @PureWhiteWu in #344
- chore(volo-http): add new types for supporting client by @wfly1998 in #345
- chore(volo): use
MakeConnection
forMakeTransport
by @wfly1998 in #346 - remove fxhash by @Ggiggle in #347
- feat(volo-http): support stream and boxed body for
Body
by @wfly1998 in #349 - feat(volo-http): support http client by @wfly1998 in #350
- add biz error by @Ggiggle in #348
- chore: fix clippy warnings and check it in CI by @wfly1998 in #352
- chore(volo): use unix
SocketAddr
for unix socket addr by @wfly1998 in #353 - fix: should calc error size when sending error by @PureWhiteWu in #356
- fix(volo-grpc): decoding buffer didn't limit length by @PureWhiteWu in #357
- chore(volo-http): refactor context and service for server by @wfly1998 in #354
- feat(volo-http): use generic types for resp and err by @wfly1998 in #361
- chore(volo-http): separate client & server, split features by @wfly1998 in #362
- fix(volo-build): remove the last comma in method parameter list to ad… by @Ggiggle in #363
- feat: refactor error to be more clear and maintainable by @PureWhiteWu in #360
- chore: enable more lints, fix warnings, format codes by @wfly1998 in #364
- feat(volo-http): record uri and method in server stats by @wfly1998 in #366
- fix(volo-grpc): ci fail by @PureWhiteWu in #367
- chore(volo-http): only make
Route<Infallible>
as Service by @wfly1998 in #368 - feat(volo-http): support request with any body by @wfly1998 in #369
- feat(volo-http): support disabling stats by @wfly1998 in #370
- feat: common crate name config by @junhaideng in #359
- chore(volo-http): support
Body::from_body
with any error by @wfly1998 in #371 - feat(volo-http): support config for server and client by @wfly1998 in #372
- chore: add selftest script and fix clippy warnings by @wfly1998 in #374
- feat(volo-http): remove connection info, add ext for parts by @wfly1998 in #379
- feat(volo-thrift): support clone for errors by @PureWhiteWu in #380
- chore(ci): fix the latest clippy lints by @wfly1998 in #384
- feat(volo): improve TLS support by @wfly1998 in #383
- feat(volo-http): support https by @wfly1998 in #385
- fix(volo-http): fix misspelled type and variable by @wfly1998 in #386
- chore(volo-http): refactor config of context by @wfly1998 in #387
- feat(volo-thrift): support biz-error by @PureWhiteWu in #388
- feat(volo-thrift): eliminate service type for server run by @PureWhiteWu in #389
- feat: remove Copy for stats by @PureWhiteWu in #391
- feat(volo-build, volo-cli): refactor config model and correspond commands by @Ggiggle in #392
- fix(volo-grpc): update Router with new parameter syntax since matchit v0.8.0 by @zzzdong in #393
- fix(volo-cli): check if it's repeated or index conflict when add repo by @Ggiggle in #394
- chore(volo-http): refactor client error by @wfly1998 in #395
- chore(volo-http): adjust stats of client and server by @wfly1998 in #396
- feat(volo-build): add special_namings yml config by @Millione in #397
- fix(volo-build, volo-cli): allow idl git repo existing in build cache by @Ggiggle in #398
- chore: bump version to 0.10 by @PureWhiteWu in #399
- chore: update pilota to 0.11.0 by @PureWhiteWu in #400
New Contributors
- @rogerogers made their first contribution in #318
- @hohowt made their first contribution in #332
- @junhaideng made their first contribution in #359
- @zzzdong made their first contribution in #393
**Full Changelog...
Volo-gRPC 0.10.0
What's Changed
- fix(volo-grpc): fix incorrect usage of
http_body::Body
by @wfly1998 in #294 - chore(volo-grpc): use
TokioTimer
from the latesthyper-util
by @wfly1998 in #295 - fix(volo-build/volo-cli): git should use relative path instead of absolute path by @PureWhiteWu in #297
- feat(volo-http): support
any
for routing any methods by @wfly1998 in #298 - chore(volo-http): bump volo-http to 0.1.5 by @wfly1998 in #299
- feat(volo-http): support extension by @wfly1998 in #302
- feat(volo-http): support cookie by @wfly1998 in #303
- chore(volo-http): bump volo-http by @wfly1998 in #304
- fix(volo-http): fix building problem by @wfly1998 in #305
- feat(volo-http): support extract
HeaderMap
by @wfly1998 in #306 - feat(volo-cli): add subcmd for creating http project by @wfly1998 in #307
- feat(volo-http): add feature for switching json lib by @wfly1998 in #308
- chore(volo): remove nightly toolchain requirement by @Millione in #309
- feat(volo-thrift): add rpc timeout error in BasicError by @Millione in #311
- chore(volo-http): bump volo-http to 0.1.8 by @wfly1998 in #312
- feat(volo): add feature
vendored
fornative-tls
by @ii64 in #301 - chore(volo-http): use
&mut HttpContext
for extractor by @wfly1998 in #315 - chore: bump dependences by @wfly1998 in #316
- chore(volo-build): Optimized folder readable judgment by @rogerogers in #318
- feat(volo-http): support
service_fn
by @wfly1998 in #317 - chore(volo-http): unwrap request and response by @wfly1998 in #319
- opt: multiplex pool by @bobozhengsir in #313
- chore(volo-thrift): bump version v0.9.2 by @bobozhengsir in #320
- chore(volo-http): add
prelude
module by @wfly1998 in #323 - chore(volo-http): make
prelude
public by @wfly1998 in #324 - feat(volo-http): support
FromRequest
forOption<T>
by @wfly1998 in #325 - feat: support snake case style yml config by @Millione in #326
- fix(volo-build): add missing
nonstandard_snake_case
for workspace by @Millione in #327 - chore(volo-grpc): bump volo-grpc to 0.9.1 by @wfly1998 in #328
- chore(volo-http): use
HashMap
andFastStr
forParams
by @wfly1998 in #329 - chore(volo-cli): remove
async-trait
in templates by @hohowt in #332 - feat(volo-http): refactor
HttpContext
withRpcCx
by @wfly1998 in #333 - stability: remove unwrap call in volo by @Ggiggle in #310
- feat(volo-grpc): use hyper-util Client by @Millione in #335
- fix(volo-grpc): make tls example compile by @Millione in #336
- feat(volo-http): add
stat_tracer
and some server stats by @wfly1998 in #334 - fix: conn count may not be decreased if task dropped without complete(e.g. panic) by @PureWhiteWu in #337
- feat(volo-http): export
stat_tracer
function by @wfly1998 in #339 - fix(volo-http): introduce
metainfo
forserve
by @wfly1998 in #340 - feat(volo-http): support
IntoResponse
forVec<u8>
by @wfly1998 in #341 - feat(volo-http): add getter functions for server context by @wfly1998 in #342
- chore(volo-http): remove state support by @wfly1998 in #343
- chore: update roadmap by @PureWhiteWu in #344
- chore(volo-http): add new types for supporting client by @wfly1998 in #345
- chore(volo): use
MakeConnection
forMakeTransport
by @wfly1998 in #346 - remove fxhash by @Ggiggle in #347
- feat(volo-http): support stream and boxed body for
Body
by @wfly1998 in #349 - feat(volo-http): support http client by @wfly1998 in #350
- add biz error by @Ggiggle in #348
- chore: fix clippy warnings and check it in CI by @wfly1998 in #352
- chore(volo): use unix
SocketAddr
for unix socket addr by @wfly1998 in #353 - fix: should calc error size when sending error by @PureWhiteWu in #356
- fix(volo-grpc): decoding buffer didn't limit length by @PureWhiteWu in #357
- chore(volo-http): refactor context and service for server by @wfly1998 in #354
- feat(volo-http): use generic types for resp and err by @wfly1998 in #361
- chore(volo-http): separate client & server, split features by @wfly1998 in #362
- fix(volo-build): remove the last comma in method parameter list to ad… by @Ggiggle in #363
- feat: refactor error to be more clear and maintainable by @PureWhiteWu in #360
- chore: enable more lints, fix warnings, format codes by @wfly1998 in #364
- feat(volo-http): record uri and method in server stats by @wfly1998 in #366
- fix(volo-grpc): ci fail by @PureWhiteWu in #367
- chore(volo-http): only make
Route<Infallible>
as Service by @wfly1998 in #368 - feat(volo-http): support request with any body by @wfly1998 in #369
- feat(volo-http): support disabling stats by @wfly1998 in #370
- feat: common crate name config by @junhaideng in #359
- chore(volo-http): support
Body::from_body
with any error by @wfly1998 in #371 - feat(volo-http): support config for server and client by @wfly1998 in #372
- chore: add selftest script and fix clippy warnings by @wfly1998 in #374
- feat(volo-http): remove connection info, add ext for parts by @wfly1998 in #379
- feat(volo-thrift): support clone for errors by @PureWhiteWu in #380
- chore(ci): fix the latest clippy lints by @wfly1998 in #384
- feat(volo): improve TLS support by @wfly1998 in #383
- feat(volo-http): support https by @wfly1998 in #385
- fix(volo-http): fix misspelled type and variable by @wfly1998 in #386
- chore(volo-http): refactor config of context by @wfly1998 in #387
- feat(volo-thrift): support biz-error by @PureWhiteWu in #388
- feat(volo-thrift): eliminate service type for server run by @PureWhiteWu in #389
- feat: remove Copy for stats by @PureWhiteWu in #391
- feat(volo-build, volo-cli): refactor config model and correspond commands by @Ggiggle in #392
- fix(volo-grpc): update Router with new parameter syntax since matchit v0.8.0 by @zzzdong in #393
- fix(volo-cli): check if it's repeated or index conflict when add repo by @Ggiggle in #394
- chore(volo-http): refactor client error by @wfly1998 in #395
- chore(volo-http): adjust stats of client and server by @wfly1998 in #396
- feat(volo-build): add special_namings yml config by @Millione in #397
- fix(volo-build, volo-cli): allow idl git repo existing in build cache by @Ggiggle in #398
- chore: bump version to 0.10 by @PureWhiteWu in #399
- chore: update pilota to 0.11.0 by @PureWhiteWu in #400
New Contributors
- @rogerogers made their first contribution in #318
- @hohowt made their first contribution in #332
- @junhaideng made their first contribution in #359
- @zzzdong made their first contribution in #393
**Full Changelog...
Volo-cli 0.10.1
What's Changed
- feat(volo-build, volo-cli): add more hint for build by @PureWhiteWu in #402
Full Changelog: volo-cli-0.10.0...volo-cli-0.10.1