Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(volo-http): adjust positions of some mods #499

Merged
merged 2 commits into from
Sep 19, 2024

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