From 9a980eb6f4c7f0021febe12f240ec6eb30a33eb3 Mon Sep 17 00:00:00 2001 From: mxsm Date: Wed, 31 Jan 2024 11:24:59 +0800 Subject: [PATCH] [ISSUE #131]init broker and store crate (#132) --- Cargo.toml | 4 +++- rocketmq-broker/Cargo.toml | 15 +++++++++++++++ rocketmq-broker/src/lib.rs | 14 ++++++++++++++ rocketmq-store/Cargo.toml | 15 +++++++++++++++ rocketmq-store/src/lib.rs | 14 ++++++++++++++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 rocketmq-broker/Cargo.toml create mode 100644 rocketmq-broker/src/lib.rs create mode 100644 rocketmq-store/Cargo.toml create mode 100644 rocketmq-store/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 7522387d..c1f74dbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,12 @@ [workspace] members = [ "rocketmq", + "rocketmq-broker", "rocketmq-common", "rocketmq-macros", "rocketmq-namesrv", - "rocketmq-remoting"] + "rocketmq-remoting", + "rocketmq-store"] resolver = "2" [workspace.package] diff --git a/rocketmq-broker/Cargo.toml b/rocketmq-broker/Cargo.toml new file mode 100644 index 00000000..70193b68 --- /dev/null +++ b/rocketmq-broker/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "rocketmq-broker" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +readme.workspace = true +description.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rocketmq-broker/src/lib.rs b/rocketmq-broker/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/rocketmq-broker/src/lib.rs @@ -0,0 +1,14 @@ +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/rocketmq-store/Cargo.toml b/rocketmq-store/Cargo.toml new file mode 100644 index 00000000..54aab667 --- /dev/null +++ b/rocketmq-store/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "rocketmq-store" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true +keywords.workspace = true +readme.workspace = true +description.workspace = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/rocketmq-store/src/lib.rs b/rocketmq-store/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/rocketmq-store/src/lib.rs @@ -0,0 +1,14 @@ +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); + } +}