Ftr: merge some mod to dubbo (#188)
* delete unuse mod, mv some code to dubbo
* style(dubbo): cargo fmt
* style(dubbo): update tracing usage
diff --git a/Cargo.toml b/Cargo.toml
index 4f96717..02c1e2f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,26 +1,12 @@
[workspace]
resolver = "2"
members = [
- "common/logger",
- "common/utils",
- "common/extention",
- "common/base",
"registry/zookeeper",
"registry/nacos",
- "metadata",
- "config",
"dubbo",
"examples/echo",
"examples/greeter",
"dubbo-build",
- "remoting/net",
- "remoting/http",
- "remoting/zookeeper",
- "remoting/base",
- "remoting/xds",
- "protocol/dubbo2",
- "protocol/base",
- "protocol/triple"
]
@@ -40,14 +26,6 @@
serde = "1"
serde_json = "1"
urlencoding = "2.1.2"
-dubbo-logger = {path="./common/logger"}
-dubbo-utils = {path="./common/utils"}
-dubbo-base = {path="./common/base"}
-remoting-net = {path="./remoting/net"}
-remoting-base = {path="./remoting/base"}
-protocol-base = {path= "protocol/base" }
-protocol-dubbo2 = {path="./protocol/dubbo2"}
-protocol-triple = {path="./protocol/triple"}
registry-zookeeper = {path="./registry/zookeeper"}
registry-nacos = {path="./registry/nacos"}
anyhow = "1.0.66"
@@ -61,6 +39,3 @@
prost-serde = "0.3.0"
prost-serde-derive = "0.1.2"
url = "2.5.0"
-
-
-
diff --git a/common/base/Cargo.toml b/common/base/Cargo.toml
deleted file mode 100644
index 678af77..0000000
--- a/common/base/Cargo.toml
+++ /dev/null
@@ -1,10 +0,0 @@
-[package]
-name = "dubbo-base"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-dubbo-logger.workspace = true
-url.workspace = true
\ No newline at end of file
diff --git a/common/base/LICENSE b/common/base/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/common/base/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/common/base/src/node.rs b/common/base/src/node.rs
deleted file mode 100644
index 1e4114e..0000000
--- a/common/base/src/node.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-use std::sync::Arc;
-
-use crate::Url;
-
-pub trait Node {
- fn get_url(&self) -> Arc<Url>;
- fn is_available(&self) -> bool;
- fn destroy(&self);
-
- fn is_destroyed(&self) -> bool;
-}
diff --git a/common/extention/Cargo.toml b/common/extention/Cargo.toml
deleted file mode 100644
index f7c688c..0000000
--- a/common/extention/Cargo.toml
+++ /dev/null
@@ -1,8 +0,0 @@
-[package]
-name = "dubbo-extention"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
diff --git a/common/extention/LICENSE b/common/extention/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/common/extention/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/common/extention/src/lib.rs b/common/extention/src/lib.rs
deleted file mode 100644
index d64452d..0000000
--- a/common/extention/src/lib.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-pub fn add(left: usize, right: usize) -> usize {
- left + right
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn it_works() {
- let result = add(2, 2);
- assert_eq!(result, 4);
- }
-}
diff --git a/common/logger/Cargo.toml b/common/logger/Cargo.toml
deleted file mode 100644
index b270828..0000000
--- a/common/logger/Cargo.toml
+++ /dev/null
@@ -1,12 +0,0 @@
-[package]
-name = "dubbo-logger"
-version = "0.3.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-tracing = "0.1"
-tracing-subscriber = "0.3"
-once_cell.workspace = true
-dubbo-utils.workspace = true
\ No newline at end of file
diff --git a/common/logger/LICENSE b/common/logger/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/common/logger/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/common/logger/README.md b/common/logger/README.md
deleted file mode 100644
index cdf7012..0000000
--- a/common/logger/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-ToDo:
-1. 日志配置器与tower集成 https://github.com/tokio-rs/tracing/tree/master/tracing-tower
-2. 与OpenTelemetry集成 https://github.com/tokio-rs/tracing/tree/master/tracing-opentelemetry
\ No newline at end of file
diff --git a/common/utils/Cargo.toml b/common/utils/Cargo.toml
deleted file mode 100644
index 2732b30..0000000
--- a/common/utils/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "dubbo-utils"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-serde_yaml.workspace = true
-serde = { workspace = true, features = ["derive"] }
-project-root = "0.2.2"
-anyhow.workspace=true
-once_cell.workspace = true
-local-ip-address = "0.5.1"
-port-selector = "0.1.6"
\ No newline at end of file
diff --git a/common/utils/LICENSE b/common/utils/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/common/utils/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/common/utils/src/host_util.rs b/common/utils/src/host_util.rs
deleted file mode 100644
index 0b029ef..0000000
--- a/common/utils/src/host_util.rs
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-use std::net::IpAddr;
-
-use port_selector::is_free;
-
-pub use port_selector::Port;
-
-// get local ip for linux/macos/windows
-#[allow(dead_code)]
-pub(crate) fn local_ip() -> IpAddr {
- local_ip_address::local_ip().unwrap()
-}
-
-#[allow(dead_code)]
-pub(crate) fn is_free_port(port: Port) -> bool {
- is_free(port)
-}
-
-// scan from the give port
-#[allow(dead_code)]
-pub(crate) fn scan_free_port(port: Port) -> Port {
- for selected_port in port..65535 {
- if is_free_port(selected_port) {
- return selected_port;
- } else {
- continue;
- }
- }
- port
-}
-
-#[cfg(test)]
-mod tests {
- use local_ip_address::list_afinet_netifas;
-
- use super::*;
-
- #[test]
- fn test_local_ip() {
- let ip = local_ip();
- println!("ip: {}", ip);
- }
-
- #[test]
- fn test_local_addresses() {
- let network_interfaces = list_afinet_netifas().unwrap();
- for (name, ip) in network_interfaces.iter() {
- println!("{}:\t{:?}", name, ip);
- }
- }
-
- #[test]
- fn test_scan_free_port() {
- let free_port = scan_free_port(7890);
- println!("{}", free_port);
- }
-}
diff --git a/common/utils/src/lib.rs b/common/utils/src/lib.rs
deleted file mode 100644
index 7a0a45b..0000000
--- a/common/utils/src/lib.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-pub mod host_util;
-pub mod path_util;
-pub mod yaml_util;
diff --git a/common/utils/src/path_util.rs b/common/utils/src/path_util.rs
deleted file mode 100644
index 347f108..0000000
--- a/common/utils/src/path_util.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-use std::{env, path::PathBuf};
-
-pub fn app_root_dir() -> PathBuf {
- match project_root::get_project_root() {
- // Cargo.lock file as app root dir
- Ok(p) => p,
- Err(_) => env::current_dir().unwrap(),
- }
-}
-
-#[cfg(test)]
-mod tests {
-
- use super::*;
-
- #[test]
- fn test_app_root_dir() {
- let dir = app_root_dir().join("application.yaml");
- println!("dir: {}", dir.display());
- }
-}
diff --git a/common/utils/tests/application.yaml b/common/utils/tests/application.yaml
deleted file mode 100644
index a40e4fe..0000000
--- a/common/utils/tests/application.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-logging:
- level: INFO
- file:
- path: /tmp/test.log
diff --git a/config/Cargo.toml b/config/Cargo.toml
deleted file mode 100644
index 628aae8..0000000
--- a/config/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-name = "dubbo-config"
-version = "0.3.0"
-edition = "2021"
-license = "Apache-2.0"
-description = "dubbo-config"
-documentation = "https://github.com/apache/dubbo-rust"
-repository = "https://github.com/apache/dubbo-rust.git"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-serde = { workspace = true, features = ["derive"] }
-serde_yaml.workspace = true
-lazy_static.workspace = true
-once_cell.workspace = true
-dubbo-utils.workspace = true
-dubbo-logger.workspace=true
\ No newline at end of file
diff --git a/config/LICENSE b/config/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/config/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/dubbo/Cargo.toml b/dubbo/Cargo.toml
index dbbb96a..d5b9a1e 100644
--- a/dubbo/Cargo.toml
+++ b/dubbo/Cargo.toml
@@ -42,11 +42,12 @@
itertools.workspace = true
urlencoding.workspace = true
lazy_static.workspace = true
-dubbo-base.workspace = true
-dubbo-logger.workspace = true
once_cell.workspace = true
-
-dubbo-config = { path = "../config", version = "0.3.0" }
+tracing = "0.1"
+tracing-subscriber = "0.3"
+project-root = "0.2.2"
+anyhow.workspace=true
+url.workspace = true
#对象存储
state = { version = "0.5", features = ["tls"] }
diff --git a/dubbo/src/cluster/failover.rs b/dubbo/src/cluster/failover.rs
index a223ddf..43d1441 100644
--- a/dubbo/src/cluster/failover.rs
+++ b/dubbo/src/cluster/failover.rs
@@ -17,7 +17,7 @@
use std::task::Poll;
-use dubbo_base::StdError;
+use crate::StdError;
use futures_util::future;
use http::Request;
use tower::{retry::Retry, util::Oneshot, ServiceExt};
diff --git a/dubbo/src/cluster/router/condition/condition_router.rs b/dubbo/src/cluster/router/condition/condition_router.rs
index 21b525a..bf54696 100644
--- a/dubbo/src/cluster/router/condition/condition_router.rs
+++ b/dubbo/src/cluster/router/condition/condition_router.rs
@@ -19,7 +19,7 @@
cluster::router::{condition::single_router::ConditionSingleRouter, Router},
codegen::RpcInvocation,
};
-use dubbo_base::Url;
+use crate::Url;
use std::{
fmt::Debug,
sync::{Arc, RwLock},
diff --git a/dubbo/src/cluster/router/condition/single_router.rs b/dubbo/src/cluster/router/condition/single_router.rs
index 54c61cb..3ba0c05 100644
--- a/dubbo/src/cluster/router/condition/single_router.rs
+++ b/dubbo/src/cluster/router/condition/single_router.rs
@@ -14,8 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-use dubbo_base::Url;
-use dubbo_logger::tracing::info;
+use crate::Url;
+use crate::logger::tracing::info;
use regex::Regex;
use std::{
collections::HashMap,
diff --git a/dubbo/src/cluster/router/manager/condition_manager.rs b/dubbo/src/cluster/router/manager/condition_manager.rs
index 7772950..e1e8f4c 100644
--- a/dubbo/src/cluster/router/manager/condition_manager.rs
+++ b/dubbo/src/cluster/router/manager/condition_manager.rs
@@ -19,7 +19,7 @@
condition_router::{ConditionRouter, ConditionSingleRouters},
single_router::ConditionSingleRouter,
};
-use dubbo_config::router::ConditionRouterConfig;
+use crate::config::router::ConditionRouterConfig;
use std::{
collections::HashMap,
sync::{Arc, RwLock},
diff --git a/dubbo/src/cluster/router/manager/router_manager.rs b/dubbo/src/cluster/router/manager/router_manager.rs
index e6c8b6c..3b794de 100644
--- a/dubbo/src/cluster/router/manager/router_manager.rs
+++ b/dubbo/src/cluster/router/manager/router_manager.rs
@@ -20,12 +20,12 @@
nacos_config_center::nacos_client::NacosClient,
router_chain::RouterChain,
};
-use dubbo_base::Url;
+use crate::Url;
use dubbo_config::{
get_global_config,
router::{ConditionRouterConfig, NacosConfig, TagRouterConfig},
};
-use dubbo_logger::tracing::{info, trace};
+use crate::logger::tracing::{info, trace};
use once_cell::sync::OnceCell;
use std::{
collections::HashMap,
diff --git a/dubbo/src/cluster/router/mod.rs b/dubbo/src/cluster/router/mod.rs
index edc081b..ddefb45 100644
--- a/dubbo/src/cluster/router/mod.rs
+++ b/dubbo/src/cluster/router/mod.rs
@@ -22,7 +22,7 @@
pub mod utils;
use crate::invocation::RpcInvocation;
-use dubbo_base::Url;
+use crate::Url;
use std::{fmt::Debug, sync::Arc};
pub trait Router: Debug {
diff --git a/dubbo/src/cluster/router/nacos_config_center/nacos_client.rs b/dubbo/src/cluster/router/nacos_config_center/nacos_client.rs
index 68b5f09..388c3f7 100644
--- a/dubbo/src/cluster/router/nacos_config_center/nacos_client.rs
+++ b/dubbo/src/cluster/router/nacos_config_center/nacos_client.rs
@@ -19,7 +19,7 @@
get_global_router_manager, RouterConfigChangeEvent,
};
use dubbo_config::router::NacosConfig;
-use dubbo_logger::{tracing, tracing::info};
+use crate::logger::{tracing, tracing::info};
use nacos_sdk::api::{
config::{ConfigChangeListener, ConfigResponse, ConfigService, ConfigServiceBuilder},
props::ClientProps,
diff --git a/dubbo/src/cluster/router/router_chain.rs b/dubbo/src/cluster/router/router_chain.rs
index 601bc5e..3ddd653 100644
--- a/dubbo/src/cluster/router/router_chain.rs
+++ b/dubbo/src/cluster/router/router_chain.rs
@@ -16,7 +16,7 @@
*/
use crate::{cluster::router::BoxRouter, invocation::RpcInvocation};
-use dubbo_base::Url;
+use url::Url;
use std::{collections::HashMap, sync::Arc};
#[derive(Debug, Default)]
diff --git a/dubbo/src/cluster/router/tag/tag_router.rs b/dubbo/src/cluster/router/tag/tag_router.rs
index 3d28f93..60350fc 100644
--- a/dubbo/src/cluster/router/tag/tag_router.rs
+++ b/dubbo/src/cluster/router/tag/tag_router.rs
@@ -19,7 +19,7 @@
cluster::router::{utils::to_original_map, Router},
codegen::RpcInvocation,
};
-use dubbo_base::Url;
+use crate::Url;
use dubbo_config::router::TagRouterConfig;
use std::{
collections::HashMap,
diff --git a/dubbo/src/cluster/router/utils.rs b/dubbo/src/cluster/router/utils.rs
index eca98f6..d237451 100644
--- a/dubbo/src/cluster/router/utils.rs
+++ b/dubbo/src/cluster/router/utils.rs
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-use dubbo_base::Url;
+use crate::Url;
use std::{collections::HashMap, string::String};
pub fn to_original_map(url: Url) -> HashMap<String, String> {
diff --git a/dubbo/src/codegen.rs b/dubbo/src/codegen.rs
index 77f8f5a..9277414 100644
--- a/dubbo/src/codegen.rs
+++ b/dubbo/src/codegen.rs
@@ -20,9 +20,9 @@
task::{Context, Poll},
};
+pub use crate::StdError;
pub use async_trait::async_trait;
pub use bytes::Bytes;
-pub use dubbo_base::StdError;
pub use http_body::Body;
pub use hyper::Body as hyperBody;
pub use tower_service::Service;
diff --git a/config/src/config.rs b/dubbo/src/config/config.rs
similarity index 90%
rename from config/src/config.rs
rename to dubbo/src/config/config.rs
index cf4e441..3c60683 100644
--- a/config/src/config.rs
+++ b/dubbo/src/config/config.rs
@@ -17,9 +17,11 @@
use std::{collections::HashMap, env, path::PathBuf};
-use crate::{protocol::Protocol, registry::RegistryConfig, router::RouterConfig};
-use dubbo_logger::tracing;
-use dubbo_utils::yaml_util::yaml_file_parser;
+use super::{protocol::Protocol, registry::RegistryConfig, router::RouterConfig};
+use crate::{
+ logger::tracing::{debug, error, info, warn},
+ utils::yaml_utils::yaml_file_parser,
+};
use once_cell::sync::OnceCell;
use serde::{Deserialize, Serialize};
@@ -53,7 +55,7 @@
pub fn get_global_config() -> &'static RootConfig {
GLOBAL_ROOT_CONFIG.get_or_init(|| {
- tracing::debug!("current path: {:?}", env::current_dir());
+ debug!("current path: {:?}", env::current_dir());
RootConfig::new()
.load()
.unwrap_or_else(|err| panic!("Failed to load global config, error: {}", err))
@@ -74,16 +76,15 @@
pub fn load(&self) -> std::io::Result<Self> {
let config_path = match env::var("DUBBO_CONFIG_PATH") {
Ok(v) => {
- tracing::info!("read config_path from env: {:?}", v);
+ info!("read config_path from env: {:?}", v);
v
}
Err(err) => {
- tracing::warn!(
+ warn!(
"error loading config_path: {:?}, use default path: {:?}",
- err,
- DUBBO_CONFIG_PATH
+ err, DUBBO_CONFIG_PATH
);
- dubbo_utils::path_util::app_root_dir()
+ crate::app_root_dir()
.join(DUBBO_CONFIG_PATH)
.to_str()
.unwrap()
@@ -94,7 +95,7 @@
let conf: HashMap<String, RootConfig> =
yaml_file_parser(PathBuf::new().join(config_path)).unwrap();
let root_config: RootConfig = conf.get(DUBBO_CONFIG_PREFIX).unwrap().clone();
- tracing::debug!("origin config: {:?}", conf);
+ debug!("origin config: {:?}", conf);
Ok(root_config)
}
@@ -151,7 +152,7 @@
Some(val) => match val.parse::<bool>() {
Ok(v) => v,
Err(_err) => {
- tracing::error!("key: {}, val: {} is not boolean", key, val);
+ error!("key: {}, val: {} is not boolean", key, val);
false
}
},
@@ -178,6 +179,8 @@
#[cfg(test)]
mod tests {
+ use crate::logger;
+
use super::*;
#[test]
@@ -188,7 +191,7 @@
#[test]
fn test_load() {
- dubbo_logger::init();
+ logger::init();
let r = RootConfig::new();
let r = r.load().unwrap();
println!("{:#?}", r);
diff --git a/config/src/lib.rs b/dubbo/src/config/mod.rs
similarity index 100%
rename from config/src/lib.rs
rename to dubbo/src/config/mod.rs
diff --git a/config/src/protocol.rs b/dubbo/src/config/protocol.rs
similarity index 100%
rename from config/src/protocol.rs
rename to dubbo/src/config/protocol.rs
diff --git a/config/src/provider.rs b/dubbo/src/config/provider.rs
similarity index 100%
rename from config/src/provider.rs
rename to dubbo/src/config/provider.rs
diff --git a/config/src/registry.rs b/dubbo/src/config/registry.rs
similarity index 100%
rename from config/src/registry.rs
rename to dubbo/src/config/registry.rs
diff --git a/config/src/router.rs b/dubbo/src/config/router.rs
similarity index 100%
rename from config/src/router.rs
rename to dubbo/src/config/router.rs
diff --git a/config/src/service.rs b/dubbo/src/config/service.rs
similarity index 100%
rename from config/src/service.rs
rename to dubbo/src/config/service.rs
diff --git a/dubbo/src/context.rs b/dubbo/src/context.rs
index 268dee0..d716bee 100644
--- a/dubbo/src/context.rs
+++ b/dubbo/src/context.rs
@@ -21,7 +21,7 @@
thread,
};
-use dubbo_logger::tracing;
+use crate::logger::tracing::debug;
use serde_json::Value;
use state::Container;
@@ -47,7 +47,7 @@
fn get_attachments() -> Option<Arc<Mutex<HashMap<String, Value>>>> {
let local = APPLICATION_CONTEXT.try_get_local::<Arc<Mutex<HashMap<String, Value>>>>();
- tracing::debug!("{:?} - {:?}", thread::current().id(), local);
+ debug!("{:?} - {:?}", thread::current().id(), local);
match local {
Some(attachment) => Some(attachment.clone()),
diff --git a/dubbo/src/directory/mod.rs b/dubbo/src/directory/mod.rs
index ace67e6..8e8b072 100644
--- a/dubbo/src/directory/mod.rs
+++ b/dubbo/src/directory/mod.rs
@@ -26,11 +26,11 @@
codegen::{RpcInvocation, TripleInvoker},
invocation::Invocation,
invoker::{clone_invoker::CloneInvoker, NewInvoker},
+ logger::tracing::{debug, error},
param::Param,
svc::NewService,
+ StdError, Url,
};
-use dubbo_base::{StdError, Url};
-use dubbo_logger::tracing::{debug, error};
use futures_util::future;
use tokio::sync::mpsc::channel;
use tokio_stream::wrappers::ReceiverStream;
@@ -40,8 +40,10 @@
ServiceExt,
};
-use crate::extension::registry_extension::{proxy::RegistryProxy, Registry};
-use dubbo_base::registry_param::InterfaceName;
+use crate::{
+ extension::registry_extension::{proxy::RegistryProxy, Registry},
+ params::registry_param::InterfaceName,
+};
use tower_service::Service;
type BufferedDirectory =
diff --git a/dubbo/src/extension/mod.rs b/dubbo/src/extension/mod.rs
index c1d0395..1229ff4 100644
--- a/dubbo/src/extension/mod.rs
+++ b/dubbo/src/extension/mod.rs
@@ -18,10 +18,13 @@
pub mod registry_extension;
use crate::{
- extension::registry_extension::proxy::RegistryProxy, registry::registry::StaticRegistry,
+ extension::registry_extension::proxy::RegistryProxy,
+ logger::tracing::{error, info},
+ params::extension_param::ExtensionType,
+ registry::registry::StaticRegistry,
+ url::UrlParam,
+ StdError, Url,
};
-use dubbo_base::{extension_param::ExtensionType, url::UrlParam, StdError, Url};
-use dubbo_logger::tracing::{error, info};
use std::{future::Future, pin::Pin, sync::Arc};
use thiserror::Error;
use tokio::sync::{oneshot, RwLock};
diff --git a/dubbo/src/extension/registry_extension.rs b/dubbo/src/extension/registry_extension.rs
index b1f75ba..d625f02 100644
--- a/dubbo/src/extension/registry_extension.rs
+++ b/dubbo/src/extension/registry_extension.rs
@@ -22,8 +22,10 @@
use tokio::sync::mpsc::Receiver;
use tower::discover::Change;
-use dubbo_base::{
- extension_param::ExtensionName, registry_param::RegistryUrl, url::UrlParam, StdError, Url,
+use crate::{
+ params::{extension_param::ExtensionName, registry_param::RegistryUrl},
+ url::UrlParam,
+ StdError, Url,
};
use proxy::RegistryProxy;
@@ -192,8 +194,7 @@
use thiserror::Error;
use tokio::sync::oneshot;
- use dubbo_base::{StdError, Url};
- use dubbo_logger::tracing::error;
+ use crate::{logger::tracing::error, StdError, Url};
use crate::extension::registry_extension::{DiscoverStream, Registry};
diff --git a/dubbo/src/filter/context.rs b/dubbo/src/filter/context.rs
index 8551fe7..5b303cf 100644
--- a/dubbo/src/filter/context.rs
+++ b/dubbo/src/filter/context.rs
@@ -17,7 +17,7 @@
use std::time::{SystemTime, UNIX_EPOCH};
-use dubbo_logger::tracing;
+use crate::logger::tracing::debug;
use serde_json::Value;
use crate::{
@@ -55,7 +55,7 @@
dead_line_in_nanos = time + timeout;
}
- tracing::debug!(
+ debug!(
"ContextFilter tri-timeout-deadline-in-nanos : {}",
dead_line_in_nanos
);
diff --git a/dubbo/src/filter/timeout.rs b/dubbo/src/filter/timeout.rs
index f007665..9d7ba4d 100644
--- a/dubbo/src/filter/timeout.rs
+++ b/dubbo/src/filter/timeout.rs
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-use dubbo_logger::tracing;
+use crate::logger::tracing::debug;
use std::time::{SystemTime, UNIX_EPOCH};
use crate::{
@@ -51,10 +51,9 @@
.parse()
.unwrap();
- tracing::debug!(
+ debug!(
"TimeoutFilter tri-timeout-deadline-in-nanos : {}, current-nanos:{}",
- tri_timeout_deadline_in_nanos,
- current_nanos
+ tri_timeout_deadline_in_nanos, current_nanos
);
if tri_timeout_deadline_in_nanos - current_nanos <= 0 {
return Err(Status::new(Code::DeadlineExceeded, String::from("Timeout")));
diff --git a/dubbo/src/framework.rs b/dubbo/src/framework.rs
index f3c6dc1..5cfc311 100644
--- a/dubbo/src/framework.rs
+++ b/dubbo/src/framework.rs
@@ -18,14 +18,14 @@
use std::{collections::HashMap, error::Error, pin::Pin};
use crate::{
+ config::{get_global_config, protocol::ProtocolRetrieve, RootConfig},
extension,
extension::registry_extension::Registry,
+ logger::tracing::{debug, info},
protocol::{BoxExporter, Protocol},
registry::protocol::RegistryProtocol,
+ Url,
};
-use dubbo_base::Url;
-use dubbo_config::{get_global_config, protocol::ProtocolRetrieve, RootConfig};
-use dubbo_logger::tracing;
use futures::{future, Future};
// Invoker是否可以基于hyper写一个通用的
@@ -66,10 +66,10 @@
}
let root_config = self.config.as_ref().unwrap();
- tracing::debug!("global conf: {:?}", root_config);
+ debug!("global conf: {:?}", root_config);
// env::set_var("ZOOKEEPER_SERVERS",root_config);
for (_, service_config) in root_config.provider.services.iter() {
- tracing::info!("init service name: {}", service_config.interface);
+ info!("init service name: {}", service_config.interface);
let url = if root_config
.protocols
.contains_key(service_config.protocol.as_str())
@@ -84,12 +84,12 @@
interface_name,
interface_name
);
- tracing::info!("protocol_url: {:?}", protocol_url);
+ info!("protocol_url: {:?}", protocol_url);
protocol_url.parse().ok()
} else {
return Err(format!("base {:?} not exists", service_config.protocol).into());
};
- tracing::info!("url: {:?}", url);
+ info!("url: {:?}", url);
if url.is_none() {
continue;
}
@@ -109,7 +109,7 @@
pub async fn start(&mut self) {
self.init().unwrap();
- tracing::info!("starting...");
+ info!("starting...");
// TODO: server registry
let mut registry_extensions = Vec::new();
@@ -130,7 +130,7 @@
let mut async_vec: Vec<Pin<Box<dyn Future<Output = BoxExporter> + Send>>> = Vec::new();
for (name, items) in self.protocols.iter() {
for url in items.iter() {
- tracing::info!("base: {:?}, service url: {:?}", name, url);
+ info!("base: {:?}, service url: {:?}", name, url);
let exporter = mem_reg.clone().export(url.to_owned());
async_vec.push(exporter);
diff --git a/dubbo/src/invoker/clone_body.rs b/dubbo/src/invoker/clone_body.rs
index 913910a..9d4a76b 100644
--- a/dubbo/src/invoker/clone_body.rs
+++ b/dubbo/src/invoker/clone_body.rs
@@ -24,7 +24,7 @@
use bytes::{Buf, BufMut, Bytes, BytesMut};
use futures_core::ready;
-use dubbo_base::StdError;
+use crate::StdError;
use http::HeaderMap;
use http_body::Body;
use pin_project::pin_project;
diff --git a/dubbo/src/invoker/clone_invoker.rs b/dubbo/src/invoker/clone_invoker.rs
index 557d76e..019d0ee 100644
--- a/dubbo/src/invoker/clone_invoker.rs
+++ b/dubbo/src/invoker/clone_invoker.rs
@@ -16,8 +16,7 @@
*/
use std::{mem, pin::Pin, task::Poll};
-use dubbo_base::StdError;
-use dubbo_logger::tracing::debug;
+use crate::{logger::tracing::debug, StdError};
use futures_core::{future::BoxFuture, ready, Future, TryFuture};
use futures_util::FutureExt;
use pin_project::pin_project;
diff --git a/dubbo/src/lib.rs b/dubbo/src/lib.rs
index 1a521a2..e5f0109 100644
--- a/dubbo/src/lib.rs
+++ b/dubbo/src/lib.rs
@@ -17,6 +17,7 @@
pub mod cluster;
pub mod codegen;
+pub mod config;
pub mod context;
pub mod directory;
pub mod extension;
@@ -25,23 +26,28 @@
pub mod invocation;
pub mod invoker;
pub mod loadbalancer;
+pub mod logger;
pub mod param;
+pub mod params;
pub mod protocol;
pub mod registry;
pub mod route;
pub mod status;
pub mod svc;
pub mod triple;
+pub mod url;
pub mod utils;
use http_body::Body;
-use std::{future::Future, pin::Pin};
+use std::{env, future::Future, path::PathBuf, pin::Pin};
+pub use crate::url::Url;
pub use framework::Dubbo;
pub type BoxFuture<T, E> = self::Pin<Box<dyn self::Future<Output = Result<T, E>> + Send + 'static>>;
pub(crate) type Error = Box<dyn std::error::Error + Send + Sync>;
pub type BoxBody = http_body::combinators::UnsyncBoxBody<bytes::Bytes, self::status::Status>;
+pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
pub fn empty_body() -> BoxBody {
http_body::Empty::new()
@@ -59,3 +65,11 @@
})
.boxed_unsync()
}
+
+pub fn app_root_dir() -> PathBuf {
+ match project_root::get_project_root() {
+ // Cargo.lock file as app root dir
+ Ok(p) => p,
+ Err(_) => env::current_dir().unwrap(),
+ }
+}
diff --git a/dubbo/src/loadbalancer/mod.rs b/dubbo/src/loadbalancer/mod.rs
index 74f2217..6f4ec89 100644
--- a/dubbo/src/loadbalancer/mod.rs
+++ b/dubbo/src/loadbalancer/mod.rs
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-use dubbo_base::StdError;
+use crate::StdError;
use futures_core::future::BoxFuture;
use tower::{discover::ServiceList, ServiceExt};
use tower_service::Service;
diff --git a/common/logger/src/level.rs b/dubbo/src/logger/level.rs
similarity index 98%
rename from common/logger/src/level.rs
rename to dubbo/src/logger/level.rs
index 097f105..65f4aeb 100644
--- a/common/logger/src/level.rs
+++ b/dubbo/src/logger/level.rs
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-use crate::Level;
+use super::Level;
pub(crate) struct LevelWrapper {
pub(crate) inner: Level,
diff --git a/common/logger/src/lib.rs b/dubbo/src/logger/mod.rs
similarity index 100%
rename from common/logger/src/lib.rs
rename to dubbo/src/logger/mod.rs
diff --git a/common/logger/src/tracing_configurer.rs b/dubbo/src/logger/tracing_configurer.rs
similarity index 81%
rename from common/logger/src/tracing_configurer.rs
rename to dubbo/src/logger/tracing_configurer.rs
index 1d546c8..7445e8e 100644
--- a/common/logger/src/tracing_configurer.rs
+++ b/dubbo/src/logger/tracing_configurer.rs
@@ -17,16 +17,14 @@
// https://github.com/tokio-rs/tracing/issues/971
-use crate::level::LevelWrapper;
-use dubbo_utils::{path_util, yaml_util};
+use super::level::LevelWrapper;
+use crate::{app_root_dir, utils::yaml_utils};
use std::path::PathBuf;
use tracing::debug;
pub(crate) fn default() {
- let path_buf = PathBuf::new()
- .join(path_util::app_root_dir())
- .join("application.yaml");
- let level: LevelWrapper = yaml_util::yaml_key_reader(path_buf, "logging.level")
+ let path_buf = PathBuf::new().join(app_root_dir()).join("application.yaml");
+ let level: LevelWrapper = yaml_utils::yaml_key_reader(path_buf, "logging.level")
.unwrap()
.into();
tracing_subscriber::fmt()
diff --git a/common/base/src/constants.rs b/dubbo/src/params/constants.rs
similarity index 100%
rename from common/base/src/constants.rs
rename to dubbo/src/params/constants.rs
diff --git a/common/base/src/extension_param.rs b/dubbo/src/params/extension_param.rs
similarity index 100%
rename from common/base/src/extension_param.rs
rename to dubbo/src/params/extension_param.rs
diff --git a/common/base/src/lib.rs b/dubbo/src/params/mod.rs
similarity index 86%
rename from common/base/src/lib.rs
rename to dubbo/src/params/mod.rs
index dcc9256..9b33832 100644
--- a/common/base/src/lib.rs
+++ b/dubbo/src/params/mod.rs
@@ -20,11 +20,4 @@
)]
pub mod constants;
pub mod extension_param;
-pub mod node;
pub mod registry_param;
-pub mod url;
-
-pub use node::Node;
-pub use url::Url;
-
-pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
diff --git a/common/base/src/registry_param.rs b/dubbo/src/params/registry_param.rs
similarity index 100%
rename from common/base/src/registry_param.rs
rename to dubbo/src/params/registry_param.rs
diff --git a/dubbo/src/protocol/mod.rs b/dubbo/src/protocol/mod.rs
index 7dbf1f3..6af186f 100644
--- a/dubbo/src/protocol/mod.rs
+++ b/dubbo/src/protocol/mod.rs
@@ -21,7 +21,7 @@
use aws_smithy_http::body::SdkBody;
use tower_service::Service;
-use dubbo_base::Url;
+use crate::Url;
pub mod server_desc;
pub mod triple;
diff --git a/dubbo/src/protocol/triple/triple_invoker.rs b/dubbo/src/protocol/triple/triple_invoker.rs
index cb6b08c..29704f5 100644
--- a/dubbo/src/protocol/triple/triple_invoker.rs
+++ b/dubbo/src/protocol/triple/triple_invoker.rs
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-use dubbo_base::Url;
+use crate::Url;
use http::{HeaderValue, Uri};
use std::{
fmt::{Debug, Formatter},
diff --git a/dubbo/src/protocol/triple/triple_protocol.rs b/dubbo/src/protocol/triple/triple_protocol.rs
index 27174ba..945a9f8 100644
--- a/dubbo/src/protocol/triple/triple_protocol.rs
+++ b/dubbo/src/protocol/triple/triple_protocol.rs
@@ -17,13 +17,16 @@
use std::collections::HashMap;
-use async_trait::async_trait;
-use dubbo_base::{registry_param::InterfaceName, url::UrlParam, Url};
-
use super::{
triple_exporter::TripleExporter, triple_invoker::TripleInvoker, triple_server::TripleServer,
};
-use crate::protocol::{BoxExporter, Protocol};
+use crate::{
+ params::registry_param::InterfaceName,
+ protocol::{BoxExporter, Protocol},
+ url::UrlParam,
+ Url,
+};
+use async_trait::async_trait;
#[derive(Clone)]
pub struct TripleProtocol {
diff --git a/dubbo/src/protocol/triple/triple_server.rs b/dubbo/src/protocol/triple/triple_server.rs
index 89f959c..372448b 100644
--- a/dubbo/src/protocol/triple/triple_server.rs
+++ b/dubbo/src/protocol/triple/triple_server.rs
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-use crate::triple::server::builder::ServerBuilder;
-use dubbo_base::Url;
+use crate::{triple::server::builder::ServerBuilder, Url};
#[derive(Default, Clone)]
pub struct TripleServer {
diff --git a/dubbo/src/registry/memory_registry.rs b/dubbo/src/registry/memory_registry.rs
index 093c16e..a705863 100644
--- a/dubbo/src/registry/memory_registry.rs
+++ b/dubbo/src/registry/memory_registry.rs
@@ -16,13 +16,13 @@
*/
-use dubbo_logger::tracing::debug;
+use crate::logger::tracing::debug;
use std::{
collections::HashMap,
sync::{Arc, RwLock},
};
-use dubbo_base::Url;
+use crate::Url;
use super::{NotifyListener, Registry, RegistryNotifyListener};
@@ -68,7 +68,7 @@
Ok(())
}
- fn unregister(&mut self, url: dubbo_base::Url) -> Result<(), crate::StdError> {
+ fn unregister(&mut self, url: crate::Url) -> Result<(), crate::StdError> {
let registry_group = match url.get_param(REGISTRY_GROUP_KEY) {
Some(key) => key,
None => "dubbo".to_string(),
@@ -87,7 +87,7 @@
fn subscribe(
&self,
- url: dubbo_base::Url,
+ url: crate::Url,
listener: RegistryNotifyListener,
) -> Result<(), crate::StdError> {
todo!()
@@ -95,7 +95,7 @@
fn unsubscribe(
&self,
- url: dubbo_base::Url,
+ url: crate::Url,
listener: RegistryNotifyListener,
) -> Result<(), crate::StdError> {
todo!()
diff --git a/dubbo/src/registry/mod.rs b/dubbo/src/registry/mod.rs
index ac4c012..3c4d665 100644
--- a/dubbo/src/registry/mod.rs
+++ b/dubbo/src/registry/mod.rs
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-use crate::{extension, extension::registry_extension::proxy::RegistryProxy};
-use dubbo_base::{StdError, Url};
+use crate::{extension, extension::registry_extension::proxy::RegistryProxy, StdError, Url};
use std::{
future::Future,
pin::Pin,
diff --git a/dubbo/src/registry/protocol.rs b/dubbo/src/registry/protocol.rs
index f909988..dee9498 100644
--- a/dubbo/src/registry/protocol.rs
+++ b/dubbo/src/registry/protocol.rs
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-use dubbo_base::{registry_param::InterfaceName, url::UrlParam, Url};
-use dubbo_logger::tracing;
+use crate::{logger::tracing::error, params::registry_param::InterfaceName, url::UrlParam, Url};
use std::{
collections::HashMap,
sync::{Arc, RwLock},
@@ -91,7 +90,7 @@
return pro.export(url).await;
}
_ => {
- tracing::error!("base {:?} not implemented", url.protocol());
+ error!("base {:?} not implemented", url.protocol());
Box::new(TripleExporter::new())
}
}
diff --git a/dubbo/src/registry/registry.rs b/dubbo/src/registry/registry.rs
index 2fc8258..c5122da 100644
--- a/dubbo/src/registry/registry.rs
+++ b/dubbo/src/registry/registry.rs
@@ -24,9 +24,11 @@
Mutex,
};
-use dubbo_base::{
- extension_param::{ExtensionName, ExtensionType},
- registry_param::{InterfaceName, RegistryUrl, StaticInvokerUrls},
+use crate::{
+ params::{
+ extension_param::{ExtensionName, ExtensionType},
+ registry_param::{InterfaceName, RegistryUrl, StaticInvokerUrls},
+ },
url::UrlParam,
StdError, Url,
};
diff --git a/dubbo/src/route/mod.rs b/dubbo/src/route/mod.rs
index 28dfda7..b369d83 100644
--- a/dubbo/src/route/mod.rs
+++ b/dubbo/src/route/mod.rs
@@ -17,8 +17,7 @@
use std::pin::Pin;
-use dubbo_base::StdError;
-use dubbo_logger::tracing::debug;
+use crate::{logger::tracing::debug, StdError};
use futures_core::{ready, Future};
use futures_util::{future::Ready, FutureExt, TryFutureExt};
use tower::{buffer::Buffer, util::FutureService};
diff --git a/dubbo/src/triple/client/builder.rs b/dubbo/src/triple/client/builder.rs
index 94c855b..ce0fa66 100644
--- a/dubbo/src/triple/client/builder.rs
+++ b/dubbo/src/triple/client/builder.rs
@@ -22,9 +22,11 @@
route::NewRoutes, utils::boxed_clone::BoxCloneService,
};
-use crate::registry::{registry::StaticRegistry, MkRegistryService};
+use crate::{
+ registry::{registry::StaticRegistry, MkRegistryService},
+ Url,
+};
use aws_smithy_http::body::SdkBody;
-use dubbo_base::Url;
use tower::ServiceBuilder;
pub type ClientBoxService =
diff --git a/dubbo/src/triple/decode.rs b/dubbo/src/triple/decode.rs
index 5b5df84..846427e 100644
--- a/dubbo/src/triple/decode.rs
+++ b/dubbo/src/triple/decode.rs
@@ -17,8 +17,8 @@
use std::{pin::Pin, task::Poll};
+use crate::logger::tracing::error;
use bytes::{Buf, BufMut, Bytes, BytesMut};
-use dubbo_logger::tracing;
use futures_util::{future, ready, Stream};
use http_body::Body;
@@ -265,7 +265,7 @@
self.trailers = trailer.map(Metadata::from_headers);
}
Err(err) => {
- tracing::error!("poll_trailers, err: {}", err);
+ error!("poll_trailers, err: {}", err);
}
}
diff --git a/dubbo/src/triple/server/builder.rs b/dubbo/src/triple/server/builder.rs
index b473dd8..a9d06ae 100644
--- a/dubbo/src/triple/server/builder.rs
+++ b/dubbo/src/triple/server/builder.rs
@@ -21,8 +21,12 @@
str::FromStr,
};
-use dubbo_base::{registry_param::InterfaceName, url::UrlParam, Url};
-use dubbo_logger::tracing;
+use crate::{
+ logger::tracing::{error, info, warn},
+ params::registry_param::InterfaceName,
+ url::UrlParam,
+ Url,
+};
use http::{Request, Response, Uri};
use hyper::body::Body;
use tokio_rustls::rustls::{Certificate, PrivateKey};
@@ -54,14 +58,14 @@
certs: match utils::tls::load_certs(Path::new(certs)) {
Ok(v) => v,
Err(err) => {
- tracing::error!("error loading tls certs {:?}", err);
+ error!("error loading tls certs {:?}", err);
Vec::new()
}
},
keys: match utils::tls::load_keys(Path::new(keys)) {
Ok(v) => v,
Err(err) => {
- tracing::error!("error loading tls keys {:?}", err);
+ error!("error loading tls keys {:?}", err);
Vec::new()
}
},
@@ -96,7 +100,7 @@
let lock = crate::protocol::triple::TRIPLE_SERVICES.read().unwrap();
for name in self.service_names.iter() {
if lock.get(name).is_none() {
- tracing::warn!("service ({}) not register", name);
+ warn!("service ({}) not register", name);
continue;
}
let svc = lock.get(name).unwrap();
@@ -125,7 +129,7 @@
}
pub async fn serve(self) -> Result<(), crate::Error> {
- tracing::info!("server starting. addr: {:?}", self.addr.unwrap());
+ info!("server starting. addr: {:?}", self.addr.unwrap());
self.server.serve(self.addr.unwrap()).await
}
}
@@ -135,7 +139,7 @@
let uri = match http::Uri::from_str(&u.as_str()) {
Ok(v) => v,
Err(err) => {
- tracing::error!("http uri parse error: {}, url: {:?}", err, &u);
+ error!("http uri parse error: {}, url: {:?}", err, &u);
Uri::default()
}
};
diff --git a/dubbo/src/triple/server/triple.rs b/dubbo/src/triple/server/triple.rs
index 2567b49..096550d 100644
--- a/dubbo/src/triple/server/triple.rs
+++ b/dubbo/src/triple/server/triple.rs
@@ -35,7 +35,6 @@
},
BoxBody,
};
-use dubbo_config::BusinessConfig;
pub const GRPC_ACCEPT_ENCODING: &str = "grpc-accept-encoding";
pub const GRPC_ENCODING: &str = "grpc-encoding";
@@ -326,13 +325,3 @@
Ok(compression)
}
}
-
-impl<M1, M2> BusinessConfig for TripleServer<M1, M2> {
- fn init() -> Self {
- todo!()
- }
-
- fn load() -> Result<(), std::convert::Infallible> {
- todo!()
- }
-}
diff --git a/dubbo/src/triple/transport/connection.rs b/dubbo/src/triple/transport/connection.rs
index 4369b82..060a24e 100644
--- a/dubbo/src/triple/transport/connection.rs
+++ b/dubbo/src/triple/transport/connection.rs
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-use dubbo_base::StdError;
+use crate::StdError;
use hyper::client::{conn::Builder, service::Connect};
use tower_service::Service;
diff --git a/dubbo/src/triple/transport/connector/http_connector.rs b/dubbo/src/triple/transport/connector/http_connector.rs
index 99c1a84..95bfabb 100644
--- a/dubbo/src/triple/transport/connector/http_connector.rs
+++ b/dubbo/src/triple/transport/connector/http_connector.rs
@@ -20,7 +20,7 @@
str::FromStr,
};
-use dubbo_logger::tracing;
+use crate::logger::tracing::info;
use http::Uri;
use hyper::client::connect::dns::Name;
use tokio::net::TcpStream;
@@ -81,10 +81,10 @@
let port = uri.port_u16().unwrap();
let addr = if let Ok(addr) = host.parse::<Ipv4Addr>() {
- tracing::info!("host is ip address: {:?}", host);
+ info!("host is ip address: {:?}", host);
SocketAddr::V4(SocketAddrV4::new(addr, port))
} else {
- tracing::info!("host is dns: {:?}", host);
+ info!("host is dns: {:?}", host);
let addrs = self
.resolver
.resolve(Name::from_str(host).unwrap())
diff --git a/dubbo/src/triple/transport/connector/https_connector.rs b/dubbo/src/triple/transport/connector/https_connector.rs
index eb217cb..db70736 100644
--- a/dubbo/src/triple/transport/connector/https_connector.rs
+++ b/dubbo/src/triple/transport/connector/https_connector.rs
@@ -21,7 +21,7 @@
sync::Arc,
};
-use dubbo_logger::tracing;
+use crate::logger::tracing::info;
use http::Uri;
use hyper::client::connect::dns::Name;
use rustls_native_certs::load_native_certs;
@@ -88,10 +88,10 @@
let port = uri.port_u16().unwrap();
let addr = if let Ok(addr) = host.parse::<Ipv4Addr>() {
- tracing::info!("host is ip address: {:?}", host);
+ info!("host is ip address: {:?}", host);
SocketAddr::V4(SocketAddrV4::new(addr, port))
} else {
- tracing::info!("host is dns: {:?}", host);
+ info!("host is dns: {:?}", host);
let addrs = self
.resolver
.resolve(Name::from_str(host).unwrap())
diff --git a/dubbo/src/triple/transport/connector/unix_connector.rs b/dubbo/src/triple/transport/connector/unix_connector.rs
index 1448fb9..06a0937 100644
--- a/dubbo/src/triple/transport/connector/unix_connector.rs
+++ b/dubbo/src/triple/transport/connector/unix_connector.rs
@@ -20,7 +20,7 @@
str::FromStr,
};
-use dubbo_logger::tracing;
+use crate::logger::tracing::{debug, info};
use http::Uri;
use hyper::client::connect::dns::Name;
use tokio::net::UnixStream;
@@ -81,10 +81,10 @@
let port = uri.port_u16().unwrap();
let addr = if let Ok(addr) = host.parse::<Ipv4Addr>() {
- tracing::info!("host is ip address: {:?}", host);
+ info!("host is ip address: {:?}", host);
SocketAddr::V4(SocketAddrV4::new(addr, port))
} else {
- tracing::info!("host is dns: {:?}", host);
+ info!("host is dns: {:?}", host);
let addrs = self
.resolver
.resolve(Name::from_str(host).unwrap())
@@ -99,7 +99,7 @@
addrs[0]
};
- tracing::debug!("uri:{:?}, ip:port : {}", &addr, addr.to_string());
+ debug!("uri:{:?}, ip:port : {}", &addr, addr.to_string());
let conn = UnixStream::connect(addr.to_string().replace("unix://", "")).await?;
diff --git a/dubbo/src/triple/transport/listener/mod.rs b/dubbo/src/triple/transport/listener/mod.rs
index 2b20bab..0be7415 100644
--- a/dubbo/src/triple/transport/listener/mod.rs
+++ b/dubbo/src/triple/transport/listener/mod.rs
@@ -21,8 +21,8 @@
use std::net::SocketAddr;
+use crate::logger::tracing::warn;
use async_trait::async_trait;
-use dubbo_logger::tracing;
use tokio::io::{AsyncRead, AsyncWrite};
use super::io::BoxIO;
@@ -68,7 +68,7 @@
#[cfg(any(target_os = "macos", target_os = "unix"))]
"unix" => Ok(unix_listener::UnixListener::bind(addr).await?.boxed()),
_ => {
- tracing::warn!("no support listener: {:?}", name);
+ warn!("no support listener: {:?}", name);
Err(Box::new(crate::status::DubboError::new(format!(
"no support listener: {:?}",
name
diff --git a/dubbo/src/triple/transport/listener/tcp_listener.rs b/dubbo/src/triple/transport/listener/tcp_listener.rs
index 325c77f..2f103be 100644
--- a/dubbo/src/triple/transport/listener/tcp_listener.rs
+++ b/dubbo/src/triple/transport/listener/tcp_listener.rs
@@ -18,8 +18,8 @@
use std::{net::SocketAddr, task};
use super::Listener;
+use crate::logger::tracing::error;
use async_trait::async_trait;
-use dubbo_logger::tracing;
use futures_core::Stream;
use hyper::server::accept::Accept;
use tokio::net::{TcpListener as tokioTcpListener, TcpStream};
@@ -57,7 +57,7 @@
self.inner.poll_accept(cx).map(|res| match res {
Ok(data) => Some(data.0),
Err(err) => {
- tracing::error!("TcpListener poll_next Error: {:?}", err);
+ error!("TcpListener poll_next Error: {:?}", err);
None
}
})
@@ -76,7 +76,7 @@
self.inner.poll_accept(cx).map(|res| match res {
Ok(data) => Some(Ok(data.0)),
Err(err) => {
- tracing::error!("TcpListener poll_accept Error: {:?}", err);
+ error!("TcpListener poll_accept Error: {:?}", err);
None
}
})
diff --git a/dubbo/src/triple/transport/listener/unix_listener.rs b/dubbo/src/triple/transport/listener/unix_listener.rs
index cd7dbe5..77e587c 100644
--- a/dubbo/src/triple/transport/listener/unix_listener.rs
+++ b/dubbo/src/triple/transport/listener/unix_listener.rs
@@ -18,8 +18,8 @@
use std::{net::SocketAddr, task};
use super::Listener;
+use crate::logger::tracing::error;
use async_trait::async_trait;
-use dubbo_logger::tracing;
use futures_core::Stream;
use hyper::server::accept::Accept;
use tokio::net::{UnixListener as tokioUnixListener, UnixStream};
@@ -61,7 +61,7 @@
self.inner.poll_accept(cx).map(|res| match res {
Ok(data) => Some(data.0),
Err(err) => {
- tracing::error!("UnixListener poll_next Error: {:?}", err);
+ error!("UnixListener poll_next Error: {:?}", err);
None
}
})
@@ -80,7 +80,7 @@
self.inner.poll_accept(cx).map(|res| match res {
Ok(data) => Some(Ok(data.0)),
Err(err) => {
- tracing::error!("UnixListener poll_accept Error: {:?}", err);
+ error!("UnixListener poll_accept Error: {:?}", err);
None
}
})
diff --git a/dubbo/src/triple/transport/service.rs b/dubbo/src/triple/transport/service.rs
index 11eca26..355a3f1 100644
--- a/dubbo/src/triple/transport/service.rs
+++ b/dubbo/src/triple/transport/service.rs
@@ -17,7 +17,7 @@
use std::{io, net::SocketAddr, sync::Arc};
-use dubbo_logger::tracing;
+use crate::logger::tracing::{debug, error, info};
use futures_core::Future;
use http::{Request, Response};
use hyper::body::Body;
@@ -191,7 +191,7 @@
loop {
tokio::select! {
_ = &mut signal => {
- tracing::info!("graceful shutdown");
+ info!("graceful shutdown");
break
}
res = listener.accept() => {
@@ -206,7 +206,7 @@
b = io;
}
- tracing::debug!("hyper serve, local address: {:?}", local_addr);
+ debug!("hyper serve, local address: {:?}", local_addr);
let c = hyper::server::conn::Http::new()
.http2_only(self.accept_http2)
.http2_max_concurrent_streams(self.max_concurrent_streams)
@@ -219,7 +219,7 @@
tokio::spawn(c);
},
- Err(err) => tracing::error!("hyper serve, err: {:?}", err),
+ Err(err) => error!("hyper serve, err: {:?}", err),
}
}
}
diff --git a/common/base/src/url.rs b/dubbo/src/url.rs
similarity index 97%
rename from common/base/src/url.rs
rename to dubbo/src/url.rs
index ac97f26..d15894f 100644
--- a/common/base/src/url.rs
+++ b/dubbo/src/url.rs
@@ -117,7 +117,7 @@
}
pub fn remove_query_param<T: UrlParam>(&mut self) {
- let query = self.inner.query_pairs().filter(|(k, v)| k.ne(T::name()));
+ let query = self.inner.query_pairs().filter(|(k, _v)| k.ne(T::name()));
let mut inner_url = self.inner.clone();
inner_url.query_pairs_mut().clear().extend_pairs(query);
self.inner = inner_url;
diff --git a/dubbo/src/utils/mod.rs b/dubbo/src/utils/mod.rs
index e885a96..e359284 100644
--- a/dubbo/src/utils/mod.rs
+++ b/dubbo/src/utils/mod.rs
@@ -18,3 +18,4 @@
pub mod boxed;
pub mod boxed_clone;
pub mod tls;
+pub mod yaml_utils;
diff --git a/common/utils/src/yaml_util.rs b/dubbo/src/utils/yaml_utils.rs
similarity index 95%
rename from common/utils/src/yaml_util.rs
rename to dubbo/src/utils/yaml_utils.rs
index 62a6632..756f531 100644
--- a/common/utils/src/yaml_util.rs
+++ b/dubbo/src/utils/yaml_utils.rs
@@ -66,10 +66,8 @@
use serde_yaml::Value;
use std::collections::HashMap;
- use crate::{
- path_util::app_root_dir,
- yaml_util::{yaml_file_parser, yaml_key_reader},
- };
+ use super::{yaml_file_parser, yaml_key_reader};
+ use crate::app_root_dir;
#[test]
fn test_yaml_file_parser() {
diff --git a/examples/echo/Cargo.toml b/examples/echo/Cargo.toml
index 0ad345b..00e8452 100644
--- a/examples/echo/Cargo.toml
+++ b/examples/echo/Cargo.toml
@@ -39,10 +39,8 @@
serde = { version = "1.0.171",features = ["derive"] }
async-trait = "0.1.56"
tokio-stream = "0.1"
-dubbo-logger.workspace=true
dubbo = {path = "../../dubbo"}
-dubbo-config = {path = "../../config", version = "0.3.0" }
registry-zookeeper.workspace=true
[build-dependencies]
diff --git a/examples/echo/src/echo-tls/client.rs b/examples/echo/src/echo-tls/client.rs
index 70e4e8f..426d498 100644
--- a/examples/echo/src/echo-tls/client.rs
+++ b/examples/echo/src/echo-tls/client.rs
@@ -30,7 +30,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
let builder = ClientBuilder::from_static(&"https://127.0.0.1:8889").with_timeout(1000000);
let mut cli = EchoClient::new(builder);
diff --git a/examples/echo/src/echo-tls/server.rs b/examples/echo/src/echo-tls/server.rs
index c7bcd15..b80647c 100644
--- a/examples/echo/src/echo-tls/server.rs
+++ b/examples/echo/src/echo-tls/server.rs
@@ -44,7 +44,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
register_server(EchoServerImpl {
name: "echo".to_string(),
});
diff --git a/examples/echo/src/echo/client.rs b/examples/echo/src/echo/client.rs
index 8f6a7bf..74dec98 100644
--- a/examples/echo/src/echo/client.rs
+++ b/examples/echo/src/echo/client.rs
@@ -30,7 +30,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
// let builder = ClientBuilder::new()
// .with_connector("unix")
// .with_host("unix://127.0.0.1:8888");
diff --git a/examples/echo/src/echo/server.rs b/examples/echo/src/echo/server.rs
index 010821e..7fc8f5d 100644
--- a/examples/echo/src/echo/server.rs
+++ b/examples/echo/src/echo/server.rs
@@ -46,7 +46,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
register_server(EchoServerImpl {
name: "echo".to_string(),
});
diff --git a/examples/greeter/Cargo.toml b/examples/greeter/Cargo.toml
index 37faf91..351f9c9 100644
--- a/examples/greeter/Cargo.toml
+++ b/examples/greeter/Cargo.toml
@@ -31,12 +31,9 @@
prost-serde-derive = "0.1.2"
async-trait = "0.1.56"
tokio-stream = "0.1"
-dubbo-logger = { path = "../../common/logger" }
dubbo = { path = "../../dubbo"}
-dubbo-config = { path = "../../config", version = "0.3.0" }
registry-zookeeper.workspace = true
registry-nacos.workspace = true
-dubbo-base.workspace = true
[build-dependencies]
dubbo-build = { path = "../../dubbo-build", version = "0.3.0" }
diff --git a/examples/greeter/src/greeter/client.rs b/examples/greeter/src/greeter/client.rs
index 14743ae..d2edae5 100644
--- a/examples/greeter/src/greeter/client.rs
+++ b/examples/greeter/src/greeter/client.rs
@@ -29,7 +29,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
let _ = extension::EXTENSIONS.register::<NacosRegistry>().await;
diff --git a/examples/greeter/src/greeter/server.rs b/examples/greeter/src/greeter/server.rs
index 6bdbd00..17a3ac4 100644
--- a/examples/greeter/src/greeter/server.rs
+++ b/examples/greeter/src/greeter/server.rs
@@ -23,11 +23,15 @@
use tokio::sync::mpsc;
use tokio_stream::wrappers::ReceiverStream;
-use dubbo::{codegen::*, extension, Dubbo};
-use dubbo_config::RootConfig;
-use dubbo_logger::{
- tracing::{info, span},
- Level,
+use dubbo::{
+ codegen::*,
+ config::RootConfig,
+ extension,
+ logger::{
+ tracing::{info, span},
+ Level,
+ },
+ Dubbo,
};
use protos::{
greeter_server::{register_server, Greeter},
@@ -43,7 +47,7 @@
#[tokio::main]
async fn main() {
- dubbo_logger::init();
+ dubbo::logger::init();
let span = span!(Level::DEBUG, "greeter.server");
let _enter = span.enter();
register_server(GreeterServerImpl {
diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml
deleted file mode 100644
index 967e072..0000000
--- a/metadata/Cargo.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-[package]
-name = "dubbo-metadata"
-version = "0.3.0"
-edition = "2021"
-license = "Apache-2.0"
-description = "dubbo-rust-metadata"
-repository = "https://github.com/apache/dubbo-rust.git"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
diff --git a/metadata/LICENSE b/metadata/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/metadata/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs
deleted file mode 100644
index 3e01853..0000000
--- a/metadata/src/lib.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#[cfg(test)]
-mod tests {
- #[test]
- fn it_works() {
- let result = 2 + 2;
- assert_eq!(result, 4);
- }
-}
diff --git a/protocol/triple/Cargo.toml b/protocol/triple/Cargo.toml
index e14efd8..f3f705c 100644
--- a/protocol/triple/Cargo.toml
+++ b/protocol/triple/Cargo.toml
@@ -8,4 +8,3 @@
[dependencies]
remoting-net.workspace = true
protocol-base.workspace = true
-dubbo-base.workspace = true
diff --git a/registry/nacos/Cargo.toml b/registry/nacos/Cargo.toml
index 1fa6c19..4236f9f 100644
--- a/registry/nacos/Cargo.toml
+++ b/registry/nacos/Cargo.toml
@@ -14,8 +14,6 @@
serde_json.workspace = true
serde = { workspace = true, features = ["derive"] }
anyhow.workspace = true
-dubbo-logger.workspace = true
-dubbo-base.workspace = true
tokio.workspace = true
async-trait.workspace = true
diff --git a/registry/nacos/src/lib.rs b/registry/nacos/src/lib.rs
index 9ac7022..f8ccc96 100644
--- a/registry/nacos/src/lib.rs
+++ b/registry/nacos/src/lib.rs
@@ -16,21 +16,20 @@
*/
use async_trait::async_trait;
-use dubbo_base::{StdError, Url};
+use dubbo::{url::UrlParam, StdError, Url};
use std::{collections::HashMap, sync::Arc};
use tokio::sync::mpsc;
-use dubbo::extension::{
- registry_extension::{DiscoverStream, Registry, ServiceChange},
- Extension,
-};
-use dubbo_base::{
- registry_param::{
+use dubbo::{
+ extension::{
+ registry_extension::{DiscoverStream, Registry, ServiceChange},
+ Extension,
+ },
+ logger::tracing::info,
+ params::registry_param::{
AppName, Category, Group, InterfaceName, RegistryUrl, ServiceNamespace, Version,
},
- url::UrlParam,
};
-use dubbo_logger::tracing::info;
use nacos_sdk::api::{
naming::{NamingEventListener, NamingService, NamingServiceBuilder, ServiceInstance},
props::ClientProps,
@@ -423,7 +422,7 @@
use std::thread;
use tracing::error;
- use dubbo_base::{extension_param::ExtensionName, registry_param::Side};
+ use dubbo::params::{extension_param::ExtensionName, registry_param::Side};
use tracing::metadata::LevelFilter;
use super::*;
diff --git a/registry/zookeeper/Cargo.toml b/registry/zookeeper/Cargo.toml
index ebcb269..d3f5bf1 100644
--- a/registry/zookeeper/Cargo.toml
+++ b/registry/zookeeper/Cargo.toml
@@ -15,7 +15,5 @@
serde_json.workspace = true
serde = { workspace = true, features = ["derive"] }
urlencoding.workspace = true
-dubbo-logger.workspace = true
-dubbo-base.workspace = true
tokio.workspace = true
async-trait.workspace = true
diff --git a/registry/zookeeper/src/lib.rs b/registry/zookeeper/src/lib.rs
index c9683bf..8de2bd1 100644
--- a/registry/zookeeper/src/lib.rs
+++ b/registry/zookeeper/src/lib.rs
@@ -20,17 +20,20 @@
use std::{collections::HashMap, env, sync::Arc, time::Duration};
use async_trait::async_trait;
-use dubbo_base::{
- constants::{DUBBO_KEY, LOCALHOST_IP, PROVIDERS_KEY},
+use dubbo::{
+ logger::tracing::{debug, error, info},
+ params::constants::{DUBBO_KEY, LOCALHOST_IP, PROVIDERS_KEY},
+ url::UrlParam,
StdError, Url,
};
-use dubbo_logger::tracing::{debug, error, info};
use serde::{Deserialize, Serialize};
use tokio::{select, sync::mpsc};
use zookeeper::{Acl, CreateMode, WatchedEvent, WatchedEventType, Watcher, ZooKeeper};
-use dubbo::extension::registry_extension::{DiscoverStream, Registry, ServiceChange};
-use dubbo_base::{registry_param::InterfaceName, url::UrlParam};
+use dubbo::{
+ extension::registry_extension::{DiscoverStream, Registry, ServiceChange},
+ params::registry_param::InterfaceName,
+};
// Get metadata of a service registration from a URL
// rawURL = fmt.Sprintf("%s://%s%s?%s", c.Protocol, host, c.Path, s)
diff --git a/remoting/base/Cargo.toml b/remoting/base/Cargo.toml
index ade97c1..20a7319 100644
--- a/remoting/base/Cargo.toml
+++ b/remoting/base/Cargo.toml
@@ -7,7 +7,6 @@
[dependencies]
bytes.workspace = true
-dubbo-base.workspace = true
thiserror.workspace = true
dashmap.workspace = true
protocol-base.workspace = true
diff --git a/remoting/net/Cargo.toml b/remoting/net/Cargo.toml
index fc10a21..5242b25 100644
--- a/remoting/net/Cargo.toml
+++ b/remoting/net/Cargo.toml
@@ -17,5 +17,4 @@
dashmap.workspace = true
lazy_static.workspace = true
futures.workspace = true
-dubbo-logger.workspace = true
bb8.workspace = true
diff --git a/remoting/net/src/incoming.rs b/remoting/net/src/incoming.rs
index cc6c2a5..c6176cf 100644
--- a/remoting/net/src/incoming.rs
+++ b/remoting/net/src/incoming.rs
@@ -19,7 +19,7 @@
task::{Context, Poll},
};
-use dubbo_logger::tracing;
+use logger::tracing;
use futures::Stream;
use pin_project::pin_project;
use tokio::net::TcpListener;
@@ -112,7 +112,7 @@
#[cfg(test)]
mod tests {
- use dubbo_logger::tracing::debug;
+ use logger::tracing::debug;
use tokio::{io::AsyncReadExt, net::TcpListener};
use tokio_stream::wrappers::TcpListenerStream;