Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@yukiiiteru
Copy link
Member

Motivation

Make Volo-HTTP simple and clean.

Solution

To keep the crate simple, this commit adjusts positions of some mods:

  • Move functions from volo_http::json to volo_http::utils::json
  • Move extractor Json from volo_http::json::Json to volo_http::server::extract::Json
  • Move mod extension from volo_http::extension to volo_http::utils::extension
  • Move mod cookie from volo_http::cookie to volo_http::utils::cookie
  • Separate volo_http::server::route from route.rs into route/mod.rs, route/router.rs, route/method_router.rs and route/utils.rs

This commit introduced the following break changes:

  • Position of Json was changed, use volo_http::json::Json -> use volo_http::server::extract::Json
  • Position of Extension was changed, use volo_http::extension::Extension -> use volo_http::utils::Extension
  • Position of CookieJar was changed, use volo_http::cookie::CookieJar -> use volo_http::utils::cookie::CookieJar
  • Json and Extension were not be re-exported in volo_http, user should import them by its full path.

To keep the crate simple, this commit adjusts positions of some mods:

- Move functions from `volo_http::json` to `volo_http::utils::json`
- Move extractor `Json` from `volo_http::json::Json` to
  `volo_http::server::extract::Json`
- Move mod `extension` from `volo_http::extension` to
  `volo_http::utils::extension`
- Move mod `cookie` from `volo_http::cookie` to
  `volo_http::utils::cookie`
- Separate `volo_http::server::route` from `route.rs` into
  `route/mod.rs`, `route/router.rs`, `route/method_router.rs`
  and `route/utils.rs`

This commit introduced the following break changes:

- Position of `Json` was changed,
  `use volo_http::json::Json` -> `use volo_http::server::extract::Json`
- Position of `Extension` was changed,
  `use volo_http::extension::Extension` ->
  `use volo_http::utils::Extension`
- Position of `CookieJar` was changed,
  `use volo_http::cookie::CookieJar` ->
  `use volo_http::utils::cookie::CookieJar`
- `Json` and `Extension` were not be re-exported in `volo_http`, user
  should import them by its full path.

Signed-off-by: Yu Li <[email protected]>
@yukiiiteru yukiiiteru requested review from a team as code owners September 19, 2024 08:41
@yukiiiteru yukiiiteru merged commit 389c0f7 into cloudwego:main Sep 19, 2024
15 checks passed
@yukiiiteru yukiiiteru deleted the chore/http-mods-adjust branch September 19, 2024 08:58
@yukiiiteru yukiiiteru mentioned this pull request Nov 27, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants