You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2026/03/16 11:23:35 UTC
(iggy) branch refactor-binary-1-cli created (now af8fefcb1)
This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a change to branch refactor-binary-1-cli
in repository https://gitbox.apache.org/repos/asf/iggy.git
at af8fefcb1 refactor(rust): empty iggy_binary_protocol by relocating its contents
This branch includes the following new commits:
new af8fefcb1 refactor(rust): empty iggy_binary_protocol by relocating its contents
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iggy) 01/01: refactor(rust): empty iggy_binary_protocol by relocating its contents
Posted by hg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a commit to branch refactor-binary-1-cli
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit af8fefcb1c72473a2be889585092ee2bd03ebda9
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Sun Mar 15 15:52:13 2026 +0100
refactor(rust): empty iggy_binary_protocol by relocating its contents
The binary_protocol crate contained ~95 files mixing three
unrelated concerns: domain trait definitions, binary
transport blanket impls, and CLI commands. None of this was
actual wire protocol code, blocking the crate from being
repurposed for real binary serialization.
Domain traits (Client, StreamClient, etc.), BinaryTransport,
BinaryClient, blanket impls, and the binary mapper/auth
utilities move to iggy_common - co-location required by
Rust's orphan rule for blanket impls. CLI commands (64
files) move to core/cli as a new lib+bin crate (iggy_cli).
The SDK and integration tests repoint imports accordingly.
The binary_protocol crate remains in the workspace as an
empty placeholder for future wire protocol work.
---
Cargo.lock | 29 ++++++--------
Cargo.toml | 1 +
core/binary_protocol/Cargo.toml | 14 -------
.../src/client/binary_clients/mod.rs | 44 ----------------------
core/binary_protocol/src/lib.rs | 8 ----
core/binary_protocol/src/utils/mod.rs | 20 ----------
core/cli/Cargo.toml | 14 ++++++-
core/cli/src/args/common.rs | 18 ++++-----
core/cli/src/args/mod.rs | 2 +-
core/cli/src/args/system.rs | 2 +-
.../src/commands}/binary_client/get_client.rs | 4 +-
.../src/commands}/binary_client/get_clients.rs | 4 +-
.../cli => cli/src/commands}/binary_client/mod.rs | 0
.../binary_cluster/get_cluster_metadata.rs | 4 +-
.../cli => cli/src/commands}/binary_cluster/mod.rs | 0
.../create_consumer_group.rs | 4 +-
.../delete_consumer_group.rs | 4 +-
.../binary_consumer_groups/get_consumer_group.rs | 4 +-
.../binary_consumer_groups/get_consumer_groups.rs | 4 +-
.../src/commands}/binary_consumer_groups/mod.rs | 0
.../binary_consumer_offsets/get_consumer_offset.rs | 4 +-
.../src/commands}/binary_consumer_offsets/mod.rs | 0
.../binary_consumer_offsets/set_consumer_offset.rs | 4 +-
.../src/commands}/binary_context/common.rs | 0
.../src/commands}/binary_context/get_contexts.rs | 4 +-
.../cli => cli/src/commands}/binary_context/mod.rs | 0
.../src/commands}/binary_context/use_context.rs | 4 +-
.../src/commands}/binary_message/flush_messages.rs | 4 +-
.../cli => cli/src/commands}/binary_message/mod.rs | 0
.../src/commands}/binary_message/poll_messages.rs | 4 +-
.../src/commands}/binary_message/send_messages.rs | 4 +-
.../binary_partitions/create_partitions.rs | 4 +-
.../binary_partitions/delete_partitions.rs | 4 +-
.../src/commands}/binary_partitions/mod.rs | 0
.../create_personal_access_token.rs | 4 +-
.../delete_personal_access_tokens.rs | 4 +-
.../get_personal_access_tokens.rs | 4 +-
.../commands}/binary_personal_access_tokens/mod.rs | 0
.../commands}/binary_segments/delete_segments.rs | 4 +-
.../src/commands}/binary_segments/mod.rs | 0
.../src/commands}/binary_streams/create_stream.rs | 4 +-
.../src/commands}/binary_streams/delete_stream.rs | 4 +-
.../src/commands}/binary_streams/get_stream.rs | 4 +-
.../src/commands}/binary_streams/get_streams.rs | 4 +-
.../cli => cli/src/commands}/binary_streams/mod.rs | 0
.../src/commands}/binary_streams/purge_stream.rs | 4 +-
.../src/commands}/binary_streams/update_stream.rs | 4 +-
.../src/commands}/binary_system/login.rs | 8 ++--
.../src/commands}/binary_system/logout.rs | 6 +--
.../cli => cli/src/commands}/binary_system/me.rs | 4 +-
.../cli => cli/src/commands}/binary_system/mod.rs | 0
.../cli => cli/src/commands}/binary_system/ping.rs | 4 +-
.../src/commands}/binary_system/session.rs | 0
.../src/commands}/binary_system/snapshot.rs | 4 +-
.../src/commands}/binary_system/stats.rs | 4 +-
.../src/commands}/binary_topics/create_topic.rs | 4 +-
.../src/commands}/binary_topics/delete_topic.rs | 4 +-
.../src/commands}/binary_topics/get_topic.rs | 4 +-
.../src/commands}/binary_topics/get_topics.rs | 4 +-
.../cli => cli/src/commands}/binary_topics/mod.rs | 0
.../src/commands}/binary_topics/purge_topic.rs | 4 +-
.../src/commands}/binary_topics/update_topic.rs | 4 +-
.../src/commands}/binary_users/change_password.rs | 4 +-
.../src/commands}/binary_users/create_user.rs | 4 +-
.../src/commands}/binary_users/delete_user.rs | 4 +-
.../src/commands}/binary_users/get_user.rs | 4 +-
.../src/commands}/binary_users/get_users.rs | 4 +-
.../cli => cli/src/commands}/binary_users/mod.rs | 0
.../commands}/binary_users/update_permissions.rs | 4 +-
.../src/commands}/binary_users/update_user.rs | 4 +-
.../src/cli => cli/src/commands}/cli_command.rs | 2 +-
.../src/cli => cli/src/commands}/mod.rs | 0
.../src/commands}/utils/login_session_expiry.rs | 0
.../src/cli => cli/src/commands}/utils/mod.rs | 0
core/cli/src/credentials.rs | 4 +-
.../cli/binary_segments/mod.rs => cli/src/lib.rs} | 2 +-
core/cli/src/logging.rs | 2 +-
core/cli/src/main.rs | 16 ++++----
core/common/Cargo.toml | 2 +
core/common/src/lib.rs | 14 +++++++
.../auth.rs => common/src/traits/binary_auth.rs} | 7 +---
.../src/traits}/binary_client.rs | 3 +-
.../src/traits/binary_impls/cluster.rs} | 10 ++---
.../src/traits/binary_impls/consumer_groups.rs} | 26 ++++++-------
.../src/traits/binary_impls/consumer_offsets.rs} | 17 ++++-----
.../src/traits/binary_impls/messages.rs} | 8 ++--
.../src/traits/binary_impls}/mod.rs | 24 ++++++------
.../src/traits/binary_impls/partitions.rs} | 10 ++---
.../traits/binary_impls/personal_access_tokens.rs} | 26 ++++++-------
.../src/traits/binary_impls/segments.rs} | 7 ++--
.../src/traits/binary_impls/streams.rs} | 26 ++++++-------
.../src/traits/binary_impls/system.rs} | 30 +++++++--------
.../src/traits/binary_impls/topics.rs} | 29 +++++++-------
.../src/traits/binary_impls/users.rs} | 38 +++++++++----------
.../src/traits/binary_mapper.rs} | 4 +-
.../src/traits/binary_transport.rs} | 2 +-
.../binary_clients => common/src/traits}/client.rs | 2 +-
.../src/traits}/cluster_client.rs | 2 +-
.../src/traits}/consumer_group_client.rs | 2 +-
.../src/traits}/consumer_offset_client.rs | 2 +-
.../src/traits}/message_client.rs | 4 +-
core/common/src/traits/mod.rs | 17 +++++++++
.../src/traits}/partition_client.rs | 2 +-
.../src/traits}/personal_access_token_client.rs | 4 +-
.../src/traits}/segment_client.rs | 2 +-
.../src/traits}/stream_client.rs | 2 +-
.../src/traits}/system_client.rs | 4 +-
.../src/traits}/topic_client.rs | 4 +-
.../src/traits}/user_client.rs | 4 +-
core/integration/Cargo.toml | 2 +-
core/integration/src/harness/seeds.rs | 6 +--
core/integration/tests/cli/context/common.rs | 2 +-
.../tests/cli/context/test_context_applied.rs | 2 +-
.../tests/cli/context/test_context_list_command.rs | 2 +-
.../tests/cli/context/test_context_use_command.rs | 2 +-
.../integration/tests/cli/system/test_login_cmd.rs | 2 +-
.../tests/cli/system/test_logout_cmd.rs | 2 +-
.../tests/cli/system/test_stats_command.rs | 2 +-
.../connectors/elasticsearch/elasticsearch_sink.rs | 2 +-
.../elasticsearch/elasticsearch_source.rs | 2 +-
.../tests/connectors/iceberg/iceberg_sink.rs | 2 +-
.../tests/connectors/mongodb/mongodb_sink.rs | 2 +-
.../tests/connectors/postgres/postgres_sink.rs | 2 +-
.../tests/connectors/postgres/postgres_source.rs | 2 +-
.../tests/connectors/postgres/restart.rs | 2 +-
.../tests/connectors/quickwit/quickwit_sink.rs | 2 +-
.../tests/connectors/random/random_source.rs | 2 +-
.../tests/connectors/stdout/stdout_sink.rs | 2 +-
core/sdk/Cargo.toml | 1 -
.../cli/binary_client => sdk/src/binary}/mod.rs | 3 +-
core/sdk/src/client_provider.rs | 2 +-
core/sdk/src/client_wrappers/binary_client.rs | 2 +-
.../src/client_wrappers/binary_cluster_client.rs | 2 +-
.../binary_consumer_group_client.rs | 2 +-
.../binary_consumer_offset_client.rs | 2 +-
.../src/client_wrappers/binary_message_client.rs | 2 +-
.../src/client_wrappers/binary_partition_client.rs | 2 +-
.../binary_personal_access_token_client.rs | 2 +-
.../src/client_wrappers/binary_segment_client.rs | 2 +-
.../src/client_wrappers/binary_stream_client.rs | 2 +-
.../src/client_wrappers/binary_system_client.rs | 2 +-
.../sdk/src/client_wrappers/binary_topic_client.rs | 2 +-
core/sdk/src/client_wrappers/binary_user_client.rs | 2 +-
core/sdk/src/clients/binary_cluster.rs | 2 +-
core/sdk/src/clients/binary_consumer_group.rs | 2 +-
core/sdk/src/clients/binary_consumer_offset.rs | 2 +-
core/sdk/src/clients/binary_message.rs | 2 +-
core/sdk/src/clients/binary_partitions.rs | 2 +-
.../src/clients/binary_personal_access_tokens.rs | 2 +-
core/sdk/src/clients/binary_segments.rs | 2 +-
core/sdk/src/clients/binary_streams.rs | 2 +-
core/sdk/src/clients/binary_system.rs | 2 +-
core/sdk/src/clients/binary_topics.rs | 2 +-
core/sdk/src/clients/binary_users.rs | 2 +-
core/sdk/src/clients/client.rs | 2 +-
core/sdk/src/clients/consumer.rs | 4 +-
core/sdk/src/clients/producer.rs | 2 +-
core/sdk/src/http/cluster.rs | 2 +-
core/sdk/src/http/consumer_groups.rs | 2 +-
core/sdk/src/http/consumer_offsets.rs | 2 +-
core/sdk/src/http/messages.rs | 2 +-
core/sdk/src/http/partitions.rs | 2 +-
core/sdk/src/http/personal_access_tokens.rs | 2 +-
core/sdk/src/http/segments.rs | 2 +-
core/sdk/src/http/streams.rs | 2 +-
core/sdk/src/http/system.rs | 2 +-
core/sdk/src/http/topics.rs | 2 +-
core/sdk/src/http/users.rs | 2 +-
core/sdk/src/leader_aware.rs | 2 +-
core/sdk/src/lib.rs | 1 +
core/sdk/src/prelude.rs | 10 ++---
core/sdk/src/quic/quic_client.rs | 4 +-
.../src/stream_builder/build/build_iggy_client.rs | 2 +-
core/sdk/src/tcp/tcp_client.rs | 2 +-
core/sdk/src/websocket/websocket_client.rs | 2 +-
175 files changed, 395 insertions(+), 450 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 6f4d7aa02..ad5cc0a53 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5135,7 +5135,6 @@ dependencies = [
"flume 0.12.0",
"futures",
"futures-util",
- "iggy_binary_protocol",
"iggy_common",
"mockall",
"quinn",
@@ -5216,15 +5215,23 @@ version = "0.11.2-edge.1"
dependencies = [
"ahash 0.8.12",
"anyhow",
+ "async-trait",
+ "bytes",
+ "chrono",
"clap",
"clap_complete",
+ "comfy-table",
+ "dirs",
"figlet-rs",
"iggy",
- "iggy_binary_protocol",
+ "iggy_common",
"keyring",
"passterm",
+ "serde",
+ "serde_json",
"thiserror 2.0.18",
"tokio",
+ "toml 1.0.6+spec-1.1.0",
"tracing",
"tracing-appender",
"tracing-subscriber",
@@ -5317,21 +5324,7 @@ dependencies = [
name = "iggy_binary_protocol"
version = "0.9.2-edge.1"
dependencies = [
- "anyhow",
- "async-broadcast",
- "async-trait",
- "bytes",
- "chrono",
- "comfy-table",
- "dirs",
"iggy_common",
- "keyring",
- "passterm",
- "serde",
- "serde_json",
- "tokio",
- "toml 1.0.6+spec-1.1.0",
- "tracing",
]
[[package]]
@@ -5340,6 +5333,8 @@ version = "0.9.2-edge.1"
dependencies = [
"aes-gcm",
"ahash 0.8.12",
+ "async-broadcast",
+ "async-trait",
"base64 0.22.1",
"blake3",
"bon",
@@ -5760,7 +5755,7 @@ dependencies = [
"harness_derive",
"humantime",
"iggy",
- "iggy_binary_protocol",
+ "iggy-cli",
"iggy_common",
"iggy_connector_sdk",
"keyring",
diff --git a/Cargo.toml b/Cargo.toml
index d91476771..b3ea5a2bf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -159,6 +159,7 @@ hwlocality = "1.0.0-alpha.11"
iceberg = "0.8.0"
iceberg-catalog-rest = "0.8.0"
iggy = { path = "core/sdk", version = "0.9.2-edge.1" }
+iggy-cli = { path = "core/cli", version = "0.11.2-edge.1" }
iggy_binary_protocol = { path = "core/binary_protocol", version = "0.9.2-edge.1" }
iggy_common = { path = "core/common", version = "0.9.2-edge.1" }
iggy_connector_sdk = { path = "core/connectors/sdk", version = "0.2.1-edge.1" }
diff --git a/core/binary_protocol/Cargo.toml b/core/binary_protocol/Cargo.toml
index d1fba5fcd..494839916 100644
--- a/core/binary_protocol/Cargo.toml
+++ b/core/binary_protocol/Cargo.toml
@@ -29,18 +29,4 @@ repository = "https://github.com/apache/iggy"
readme = "../../README.md"
[dependencies]
-anyhow = { workspace = true }
-async-broadcast = { workspace = true }
-async-trait = { workspace = true }
-bytes = { workspace = true }
-chrono = { workspace = true }
-comfy-table = { workspace = true, optional = false }
-dirs = { workspace = true }
iggy_common = { workspace = true }
-keyring = { workspace = true, optional = false }
-passterm = { workspace = true, optional = false }
-serde = { workspace = true }
-serde_json = { workspace = true }
-tokio = { workspace = true }
-toml = { workspace = true }
-tracing = { workspace = true }
diff --git a/core/binary_protocol/src/client/binary_clients/mod.rs b/core/binary_protocol/src/client/binary_clients/mod.rs
deleted file mode 100644
index 4e9390b5b..000000000
--- a/core/binary_protocol/src/client/binary_clients/mod.rs
+++ /dev/null
@@ -1,44 +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(crate) mod binary_client;
-pub(crate) mod client;
-pub(crate) mod cluster_client;
-pub(crate) mod consumer_group_client;
-pub(crate) mod consumer_offset_client;
-pub(crate) mod message_client;
-pub(crate) mod partition_client;
-pub(crate) mod personal_access_token_client;
-pub(crate) mod segment_client;
-pub(crate) mod stream_client;
-pub(crate) mod system_client;
-pub(crate) mod topic_client;
-pub(crate) mod user_client;
-
-pub use crate::client::binary_clients::binary_client::BinaryClient;
-pub use crate::client::binary_clients::client::Client;
-pub use crate::client::binary_clients::cluster_client::ClusterClient;
-pub use crate::client::binary_clients::consumer_group_client::ConsumerGroupClient;
-pub use crate::client::binary_clients::consumer_offset_client::ConsumerOffsetClient;
-pub use crate::client::binary_clients::message_client::MessageClient;
-pub use crate::client::binary_clients::partition_client::PartitionClient;
-pub use crate::client::binary_clients::personal_access_token_client::PersonalAccessTokenClient;
-pub use crate::client::binary_clients::segment_client::SegmentClient;
-pub use crate::client::binary_clients::stream_client::StreamClient;
-pub use crate::client::binary_clients::system_client::SystemClient;
-pub use crate::client::binary_clients::topic_client::TopicClient;
-pub use crate::client::binary_clients::user_client::UserClient;
diff --git a/core/binary_protocol/src/lib.rs b/core/binary_protocol/src/lib.rs
index 05974f223..31bd66e6e 100644
--- a/core/binary_protocol/src/lib.rs
+++ b/core/binary_protocol/src/lib.rs
@@ -15,11 +15,3 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-pub mod cli;
-mod client;
-mod utils;
-
-pub use client::binary_clients::binary_client::*;
-pub use client::binary_clients::*;
-pub use client::binary_transport::BinaryTransport;
diff --git a/core/binary_protocol/src/utils/mod.rs b/core/binary_protocol/src/utils/mod.rs
deleted file mode 100644
index 063f2e841..000000000
--- a/core/binary_protocol/src/utils/mod.rs
+++ /dev/null
@@ -1,20 +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(crate) mod auth;
-pub(crate) mod mapper;
diff --git a/core/cli/Cargo.toml b/core/cli/Cargo.toml
index eb1d1b49a..d2bbca358 100644
--- a/core/cli/Cargo.toml
+++ b/core/cli/Cargo.toml
@@ -31,6 +31,10 @@ readme = "README.md"
pkg-url = "{ repo }/releases/download/{ name }-{ version }/{ name }-{ target }{ archive-suffix }"
bin-dir = "{ bin }{ binary-ext }"
+[lib]
+name = "iggy_cli"
+path = "src/lib.rs"
+
[[bin]]
name = "iggy"
path = "src/main.rs"
@@ -42,15 +46,23 @@ login-session = ["dep:keyring"]
[dependencies]
ahash = { workspace = true }
anyhow = { workspace = true }
+async-trait = { workspace = true }
+bytes = { workspace = true }
+chrono = { workspace = true }
clap = { workspace = true }
clap_complete = { workspace = true }
+comfy-table = { workspace = true }
+dirs = { workspace = true }
figlet-rs = { workspace = true }
iggy = { workspace = true }
-iggy_binary_protocol = { workspace = true }
+iggy_common = { workspace = true }
keyring = { workspace = true, optional = true }
passterm = { workspace = true }
+serde = { workspace = true }
+serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
+toml = { workspace = true }
tracing = { workspace = true }
tracing-appender = { workspace = true }
tracing-subscriber = { workspace = true, default-features = false }
diff --git a/core/cli/src/args/common.rs b/core/cli/src/args/common.rs
index ddbc7539c..29d7f0d2e 100644
--- a/core/cli/src/args/common.rs
+++ b/core/cli/src/args/common.rs
@@ -17,15 +17,15 @@
*/
use clap::ValueEnum;
-use iggy_binary_protocol::cli::binary_client::get_clients::GetClientsOutput;
-use iggy_binary_protocol::cli::binary_cluster::get_cluster_metadata::GetClusterMetadataOutput;
-use iggy_binary_protocol::cli::binary_consumer_groups::get_consumer_groups::GetConsumerGroupsOutput;
-use iggy_binary_protocol::cli::binary_context::get_contexts::GetContextsOutput;
-use iggy_binary_protocol::cli::binary_personal_access_tokens::get_personal_access_tokens::GetPersonalAccessTokensOutput;
-use iggy_binary_protocol::cli::binary_streams::get_streams::GetStreamsOutput;
-use iggy_binary_protocol::cli::binary_system::stats::GetStatsOutput;
-use iggy_binary_protocol::cli::binary_topics::get_topics::GetTopicsOutput;
-use iggy_binary_protocol::cli::binary_users::get_users::GetUsersOutput;
+use iggy_cli::commands::binary_client::get_clients::GetClientsOutput;
+use iggy_cli::commands::binary_cluster::get_cluster_metadata::GetClusterMetadataOutput;
+use iggy_cli::commands::binary_consumer_groups::get_consumer_groups::GetConsumerGroupsOutput;
+use iggy_cli::commands::binary_context::get_contexts::GetContextsOutput;
+use iggy_cli::commands::binary_personal_access_tokens::get_personal_access_tokens::GetPersonalAccessTokensOutput;
+use iggy_cli::commands::binary_streams::get_streams::GetStreamsOutput;
+use iggy_cli::commands::binary_system::stats::GetStatsOutput;
+use iggy_cli::commands::binary_topics::get_topics::GetTopicsOutput;
+use iggy_cli::commands::binary_users::get_users::GetUsersOutput;
#[derive(Debug, Clone, Copy, ValueEnum)]
pub(crate) enum ListMode {
diff --git a/core/cli/src/args/mod.rs b/core/cli/src/args/mod.rs
index f90c20b89..99b7bbd74 100644
--- a/core/cli/src/args/mod.rs
+++ b/core/cli/src/args/mod.rs
@@ -24,7 +24,7 @@ use clap_complete::{Generator, Shell, generate};
use figlet_rs::FIGfont;
use iggy::prelude::{Args as IggyArgs, ArgsOptional as IggyArgsOptional};
-use iggy_binary_protocol::cli::binary_context::common::ContextConfig;
+use iggy_cli::commands::binary_context::common::ContextConfig;
use segment::SegmentAction;
use system::SnapshotArgs;
diff --git a/core/cli/src/args/system.rs b/core/cli/src/args/system.rs
index fb2d63f07..e4b499944 100644
--- a/core/cli/src/args/system.rs
+++ b/core/cli/src/args/system.rs
@@ -19,7 +19,7 @@
use crate::args::common::ListModeExt;
use clap::Args;
use iggy::prelude::{SnapshotCompression, SystemSnapshotType};
-use iggy_binary_protocol::cli::utils::login_session_expiry::LoginSessionExpiry;
+use iggy_cli::commands::utils::login_session_expiry::LoginSessionExpiry;
#[derive(Debug, Clone, Args)]
pub(crate) struct PingArgs {
diff --git a/core/binary_protocol/src/cli/binary_client/get_client.rs b/core/cli/src/commands/binary_client/get_client.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_client/get_client.rs
rename to core/cli/src/commands/binary_client/get_client.rs
index 50237424f..33667098e 100644
--- a/core/binary_protocol/src/cli/binary_client/get_client.rs
+++ b/core/cli/src/commands/binary_client/get_client.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::{Table, presets::ASCII_NO_BORDERS};
+use iggy_common::Client;
use iggy_common::get_client::GetClient;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_client/get_clients.rs b/core/cli/src/commands/binary_client/get_clients.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_client/get_clients.rs
rename to core/cli/src/commands/binary_client/get_clients.rs
index d956bb6b1..02708e404 100644
--- a/core/binary_protocol/src/cli/binary_client/get_clients.rs
+++ b/core/cli/src/commands/binary_client/get_clients.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_clients::GetClients;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_client/mod.rs b/core/cli/src/commands/binary_client/mod.rs
similarity index 100%
copy from core/binary_protocol/src/cli/binary_client/mod.rs
copy to core/cli/src/commands/binary_client/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_cluster/get_cluster_metadata.rs b/core/cli/src/commands/binary_cluster/get_cluster_metadata.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_cluster/get_cluster_metadata.rs
rename to core/cli/src/commands/binary_cluster/get_cluster_metadata.rs
index 4ed1d95ca..98e9ec79e 100644
--- a/core/binary_protocol/src/cli/binary_cluster/get_cluster_metadata.rs
+++ b/core/cli/src/commands/binary_cluster/get_cluster_metadata.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use tracing::{Level, event};
pub enum GetClusterMetadataOutput {
diff --git a/core/binary_protocol/src/cli/binary_cluster/mod.rs b/core/cli/src/commands/binary_cluster/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_cluster/mod.rs
rename to core/cli/src/commands/binary_cluster/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs b/core/cli/src/commands/binary_consumer_groups/create_consumer_group.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs
rename to core/cli/src/commands/binary_consumer_groups/create_consumer_group.rs
index e8fb0d876..ba3e07859 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/create_consumer_group.rs
+++ b/core/cli/src/commands/binary_consumer_groups/create_consumer_group.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::create_consumer_group::CreateConsumerGroup;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs b/core/cli/src/commands/binary_consumer_groups/delete_consumer_group.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs
rename to core/cli/src/commands/binary_consumer_groups/delete_consumer_group.rs
index bd113d7d4..32c25403e 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/delete_consumer_group.rs
+++ b/core/cli/src/commands/binary_consumer_groups/delete_consumer_group.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_consumer_group::DeleteConsumerGroup;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs b/core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs
rename to core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs
index c81dabc27..59f053e01 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_group.rs
+++ b/core/cli/src/commands/binary_consumer_groups/get_consumer_group.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::{Table, presets::ASCII_NO_BORDERS};
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::get_consumer_group::GetConsumerGroup;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs b/core/cli/src/commands/binary_consumer_groups/get_consumer_groups.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs
rename to core/cli/src/commands/binary_consumer_groups/get_consumer_groups.rs
index 8b5f88b87..79362b88c 100644
--- a/core/binary_protocol/src/cli/binary_consumer_groups/get_consumer_groups.rs
+++ b/core/cli/src/commands/binary_consumer_groups/get_consumer_groups.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::get_consumer_groups::GetConsumerGroups;
use std::fmt::{self, Display, Formatter};
diff --git a/core/binary_protocol/src/cli/binary_consumer_groups/mod.rs b/core/cli/src/commands/binary_consumer_groups/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_consumer_groups/mod.rs
rename to core/cli/src/commands/binary_consumer_groups/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs b/core/cli/src/commands/binary_consumer_offsets/get_consumer_offset.rs
similarity index 98%
rename from core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs
rename to core/cli/src/commands/binary_consumer_offsets/get_consumer_offset.rs
index 97140dd77..7fb7066af 100644
--- a/core/binary_protocol/src/cli/binary_consumer_offsets/get_consumer_offset.rs
+++ b/core/cli/src/commands/binary_consumer_offsets/get_consumer_offset.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_consumer_offset::GetConsumerOffset;
use iggy_common::{Consumer, ConsumerKind, Identifier};
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_consumer_offsets/mod.rs b/core/cli/src/commands/binary_consumer_offsets/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_consumer_offsets/mod.rs
rename to core/cli/src/commands/binary_consumer_offsets/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs b/core/cli/src/commands/binary_consumer_offsets/set_consumer_offset.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs
rename to core/cli/src/commands/binary_consumer_offsets/set_consumer_offset.rs
index ff3bb40cd..e61eaaf96 100644
--- a/core/binary_protocol/src/cli/binary_consumer_offsets/set_consumer_offset.rs
+++ b/core/cli/src/commands/binary_consumer_offsets/set_consumer_offset.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::{Consumer, ConsumerKind};
diff --git a/core/binary_protocol/src/cli/binary_context/common.rs b/core/cli/src/commands/binary_context/common.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_context/common.rs
rename to core/cli/src/commands/binary_context/common.rs
diff --git a/core/binary_protocol/src/cli/binary_context/get_contexts.rs b/core/cli/src/commands/binary_context/get_contexts.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_context/get_contexts.rs
rename to core/cli/src/commands/binary_context/get_contexts.rs
index edcb2ccf4..5937ceafd 100644
--- a/core/binary_protocol/src/cli/binary_context/get_contexts.rs
+++ b/core/cli/src/commands/binary_context/get_contexts.rs
@@ -20,8 +20,8 @@ use async_trait::async_trait;
use comfy_table::Table;
use tracing::{Level, event};
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
+use iggy_common::Client;
use super::common::ContextManager;
diff --git a/core/binary_protocol/src/cli/binary_context/mod.rs b/core/cli/src/commands/binary_context/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_context/mod.rs
rename to core/cli/src/commands/binary_context/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_context/use_context.rs b/core/cli/src/commands/binary_context/use_context.rs
similarity index 95%
rename from core/binary_protocol/src/cli/binary_context/use_context.rs
rename to core/cli/src/commands/binary_context/use_context.rs
index ff88b57c5..9293bca29 100644
--- a/core/binary_protocol/src/cli/binary_context/use_context.rs
+++ b/core/cli/src/commands/binary_context/use_context.rs
@@ -19,8 +19,8 @@
use async_trait::async_trait;
use tracing::{Level, event};
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
+use iggy_common::Client;
use super::common::{ContextManager, DEFAULT_CONTEXT_NAME};
diff --git a/core/binary_protocol/src/cli/binary_message/flush_messages.rs b/core/cli/src/commands/binary_message/flush_messages.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_message/flush_messages.rs
rename to core/cli/src/commands/binary_message/flush_messages.rs
index 7551ebbfc..1791014c2 100644
--- a/core/binary_protocol/src/cli/binary_message/flush_messages.rs
+++ b/core/cli/src/commands/binary_message/flush_messages.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::{Context, Error};
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_message/mod.rs b/core/cli/src/commands/binary_message/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_message/mod.rs
rename to core/cli/src/commands/binary_message/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_message/poll_messages.rs b/core/cli/src/commands/binary_message/poll_messages.rs
similarity index 99%
rename from core/binary_protocol/src/cli/binary_message/poll_messages.rs
rename to core/cli/src/commands/binary_message/poll_messages.rs
index 7b6725512..3cb4c4abe 100644
--- a/core/binary_protocol/src/cli/binary_message/poll_messages.rs
+++ b/core/cli/src/commands/binary_message/poll_messages.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::{Cell, CellAlignment, Row, Table};
+use iggy_common::Client;
use iggy_common::{
BytesSerializable, Consumer, HeaderKey, HeaderKind, HeaderValue, Identifier, IggyByteSize,
IggyDuration, IggyMessage, IggyTimestamp, PollMessages, PollingStrategy, Sizeable,
diff --git a/core/binary_protocol/src/cli/binary_message/send_messages.rs b/core/cli/src/commands/binary_message/send_messages.rs
similarity index 98%
rename from core/binary_protocol/src/cli/binary_message/send_messages.rs
rename to core/cli/src/commands/binary_message/send_messages.rs
index 6a51a66ea..9dbdcbe22 100644
--- a/core/binary_protocol/src/cli/binary_message/send_messages.rs
+++ b/core/cli/src/commands/binary_message/send_messages.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use bytes::Bytes;
+use iggy_common::Client;
use iggy_common::{
BytesSerializable, HeaderKey, HeaderValue, Identifier, IggyMessage, Partitioning, Sizeable,
};
diff --git a/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs b/core/cli/src/commands/binary_partitions/create_partitions.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_partitions/create_partitions.rs
rename to core/cli/src/commands/binary_partitions/create_partitions.rs
index 0ddce4dd9..25bbe0364 100644
--- a/core/binary_protocol/src/cli/binary_partitions/create_partitions.rs
+++ b/core/cli/src/commands/binary_partitions/create_partitions.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::create_partitions::CreatePartitions;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs b/core/cli/src/commands/binary_partitions/delete_partitions.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs
rename to core/cli/src/commands/binary_partitions/delete_partitions.rs
index a05d6a07a..20a6c69cd 100644
--- a/core/binary_protocol/src/cli/binary_partitions/delete_partitions.rs
+++ b/core/cli/src/commands/binary_partitions/delete_partitions.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_partitions::DeletePartitions;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_partitions/mod.rs b/core/cli/src/commands/binary_partitions/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_partitions/mod.rs
rename to core/cli/src/commands/binary_partitions/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs b/core/cli/src/commands/binary_personal_access_tokens/create_personal_access_token.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs
rename to core/cli/src/commands/binary_personal_access_tokens/create_personal_access_token.rs
index e6ff07ea5..4fa96f700 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/create_personal_access_token.rs
+++ b/core/cli/src/commands/binary_personal_access_tokens/create_personal_access_token.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::PersonalAccessTokenExpiry;
use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use keyring::Entry;
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs b/core/cli/src/commands/binary_personal_access_tokens/delete_personal_access_tokens.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs
rename to core/cli/src/commands/binary_personal_access_tokens/delete_personal_access_tokens.rs
index d8ca5ce46..d97e78b6b 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/delete_personal_access_tokens.rs
+++ b/core/cli/src/commands/binary_personal_access_tokens/delete_personal_access_tokens.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
use keyring::Entry;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs b/core/cli/src/commands/binary_personal_access_tokens/get_personal_access_tokens.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs
rename to core/cli/src/commands/binary_personal_access_tokens/get_personal_access_tokens.rs
index 51617d990..53a5dc9fc 100644
--- a/core/binary_protocol/src/cli/binary_personal_access_tokens/get_personal_access_tokens.rs
+++ b/core/cli/src/commands/binary_personal_access_tokens/get_personal_access_tokens.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_personal_access_tokens::GetPersonalAccessTokens;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_personal_access_tokens/mod.rs b/core/cli/src/commands/binary_personal_access_tokens/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_personal_access_tokens/mod.rs
rename to core/cli/src/commands/binary_personal_access_tokens/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_segments/delete_segments.rs b/core/cli/src/commands/binary_segments/delete_segments.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_segments/delete_segments.rs
rename to core/cli/src/commands/binary_segments/delete_segments.rs
index 64a0be286..155979291 100644
--- a/core/binary_protocol/src/cli/binary_segments/delete_segments.rs
+++ b/core/cli/src/commands/binary_segments/delete_segments.rs
@@ -15,10 +15,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_segments::DeleteSegments;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_segments/mod.rs b/core/cli/src/commands/binary_segments/mod.rs
similarity index 100%
copy from core/binary_protocol/src/cli/binary_segments/mod.rs
copy to core/cli/src/commands/binary_segments/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_streams/create_stream.rs b/core/cli/src/commands/binary_streams/create_stream.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_streams/create_stream.rs
rename to core/cli/src/commands/binary_streams/create_stream.rs
index 9fe750f87..fda42da5e 100644
--- a/core/binary_protocol/src/cli/binary_streams/create_stream.rs
+++ b/core/cli/src/commands/binary_streams/create_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::create_stream::CreateStream;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_streams/delete_stream.rs b/core/cli/src/commands/binary_streams/delete_stream.rs
similarity index 95%
rename from core/binary_protocol/src/cli/binary_streams/delete_stream.rs
rename to core/cli/src/commands/binary_streams/delete_stream.rs
index b1cf60ffa..8f08a1703 100644
--- a/core/binary_protocol/src/cli/binary_streams/delete_stream.rs
+++ b/core/cli/src/commands/binary_streams/delete_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_stream::DeleteStream;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_streams/get_stream.rs b/core/cli/src/commands/binary_streams/get_stream.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_streams/get_stream.rs
rename to core/cli/src/commands/binary_streams/get_stream.rs
index 64b4512e5..6e22dd2da 100644
--- a/core/binary_protocol/src/cli/binary_streams/get_stream.rs
+++ b/core/cli/src/commands/binary_streams/get_stream.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::get_stream::GetStream;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_streams/get_streams.rs b/core/cli/src/commands/binary_streams/get_streams.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_streams/get_streams.rs
rename to core/cli/src/commands/binary_streams/get_streams.rs
index 15926a86b..55c785ed1 100644
--- a/core/binary_protocol/src/cli/binary_streams/get_streams.rs
+++ b/core/cli/src/commands/binary_streams/get_streams.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_streams::GetStreams;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_streams/mod.rs b/core/cli/src/commands/binary_streams/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_streams/mod.rs
rename to core/cli/src/commands/binary_streams/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_streams/purge_stream.rs b/core/cli/src/commands/binary_streams/purge_stream.rs
similarity index 95%
rename from core/binary_protocol/src/cli/binary_streams/purge_stream.rs
rename to core/cli/src/commands/binary_streams/purge_stream.rs
index e633faa88..ff9cda01d 100644
--- a/core/binary_protocol/src/cli/binary_streams/purge_stream.rs
+++ b/core/cli/src/commands/binary_streams/purge_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::purge_stream::PurgeStream;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_streams/update_stream.rs b/core/cli/src/commands/binary_streams/update_stream.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_streams/update_stream.rs
rename to core/cli/src/commands/binary_streams/update_stream.rs
index 246ab5b19..d6f0ac827 100644
--- a/core/binary_protocol/src/cli/binary_streams/update_stream.rs
+++ b/core/cli/src/commands/binary_streams/update_stream.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::update_stream::UpdateStream;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_system/login.rs b/core/cli/src/commands/binary_system/login.rs
similarity index 94%
rename from core/binary_protocol/src/cli/binary_system/login.rs
rename to core/cli/src/commands/binary_system/login.rs
index 1ec321c14..7c99c1db9 100644
--- a/core/binary_protocol/src/cli/binary_system/login.rs
+++ b/core/cli/src/commands/binary_system/login.rs
@@ -16,12 +16,12 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::binary_system::session::ServerSession;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
-use crate::cli::utils::login_session_expiry::LoginSessionExpiry;
+use crate::commands::binary_system::session::ServerSession;
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::utils::login_session_expiry::LoginSessionExpiry;
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::SEC_IN_MICRO;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_system/logout.rs b/core/cli/src/commands/binary_system/logout.rs
similarity index 93%
rename from core/binary_protocol/src/cli/binary_system/logout.rs
rename to core/cli/src/commands/binary_system/logout.rs
index 8466dd736..a8447ccc7 100644
--- a/core/binary_protocol/src/cli/binary_system/logout.rs
+++ b/core/cli/src/commands/binary_system/logout.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::binary_system::session::ServerSession;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::binary_system::session::ServerSession;
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use tracing::{Level, event};
pub struct LogoutCmd {
diff --git a/core/binary_protocol/src/cli/binary_system/me.rs b/core/cli/src/commands/binary_system/me.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_system/me.rs
rename to core/cli/src/commands/binary_system/me.rs
index fb6cfc75c..ad3834277 100644
--- a/core/binary_protocol/src/cli/binary_system/me.rs
+++ b/core/cli/src/commands/binary_system/me.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_me::GetMe;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_system/mod.rs b/core/cli/src/commands/binary_system/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_system/mod.rs
rename to core/cli/src/commands/binary_system/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_system/ping.rs b/core/cli/src/commands/binary_system/ping.rs
similarity index 98%
rename from core/binary_protocol/src/cli/binary_system/ping.rs
rename to core/cli/src/commands/binary_system/ping.rs
index 5718691a3..990d72ad6 100644
--- a/core/binary_protocol/src/cli/binary_system/ping.rs
+++ b/core/cli/src/commands/binary_system/ping.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::ping::Ping;
use std::fmt::{Display, Formatter, Result};
use std::time::Duration;
diff --git a/core/binary_protocol/src/cli/binary_system/session.rs b/core/cli/src/commands/binary_system/session.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_system/session.rs
rename to core/cli/src/commands/binary_system/session.rs
diff --git a/core/binary_protocol/src/cli/binary_system/snapshot.rs b/core/cli/src/commands/binary_system/snapshot.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_system/snapshot.rs
rename to core/cli/src/commands/binary_system/snapshot.rs
index 6a97b8c8e..b0178f111 100644
--- a/core/binary_protocol/src/cli/binary_system/snapshot.rs
+++ b/core/cli/src/commands/binary_system/snapshot.rs
@@ -18,11 +18,11 @@
use std::path::Path;
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::{SnapshotCompression, SystemSnapshotType};
use tokio::io::AsyncWriteExt;
diff --git a/core/binary_protocol/src/cli/binary_system/stats.rs b/core/cli/src/commands/binary_system/stats.rs
similarity index 98%
rename from core/binary_protocol/src/cli/binary_system/stats.rs
rename to core/cli/src/commands/binary_system/stats.rs
index f61cf4962..595013f32 100644
--- a/core/binary_protocol/src/cli/binary_system/stats.rs
+++ b/core/cli/src/commands/binary_system/stats.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_stats::GetStats;
use std::fmt::Display;
use std::time::SystemTime;
diff --git a/core/binary_protocol/src/cli/binary_topics/create_topic.rs b/core/cli/src/commands/binary_topics/create_topic.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_topics/create_topic.rs
rename to core/cli/src/commands/binary_topics/create_topic.rs
index ff4ef9fd6..8204a7dde 100644
--- a/core/binary_protocol/src/cli/binary_topics/create_topic.rs
+++ b/core/cli/src/commands/binary_topics/create_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use core::fmt;
+use iggy_common::Client;
use iggy_common::create_topic::CreateTopic;
use iggy_common::{CompressionAlgorithm, Identifier, IggyExpiry, MaxTopicSize};
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_topics/delete_topic.rs b/core/cli/src/commands/binary_topics/delete_topic.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_topics/delete_topic.rs
rename to core/cli/src/commands/binary_topics/delete_topic.rs
index e48665b5a..2d6833960 100644
--- a/core/binary_protocol/src/cli/binary_topics/delete_topic.rs
+++ b/core/cli/src/commands/binary_topics/delete_topic.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_topic::DeleteTopic;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_topics/get_topic.rs b/core/cli/src/commands/binary_topics/get_topic.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_topics/get_topic.rs
rename to core/cli/src/commands/binary_topics/get_topic.rs
index 293605062..570fcc72b 100644
--- a/core/binary_protocol/src/cli/binary_topics/get_topic.rs
+++ b/core/cli/src/commands/binary_topics/get_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::IggyExpiry;
use iggy_common::get_topic::GetTopic;
diff --git a/core/binary_protocol/src/cli/binary_topics/get_topics.rs b/core/cli/src/commands/binary_topics/get_topics.rs
similarity index 98%
rename from core/binary_protocol/src/cli/binary_topics/get_topics.rs
rename to core/cli/src/commands/binary_topics/get_topics.rs
index 2f6c20892..a4812f376 100644
--- a/core/binary_protocol/src/cli/binary_topics/get_topics.rs
+++ b/core/cli/src/commands/binary_topics/get_topics.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_topics::GetTopics;
use iggy_common::{Identifier, IggyExpiry};
use std::fmt::{self, Display, Formatter};
diff --git a/core/binary_protocol/src/cli/binary_topics/mod.rs b/core/cli/src/commands/binary_topics/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_topics/mod.rs
rename to core/cli/src/commands/binary_topics/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_topics/purge_topic.rs b/core/cli/src/commands/binary_topics/purge_topic.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_topics/purge_topic.rs
rename to core/cli/src/commands/binary_topics/purge_topic.rs
index 65447f77c..ec56cfb1d 100644
--- a/core/binary_protocol/src/cli/binary_topics/purge_topic.rs
+++ b/core/cli/src/commands/binary_topics/purge_topic.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::purge_topic::PurgeTopic;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_topics/update_topic.rs b/core/cli/src/commands/binary_topics/update_topic.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_topics/update_topic.rs
rename to core/cli/src/commands/binary_topics/update_topic.rs
index c9b8da2df..37e0d20f0 100644
--- a/core/binary_protocol/src/cli/binary_topics/update_topic.rs
+++ b/core/cli/src/commands/binary_topics/update_topic.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use core::fmt;
+use iggy_common::Client;
use iggy_common::update_topic::UpdateTopic;
use iggy_common::{CompressionAlgorithm, Identifier, IggyExpiry, MaxTopicSize};
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/change_password.rs b/core/cli/src/commands/binary_users/change_password.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_users/change_password.rs
rename to core/cli/src/commands/binary_users/change_password.rs
index a64e8be3a..7a35d02ed 100644
--- a/core/binary_protocol/src/cli/binary_users/change_password.rs
+++ b/core/cli/src/commands/binary_users/change_password.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use passterm::{Stream, isatty, prompt_password_stdin, prompt_password_tty};
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/create_user.rs b/core/cli/src/commands/binary_users/create_user.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_users/create_user.rs
rename to core/cli/src/commands/binary_users/create_user.rs
index 5054f7c06..1a25459b7 100644
--- a/core/binary_protocol/src/cli/binary_users/create_user.rs
+++ b/core/cli/src/commands/binary_users/create_user.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Permissions;
use iggy_common::UserStatus;
use iggy_common::create_user::CreateUser;
diff --git a/core/binary_protocol/src/cli/binary_users/delete_user.rs b/core/cli/src/commands/binary_users/delete_user.rs
similarity index 95%
rename from core/binary_protocol/src/cli/binary_users/delete_user.rs
rename to core/cli/src/commands/binary_users/delete_user.rs
index 23e027d65..a62beead4 100644
--- a/core/binary_protocol/src/cli/binary_users/delete_user.rs
+++ b/core/cli/src/commands/binary_users/delete_user.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::delete_user::DeleteUser;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/get_user.rs b/core/cli/src/commands/binary_users/get_user.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_users/get_user.rs
rename to core/cli/src/commands/binary_users/get_user.rs
index 13b2f07c0..b68e2a9ec 100644
--- a/core/binary_protocol/src/cli/binary_users/get_user.rs
+++ b/core/cli/src/commands/binary_users/get_user.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::get_user::GetUser;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/get_users.rs b/core/cli/src/commands/binary_users/get_users.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_users/get_users.rs
rename to core/cli/src/commands/binary_users/get_users.rs
index 72f327bd8..cfb55407f 100644
--- a/core/binary_protocol/src/cli/binary_users/get_users.rs
+++ b/core/cli/src/commands/binary_users/get_users.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
use comfy_table::Table;
+use iggy_common::Client;
use iggy_common::get_users::GetUsers;
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/mod.rs b/core/cli/src/commands/binary_users/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/binary_users/mod.rs
rename to core/cli/src/commands/binary_users/mod.rs
diff --git a/core/binary_protocol/src/cli/binary_users/update_permissions.rs b/core/cli/src/commands/binary_users/update_permissions.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_users/update_permissions.rs
rename to core/cli/src/commands/binary_users/update_permissions.rs
index 395983da7..3617c960f 100644
--- a/core/binary_protocol/src/cli/binary_users/update_permissions.rs
+++ b/core/cli/src/commands/binary_users/update_permissions.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::update_permissions::UpdatePermissions;
use iggy_common::{Identifier, Permissions};
use tracing::{Level, event};
diff --git a/core/binary_protocol/src/cli/binary_users/update_user.rs b/core/cli/src/commands/binary_users/update_user.rs
similarity index 97%
rename from core/binary_protocol/src/cli/binary_users/update_user.rs
rename to core/cli/src/commands/binary_users/update_user.rs
index 16444c8ed..70e5d6cc1 100644
--- a/core/binary_protocol/src/cli/binary_users/update_user.rs
+++ b/core/cli/src/commands/binary_users/update_user.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use crate::Client;
-use crate::cli::cli_command::{CliCommand, PRINT_TARGET};
+use crate::commands::cli_command::{CliCommand, PRINT_TARGET};
use anyhow::Context;
use async_trait::async_trait;
+use iggy_common::Client;
use iggy_common::Identifier;
use iggy_common::UserStatus;
use iggy_common::update_user::UpdateUser;
diff --git a/core/binary_protocol/src/cli/cli_command.rs b/core/cli/src/commands/cli_command.rs
similarity index 98%
rename from core/binary_protocol/src/cli/cli_command.rs
rename to core/cli/src/commands/cli_command.rs
index 41d440b6c..5b0f9a1d0 100644
--- a/core/binary_protocol/src/cli/cli_command.rs
+++ b/core/cli/src/commands/cli_command.rs
@@ -16,9 +16,9 @@
* under the License.
*/
-use crate::Client;
use anyhow::{Error, Result};
use async_trait::async_trait;
+use iggy_common::Client;
pub static PRINT_TARGET: &str = "iggy::cli::output";
diff --git a/core/binary_protocol/src/cli/mod.rs b/core/cli/src/commands/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/mod.rs
rename to core/cli/src/commands/mod.rs
diff --git a/core/binary_protocol/src/cli/utils/login_session_expiry.rs b/core/cli/src/commands/utils/login_session_expiry.rs
similarity index 100%
rename from core/binary_protocol/src/cli/utils/login_session_expiry.rs
rename to core/cli/src/commands/utils/login_session_expiry.rs
diff --git a/core/binary_protocol/src/cli/utils/mod.rs b/core/cli/src/commands/utils/mod.rs
similarity index 100%
rename from core/binary_protocol/src/cli/utils/mod.rs
rename to core/cli/src/commands/utils/mod.rs
diff --git a/core/cli/src/credentials.rs b/core/cli/src/credentials.rs
index a6f8aab55..4760218d3 100644
--- a/core/cli/src/credentials.rs
+++ b/core/cli/src/credentials.rs
@@ -21,13 +21,13 @@ use crate::error::{CmdToolError, IggyCmdError};
use anyhow::{Context, bail};
use iggy::clients::client::IggyClient;
use iggy::prelude::{Args, IggyError, PersonalAccessTokenClient, UserClient};
-use iggy_binary_protocol::cli::binary_system::session::ServerSession;
+use iggy_cli::commands::binary_system::session::ServerSession;
use passterm::{Stream, isatty, prompt_password_stdin, prompt_password_tty};
use std::env::var;
#[cfg(feature = "login-session")]
mod credentials_login_session {
- pub(crate) use iggy_binary_protocol::cli::cli_command::PRINT_TARGET;
+ pub(crate) use iggy_cli::commands::cli_command::PRINT_TARGET;
pub(crate) use keyring::Entry;
pub(crate) use tracing::{Level, event};
}
diff --git a/core/binary_protocol/src/cli/binary_segments/mod.rs b/core/cli/src/lib.rs
similarity index 96%
rename from core/binary_protocol/src/cli/binary_segments/mod.rs
rename to core/cli/src/lib.rs
index 0367bb5b5..d147f7e0a 100644
--- a/core/binary_protocol/src/cli/binary_segments/mod.rs
+++ b/core/cli/src/lib.rs
@@ -16,4 +16,4 @@
* under the License.
*/
-pub mod delete_segments;
+pub mod commands;
diff --git a/core/cli/src/logging.rs b/core/cli/src/logging.rs
index a4199ae54..29f5148f5 100644
--- a/core/cli/src/logging.rs
+++ b/core/cli/src/logging.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use iggy_binary_protocol::cli::cli_command::PRINT_TARGET;
+use iggy_cli::commands::cli_command::PRINT_TARGET;
use std::path::PathBuf;
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::{
diff --git a/core/cli/src/main.rs b/core/cli/src/main.rs
index bbdf1fa11..657f2e3c9 100644
--- a/core/cli/src/main.rs
+++ b/core/cli/src/main.rs
@@ -40,12 +40,12 @@ use clap::Parser;
use iggy::client_provider::{self, ClientProviderConfig};
use iggy::clients::client::IggyClient;
use iggy::prelude::{Aes256GcmEncryptor, Args, EncryptorKind, PersonalAccessTokenExpiry};
-use iggy_binary_protocol::cli::binary_context::common::ContextManager;
-use iggy_binary_protocol::cli::binary_context::use_context::UseContextCmd;
-use iggy_binary_protocol::cli::binary_segments::delete_segments::DeleteSegmentsCmd;
-use iggy_binary_protocol::cli::binary_system::snapshot::GetSnapshotCmd;
-use iggy_binary_protocol::cli::cli_command::{CliCommand, PRINT_TARGET};
-use iggy_binary_protocol::cli::{
+use iggy_cli::commands::binary_context::common::ContextManager;
+use iggy_cli::commands::binary_context::use_context::UseContextCmd;
+use iggy_cli::commands::binary_segments::delete_segments::DeleteSegmentsCmd;
+use iggy_cli::commands::binary_system::snapshot::GetSnapshotCmd;
+use iggy_cli::commands::cli_command::{CliCommand, PRINT_TARGET};
+use iggy_cli::commands::{
binary_client::{get_client::GetClientCmd, get_clients::GetClientsCmd},
binary_cluster::get_cluster_metadata::GetClusterMetadataCmd,
binary_consumer_groups::{
@@ -93,8 +93,8 @@ use tracing::{Level, event};
#[cfg(feature = "login-session")]
mod main_login_session {
- pub(crate) use iggy_binary_protocol::cli::binary_system::{login::LoginCmd, logout::LogoutCmd};
- pub(crate) use iggy_binary_protocol::cli::utils::login_session_expiry::LoginSessionExpiry;
+ pub(crate) use iggy_cli::commands::binary_system::{login::LoginCmd, logout::LogoutCmd};
+ pub(crate) use iggy_cli::commands::utils::login_session_expiry::LoginSessionExpiry;
}
#[cfg(feature = "login-session")]
diff --git a/core/common/Cargo.toml b/core/common/Cargo.toml
index 5977d9c40..0e1d0bd1c 100644
--- a/core/common/Cargo.toml
+++ b/core/common/Cargo.toml
@@ -30,6 +30,8 @@ readme = "../../README.md"
[dependencies]
aes-gcm = { workspace = true }
ahash = { workspace = true }
+async-broadcast = { workspace = true }
+async-trait = { workspace = true }
base64 = { workspace = true }
blake3 = { workspace = true }
bon = { workspace = true }
diff --git a/core/common/src/lib.rs b/core/common/src/lib.rs
index 6e8b4dcf7..349704d6c 100644
--- a/core/common/src/lib.rs
+++ b/core/common/src/lib.rs
@@ -52,9 +52,23 @@ pub use deduplication::MessageDeduplicator;
pub use sender::{
QuicSender, Sender, SenderKind, TcpSender, TcpTlsSender, WebSocketSender, WebSocketTlsSender,
};
+pub use traits::binary_client::BinaryClient;
+pub use traits::binary_transport::BinaryTransport;
pub use traits::bytes_serializable::BytesSerializable;
+pub use traits::client::Client;
+pub use traits::cluster_client::ClusterClient;
+pub use traits::consumer_group_client::ConsumerGroupClient;
+pub use traits::consumer_offset_client::ConsumerOffsetClient;
+pub use traits::message_client::MessageClient;
+pub use traits::partition_client::PartitionClient;
pub use traits::partitioner::Partitioner;
+pub use traits::personal_access_token_client::PersonalAccessTokenClient;
+pub use traits::segment_client::SegmentClient;
pub use traits::sizeable::Sizeable;
+pub use traits::stream_client::StreamClient;
+pub use traits::system_client::SystemClient;
+pub use traits::topic_client::TopicClient;
+pub use traits::user_client::UserClient;
pub use traits::validatable::Validatable;
pub use types::args::*;
pub use types::client::client_info::*;
diff --git a/core/binary_protocol/src/utils/auth.rs b/core/common/src/traits/binary_auth.rs
similarity index 86%
rename from core/binary_protocol/src/utils/auth.rs
rename to core/common/src/traits/binary_auth.rs
index 8299d8ba1..639883972 100644
--- a/core/binary_protocol/src/utils/auth.rs
+++ b/core/common/src/traits/binary_auth.rs
@@ -16,12 +16,9 @@
* under the License.
*/
-use crate::BinaryTransport;
-use iggy_common::{ClientState, IggyError};
+use crate::{BinaryTransport, ClientState, IggyError};
-pub(crate) async fn fail_if_not_authenticated<T: BinaryTransport>(
- transport: &T,
-) -> Result<(), IggyError> {
+pub async fn fail_if_not_authenticated<T: BinaryTransport>(transport: &T) -> Result<(), IggyError> {
match transport.get_state().await {
ClientState::Shutdown => Err(IggyError::ClientShutdown),
ClientState::Disconnected | ClientState::Connecting | ClientState::Authenticating => {
diff --git a/core/binary_protocol/src/client/binary_clients/binary_client.rs b/core/common/src/traits/binary_client.rs
similarity index 92%
rename from core/binary_protocol/src/client/binary_clients/binary_client.rs
rename to core/common/src/traits/binary_client.rs
index b0d5f29f4..94f97c06f 100644
--- a/core/binary_protocol/src/client/binary_clients/binary_client.rs
+++ b/core/common/src/traits/binary_client.rs
@@ -16,8 +16,7 @@
* under the License.
*/
-use crate::BinaryTransport;
-use crate::client::binary_clients::client::Client;
+use crate::{BinaryTransport, Client};
use async_trait::async_trait;
/// A client that can send and receive binary messages.
diff --git a/core/binary_protocol/src/client/binary_cluster/mod.rs b/core/common/src/traits/binary_impls/cluster.rs
similarity index 81%
rename from core/binary_protocol/src/client/binary_cluster/mod.rs
rename to core/common/src/traits/binary_impls/cluster.rs
index 9786ac747..3a27b7441 100644
--- a/core/binary_protocol/src/client/binary_cluster/mod.rs
+++ b/core/common/src/traits/binary_impls/cluster.rs
@@ -16,16 +16,16 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, ClusterClient};
-use iggy_common::{ClusterMetadata, GetClusterMetadata, IggyError};
+use crate::BinaryClient;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::{ClusterClient, ClusterMetadata, GetClusterMetadata, IggyError};
#[async_trait::async_trait]
impl<B: BinaryClient> ClusterClient for B {
async fn get_cluster_metadata(&self) -> Result<ClusterMetadata, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetClusterMetadata {}).await?;
- mapper::map_cluster_metadata(response)
+ binary_mapper::map_cluster_metadata(response)
}
}
diff --git a/core/binary_protocol/src/client/binary_consumer_groups/mod.rs b/core/common/src/traits/binary_impls/consumer_groups.rs
similarity index 84%
rename from core/binary_protocol/src/client/binary_consumer_groups/mod.rs
rename to core/common/src/traits/binary_impls/consumer_groups.rs
index 6495665fc..44d819a7a 100644
--- a/core/binary_protocol/src/client/binary_consumer_groups/mod.rs
+++ b/core/common/src/traits/binary_impls/consumer_groups.rs
@@ -16,17 +16,17 @@
* under the License.
*/
-use crate::{BinaryClient, ConsumerGroupClient};
+use crate::BinaryClient;
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use iggy_common::create_consumer_group::CreateConsumerGroup;
-use iggy_common::delete_consumer_group::DeleteConsumerGroup;
-use iggy_common::get_consumer_group::GetConsumerGroup;
-use iggy_common::get_consumer_groups::GetConsumerGroups;
-use iggy_common::join_consumer_group::JoinConsumerGroup;
-use iggy_common::leave_consumer_group::LeaveConsumerGroup;
-use iggy_common::{ConsumerGroup, ConsumerGroupDetails, Identifier, IggyError};
+use crate::create_consumer_group::CreateConsumerGroup;
+use crate::delete_consumer_group::DeleteConsumerGroup;
+use crate::get_consumer_group::GetConsumerGroup;
+use crate::get_consumer_groups::GetConsumerGroups;
+use crate::join_consumer_group::JoinConsumerGroup;
+use crate::leave_consumer_group::LeaveConsumerGroup;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::{ConsumerGroup, ConsumerGroupClient, ConsumerGroupDetails, Identifier, IggyError};
#[async_trait::async_trait]
impl<B: BinaryClient> ConsumerGroupClient for B {
@@ -48,7 +48,7 @@ impl<B: BinaryClient> ConsumerGroupClient for B {
return Ok(None);
}
- mapper::map_consumer_group(response).map(Some)
+ binary_mapper::map_consumer_group(response).map(Some)
}
async fn get_consumer_groups(
@@ -63,7 +63,7 @@ impl<B: BinaryClient> ConsumerGroupClient for B {
topic_id: topic_id.clone(),
})
.await?;
- mapper::map_consumer_groups(response)
+ binary_mapper::map_consumer_groups(response)
}
async fn create_consumer_group(
@@ -80,7 +80,7 @@ impl<B: BinaryClient> ConsumerGroupClient for B {
name: name.to_string(),
})
.await?;
- mapper::map_consumer_group(response)
+ binary_mapper::map_consumer_group(response)
}
async fn delete_consumer_group(
diff --git a/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs b/core/common/src/traits/binary_impls/consumer_offsets.rs
similarity index 84%
rename from core/binary_protocol/src/client/binary_consumer_offsets/mod.rs
rename to core/common/src/traits/binary_impls/consumer_offsets.rs
index 9d2ceda7f..2e44c9ced 100644
--- a/core/binary_protocol/src/client/binary_consumer_offsets/mod.rs
+++ b/core/common/src/traits/binary_impls/consumer_offsets.rs
@@ -15,14 +15,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-use crate::ConsumerOffsetClient;
-use crate::client::binary_clients::BinaryClient;
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use iggy_common::delete_consumer_offset::DeleteConsumerOffset;
-use iggy_common::get_consumer_offset::GetConsumerOffset;
-use iggy_common::store_consumer_offset::StoreConsumerOffset;
-use iggy_common::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
+use crate::BinaryClient;
+use crate::delete_consumer_offset::DeleteConsumerOffset;
+use crate::get_consumer_offset::GetConsumerOffset;
+use crate::store_consumer_offset::StoreConsumerOffset;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::{Consumer, ConsumerOffsetClient, ConsumerOffsetInfo, Identifier, IggyError};
#[async_trait::async_trait]
impl<B: BinaryClient> ConsumerOffsetClient for B {
@@ -66,7 +65,7 @@ impl<B: BinaryClient> ConsumerOffsetClient for B {
return Ok(None);
}
- mapper::map_consumer_offset(response).map(Some)
+ binary_mapper::map_consumer_offset(response).map(Some)
}
async fn delete_consumer_offset(
diff --git a/core/binary_protocol/src/client/binary_messages/mod.rs b/core/common/src/traits/binary_impls/messages.rs
similarity index 93%
rename from core/binary_protocol/src/client/binary_messages/mod.rs
rename to core/common/src/traits/binary_impls/messages.rs
index cef26620d..018739ac6 100644
--- a/core/binary_protocol/src/client/binary_messages/mod.rs
+++ b/core/common/src/traits/binary_impls/messages.rs
@@ -15,11 +15,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::{BinaryClient, MessageClient};
-use iggy_common::{
+use crate::BinaryClient;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::{
BytesSerializable, Consumer, FlushUnsavedBuffer, Identifier, IggyError, IggyMessage,
- POLL_MESSAGES_CODE, Partitioning, PollMessages, PolledMessages, PollingStrategy,
+ MessageClient, POLL_MESSAGES_CODE, Partitioning, PollMessages, PolledMessages, PollingStrategy,
SEND_MESSAGES_CODE, SendMessages,
};
diff --git a/core/binary_protocol/src/client/mod.rs b/core/common/src/traits/binary_impls/mod.rs
similarity index 70%
rename from core/binary_protocol/src/client/mod.rs
rename to core/common/src/traits/binary_impls/mod.rs
index d02ce3bac..3d039130d 100644
--- a/core/binary_protocol/src/client/mod.rs
+++ b/core/common/src/traits/binary_impls/mod.rs
@@ -15,16 +15,14 @@
// specific language governing permissions and limitations
// under the License.
-pub mod binary_clients;
-pub mod binary_cluster;
-pub mod binary_consumer_groups;
-pub mod binary_consumer_offsets;
-pub mod binary_messages;
-pub mod binary_partitions;
-pub mod binary_personal_access_tokens;
-pub mod binary_segments;
-pub mod binary_streams;
-mod binary_system;
-pub mod binary_topics;
-pub mod binary_transport;
-pub mod binary_users;
+mod cluster;
+mod consumer_groups;
+mod consumer_offsets;
+mod messages;
+mod partitions;
+mod personal_access_tokens;
+mod segments;
+mod streams;
+mod system;
+mod topics;
+mod users;
diff --git a/core/binary_protocol/src/client/binary_partitions/mod.rs b/core/common/src/traits/binary_impls/partitions.rs
similarity index 87%
rename from core/binary_protocol/src/client/binary_partitions/mod.rs
rename to core/common/src/traits/binary_impls/partitions.rs
index cbe57f261..dea3e85da 100644
--- a/core/binary_protocol/src/client/binary_partitions/mod.rs
+++ b/core/common/src/traits/binary_impls/partitions.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::{BinaryClient, PartitionClient};
-use iggy_common::create_partitions::CreatePartitions;
-use iggy_common::delete_partitions::DeletePartitions;
-use iggy_common::{Identifier, IggyError};
+use crate::BinaryClient;
+use crate::create_partitions::CreatePartitions;
+use crate::delete_partitions::DeletePartitions;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::{Identifier, IggyError, PartitionClient};
#[async_trait::async_trait]
impl<B: BinaryClient> PartitionClient for B {
diff --git a/core/binary_protocol/src/client/binary_personal_access_tokens/mod.rs b/core/common/src/traits/binary_impls/personal_access_tokens.rs
similarity index 77%
rename from core/binary_protocol/src/client/binary_personal_access_tokens/mod.rs
rename to core/common/src/traits/binary_impls/personal_access_tokens.rs
index bb151dde7..1323ac28b 100644
--- a/core/binary_protocol/src/client/binary_personal_access_tokens/mod.rs
+++ b/core/common/src/traits/binary_impls/personal_access_tokens.rs
@@ -17,16 +17,16 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, PersonalAccessTokenClient};
-use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
-use iggy_common::delete_personal_access_token::DeletePersonalAccessToken;
-use iggy_common::get_personal_access_tokens::GetPersonalAccessTokens;
-use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
-use iggy_common::{
- ClientState, DiagnosticEvent, IdentityInfo, IggyError, PersonalAccessTokenExpiry,
- PersonalAccessTokenInfo, RawPersonalAccessToken,
+use crate::BinaryClient;
+use crate::create_personal_access_token::CreatePersonalAccessToken;
+use crate::delete_personal_access_token::DeletePersonalAccessToken;
+use crate::get_personal_access_tokens::GetPersonalAccessTokens;
+use crate::login_with_personal_access_token::LoginWithPersonalAccessToken;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::{
+ ClientState, DiagnosticEvent, IdentityInfo, IggyError, PersonalAccessTokenClient,
+ PersonalAccessTokenExpiry, PersonalAccessTokenInfo, RawPersonalAccessToken,
};
#[async_trait::async_trait]
@@ -34,7 +34,7 @@ impl<B: BinaryClient> PersonalAccessTokenClient for B {
async fn get_personal_access_tokens(&self) -> Result<Vec<PersonalAccessTokenInfo>, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetPersonalAccessTokens {}).await?;
- mapper::map_personal_access_tokens(response)
+ binary_mapper::map_personal_access_tokens(response)
}
async fn create_personal_access_token(
@@ -49,7 +49,7 @@ impl<B: BinaryClient> PersonalAccessTokenClient for B {
expiry,
})
.await?;
- mapper::map_raw_pat(response)
+ binary_mapper::map_raw_pat(response)
}
async fn delete_personal_access_token(&self, name: &str) -> Result<(), IggyError> {
@@ -72,6 +72,6 @@ impl<B: BinaryClient> PersonalAccessTokenClient for B {
.await?;
self.set_state(ClientState::Authenticated).await;
self.publish_event(DiagnosticEvent::SignedIn).await;
- mapper::map_identity_info(response)
+ binary_mapper::map_identity_info(response)
}
}
diff --git a/core/binary_protocol/src/client/binary_segments/mod.rs b/core/common/src/traits/binary_impls/segments.rs
similarity index 89%
rename from core/binary_protocol/src/client/binary_segments/mod.rs
rename to core/common/src/traits/binary_impls/segments.rs
index 585f652bb..9de7f3130 100644
--- a/core/binary_protocol/src/client/binary_segments/mod.rs
+++ b/core/common/src/traits/binary_impls/segments.rs
@@ -17,10 +17,9 @@
*/
use crate::BinaryClient;
-use crate::SegmentClient;
-use crate::utils::auth::fail_if_not_authenticated;
-use iggy_common::delete_segments::DeleteSegments;
-use iggy_common::{Identifier, IggyError};
+use crate::delete_segments::DeleteSegments;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::{Identifier, IggyError, SegmentClient};
#[async_trait::async_trait]
impl<B: BinaryClient> SegmentClient for B {
diff --git a/core/binary_protocol/src/client/binary_streams/mod.rs b/core/common/src/traits/binary_impls/streams.rs
similarity index 82%
rename from core/binary_protocol/src/client/binary_streams/mod.rs
rename to core/common/src/traits/binary_impls/streams.rs
index ebb9ab6cd..31993c446 100644
--- a/core/binary_protocol/src/client/binary_streams/mod.rs
+++ b/core/common/src/traits/binary_impls/streams.rs
@@ -16,16 +16,16 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, StreamClient};
-use iggy_common::create_stream::CreateStream;
-use iggy_common::delete_stream::DeleteStream;
-use iggy_common::get_stream::GetStream;
-use iggy_common::get_streams::GetStreams;
-use iggy_common::purge_stream::PurgeStream;
-use iggy_common::update_stream::UpdateStream;
-use iggy_common::{Identifier, IggyError, Stream, StreamDetails};
+use crate::BinaryClient;
+use crate::create_stream::CreateStream;
+use crate::delete_stream::DeleteStream;
+use crate::get_stream::GetStream;
+use crate::get_streams::GetStreams;
+use crate::purge_stream::PurgeStream;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::update_stream::UpdateStream;
+use crate::{Identifier, IggyError, Stream, StreamClient, StreamDetails};
#[async_trait::async_trait]
impl<B: BinaryClient> StreamClient for B {
@@ -40,13 +40,13 @@ impl<B: BinaryClient> StreamClient for B {
return Ok(None);
}
- mapper::map_stream(response).map(Some)
+ binary_mapper::map_stream(response).map(Some)
}
async fn get_streams(&self) -> Result<Vec<Stream>, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetStreams {}).await?;
- mapper::map_streams(response)
+ binary_mapper::map_streams(response)
}
async fn create_stream(&self, name: &str) -> Result<StreamDetails, IggyError> {
@@ -56,7 +56,7 @@ impl<B: BinaryClient> StreamClient for B {
name: name.to_string(),
})
.await?;
- mapper::map_stream(response)
+ binary_mapper::map_stream(response)
}
async fn update_stream(&self, stream_id: &Identifier, name: &str) -> Result<(), IggyError> {
diff --git a/core/binary_protocol/src/client/binary_system/mod.rs b/core/common/src/traits/binary_impls/system.rs
similarity index 82%
rename from core/binary_protocol/src/client/binary_system/mod.rs
rename to core/common/src/traits/binary_impls/system.rs
index 4ef9ea89a..d35bd5ce1 100644
--- a/core/binary_protocol/src/client/binary_system/mod.rs
+++ b/core/common/src/traits/binary_impls/system.rs
@@ -16,31 +16,31 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, SystemClient};
-use iggy_common::get_client::GetClient;
-use iggy_common::get_clients::GetClients;
-use iggy_common::get_me::GetMe;
-use iggy_common::get_snapshot::GetSnapshot;
-use iggy_common::get_stats::GetStats;
-use iggy_common::ping::Ping;
-use iggy_common::{
+use crate::BinaryClient;
+use crate::get_client::GetClient;
+use crate::get_clients::GetClients;
+use crate::get_me::GetMe;
+use crate::get_snapshot::GetSnapshot;
+use crate::get_stats::GetStats;
+use crate::ping::Ping;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::{
ClientInfo, ClientInfoDetails, IggyDuration, IggyError, Snapshot, SnapshotCompression, Stats,
- SystemSnapshotType,
+ SystemClient, SystemSnapshotType,
};
#[async_trait::async_trait]
impl<B: BinaryClient> SystemClient for B {
async fn get_stats(&self) -> Result<Stats, IggyError> {
let response = self.send_with_response(&GetStats {}).await?;
- mapper::map_stats(response)
+ binary_mapper::map_stats(response)
}
async fn get_me(&self) -> Result<ClientInfoDetails, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetMe {}).await?;
- mapper::map_client(response)
+ binary_mapper::map_client(response)
}
async fn get_client(&self, client_id: u32) -> Result<Option<ClientInfoDetails>, IggyError> {
@@ -50,13 +50,13 @@ impl<B: BinaryClient> SystemClient for B {
return Ok(None);
}
- mapper::map_client(response).map(Some)
+ binary_mapper::map_client(response).map(Some)
}
async fn get_clients(&self) -> Result<Vec<ClientInfo>, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetClients {}).await?;
- mapper::map_clients(response)
+ binary_mapper::map_clients(response)
}
async fn ping(&self) -> Result<(), IggyError> {
diff --git a/core/binary_protocol/src/client/binary_topics/mod.rs b/core/common/src/traits/binary_impls/topics.rs
similarity index 87%
rename from core/binary_protocol/src/client/binary_topics/mod.rs
rename to core/common/src/traits/binary_impls/topics.rs
index 7ddb4205a..92f71374e 100644
--- a/core/binary_protocol/src/client/binary_topics/mod.rs
+++ b/core/common/src/traits/binary_impls/topics.rs
@@ -16,17 +16,18 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, TopicClient};
-use iggy_common::create_topic::CreateTopic;
-use iggy_common::delete_topic::DeleteTopic;
-use iggy_common::get_topic::GetTopic;
-use iggy_common::get_topics::GetTopics;
-use iggy_common::purge_topic::PurgeTopic;
-use iggy_common::update_topic::UpdateTopic;
-use iggy_common::{
- CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize, Topic, TopicDetails,
+use crate::BinaryClient;
+use crate::create_topic::CreateTopic;
+use crate::delete_topic::DeleteTopic;
+use crate::get_topic::GetTopic;
+use crate::get_topics::GetTopics;
+use crate::purge_topic::PurgeTopic;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::update_topic::UpdateTopic;
+use crate::{
+ CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize, Topic, TopicClient,
+ TopicDetails,
};
#[async_trait::async_trait]
@@ -47,7 +48,7 @@ impl<B: BinaryClient> TopicClient for B {
return Ok(None);
}
- mapper::map_topic(response).map(Some)
+ binary_mapper::map_topic(response).map(Some)
}
async fn get_topics(&self, stream_id: &Identifier) -> Result<Vec<Topic>, IggyError> {
@@ -57,7 +58,7 @@ impl<B: BinaryClient> TopicClient for B {
stream_id: stream_id.clone(),
})
.await?;
- mapper::map_topics(response)
+ binary_mapper::map_topics(response)
}
async fn create_topic(
@@ -82,7 +83,7 @@ impl<B: BinaryClient> TopicClient for B {
max_topic_size,
})
.await?;
- mapper::map_topic(response)
+ binary_mapper::map_topic(response)
}
async fn update_topic(
diff --git a/core/binary_protocol/src/client/binary_users/mod.rs b/core/common/src/traits/binary_impls/users.rs
similarity index 85%
rename from core/binary_protocol/src/client/binary_users/mod.rs
rename to core/common/src/traits/binary_impls/users.rs
index a1b484a03..9b4edc8f9 100644
--- a/core/binary_protocol/src/client/binary_users/mod.rs
+++ b/core/common/src/traits/binary_impls/users.rs
@@ -16,21 +16,21 @@
* under the License.
*/
-use crate::utils::auth::fail_if_not_authenticated;
-use crate::utils::mapper;
-use crate::{BinaryClient, UserClient};
-use iggy_common::change_password::ChangePassword;
-use iggy_common::create_user::CreateUser;
-use iggy_common::delete_user::DeleteUser;
-use iggy_common::get_user::GetUser;
-use iggy_common::get_users::GetUsers;
-use iggy_common::login_user::LoginUser;
-use iggy_common::logout_user::LogoutUser;
-use iggy_common::update_permissions::UpdatePermissions;
-use iggy_common::update_user::UpdateUser;
-use iggy_common::{
- ClientState, DiagnosticEvent, Identifier, IdentityInfo, IggyError, Permissions, UserInfo,
- UserInfoDetails, UserStatus,
+use crate::BinaryClient;
+use crate::change_password::ChangePassword;
+use crate::create_user::CreateUser;
+use crate::delete_user::DeleteUser;
+use crate::get_user::GetUser;
+use crate::get_users::GetUsers;
+use crate::login_user::LoginUser;
+use crate::logout_user::LogoutUser;
+use crate::traits::binary_auth::fail_if_not_authenticated;
+use crate::traits::binary_mapper;
+use crate::update_permissions::UpdatePermissions;
+use crate::update_user::UpdateUser;
+use crate::{
+ ClientState, DiagnosticEvent, Identifier, IdentityInfo, IggyError, Permissions, UserClient,
+ UserInfo, UserInfoDetails, UserStatus,
};
#[async_trait::async_trait]
@@ -46,13 +46,13 @@ impl<B: BinaryClient> UserClient for B {
return Ok(None);
}
- mapper::map_user(response).map(Some)
+ binary_mapper::map_user(response).map(Some)
}
async fn get_users(&self) -> Result<Vec<UserInfo>, IggyError> {
fail_if_not_authenticated(self).await?;
let response = self.send_with_response(&GetUsers {}).await?;
- mapper::map_users(response)
+ binary_mapper::map_users(response)
}
async fn create_user(
@@ -71,7 +71,7 @@ impl<B: BinaryClient> UserClient for B {
permissions,
})
.await?;
- mapper::map_user(response)
+ binary_mapper::map_user(response)
}
async fn delete_user(&self, user_id: &Identifier) -> Result<(), IggyError> {
@@ -140,7 +140,7 @@ impl<B: BinaryClient> UserClient for B {
.await?;
self.set_state(ClientState::Authenticated).await;
self.publish_event(DiagnosticEvent::SignedIn).await;
- mapper::map_identity_info(response)
+ binary_mapper::map_identity_info(response)
}
async fn logout_user(&self) -> Result<(), IggyError> {
diff --git a/core/binary_protocol/src/utils/mapper.rs b/core/common/src/traits/binary_mapper.rs
similarity index 99%
rename from core/binary_protocol/src/utils/mapper.rs
rename to core/common/src/traits/binary_mapper.rs
index ade37593a..727f16aa1 100644
--- a/core/binary_protocol/src/utils/mapper.rs
+++ b/core/common/src/traits/binary_mapper.rs
@@ -16,14 +16,14 @@
* under the License.
*/
-use bytes::Bytes;
-use iggy_common::{
+use crate::{
BytesSerializable, CacheMetrics, CacheMetricsKey, ClientInfo, ClientInfoDetails,
ClusterMetadata, CompressionAlgorithm, ConsumerGroup, ConsumerGroupDetails, ConsumerGroupInfo,
ConsumerGroupMember, ConsumerOffsetInfo, IdentityInfo, IggyByteSize, IggyError, IggyExpiry,
MaxTopicSize, Partition, Permissions, PersonalAccessTokenInfo, RawPersonalAccessToken, Stats,
Stream, StreamDetails, Topic, TopicDetails, UserInfo, UserInfoDetails, UserStatus,
};
+use bytes::Bytes;
use std::collections::HashMap;
use std::str::from_utf8;
diff --git a/core/binary_protocol/src/client/binary_transport/mod.rs b/core/common/src/traits/binary_transport.rs
similarity index 94%
rename from core/binary_protocol/src/client/binary_transport/mod.rs
rename to core/common/src/traits/binary_transport.rs
index e15f435aa..edcd9a84a 100644
--- a/core/binary_protocol/src/client/binary_transport/mod.rs
+++ b/core/common/src/traits/binary_transport.rs
@@ -16,9 +16,9 @@
* under the License.
*/
+use crate::{ClientState, Command, DiagnosticEvent, IggyDuration, IggyError};
use async_trait::async_trait;
use bytes::Bytes;
-use iggy_common::{ClientState, Command, DiagnosticEvent, IggyDuration, IggyError};
#[async_trait]
pub trait BinaryTransport {
diff --git a/core/binary_protocol/src/client/binary_clients/client.rs b/core/common/src/traits/client.rs
similarity index 97%
rename from core/binary_protocol/src/client/binary_clients/client.rs
rename to core/common/src/traits/client.rs
index 35a4aebe1..5c43523ad 100644
--- a/core/binary_protocol/src/client/binary_clients/client.rs
+++ b/core/common/src/traits/client.rs
@@ -20,9 +20,9 @@ use crate::{
ClusterClient, ConsumerGroupClient, ConsumerOffsetClient, MessageClient, PartitionClient,
PersonalAccessTokenClient, SegmentClient, StreamClient, SystemClient, TopicClient, UserClient,
};
+use crate::{DiagnosticEvent, IggyError};
use async_broadcast::Receiver;
use async_trait::async_trait;
-use iggy_common::{DiagnosticEvent, IggyError};
use std::fmt::Debug;
/// The client trait which is the main interface to the Iggy server.
diff --git a/core/binary_protocol/src/client/binary_clients/cluster_client.rs b/core/common/src/traits/cluster_client.rs
similarity index 96%
rename from core/binary_protocol/src/client/binary_clients/cluster_client.rs
rename to core/common/src/traits/cluster_client.rs
index 0570b0e6d..2212925a8 100644
--- a/core/binary_protocol/src/client/binary_clients/cluster_client.rs
+++ b/core/common/src/traits/cluster_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{ClusterMetadata, IggyError};
use async_trait::async_trait;
-use iggy_common::{ClusterMetadata, IggyError};
/// This trait defines the methods to interact with the cluster module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/consumer_group_client.rs b/core/common/src/traits/consumer_group_client.rs
similarity index 97%
rename from core/binary_protocol/src/client/binary_clients/consumer_group_client.rs
rename to core/common/src/traits/consumer_group_client.rs
index 49f3b373f..ef470983f 100644
--- a/core/binary_protocol/src/client/binary_clients/consumer_group_client.rs
+++ b/core/common/src/traits/consumer_group_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{ConsumerGroup, ConsumerGroupDetails, Identifier, IggyError};
use async_trait::async_trait;
-use iggy_common::{ConsumerGroup, ConsumerGroupDetails, Identifier, IggyError};
/// This trait defines the methods to interact with the consumer group module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/consumer_offset_client.rs b/core/common/src/traits/consumer_offset_client.rs
similarity index 96%
rename from core/binary_protocol/src/client/binary_clients/consumer_offset_client.rs
rename to core/common/src/traits/consumer_offset_client.rs
index 07b33e7cf..a3673ff3a 100644
--- a/core/binary_protocol/src/client/binary_clients/consumer_offset_client.rs
+++ b/core/common/src/traits/consumer_offset_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
use async_trait::async_trait;
-use iggy_common::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
/// This trait defines the methods to interact with the consumer offset module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/message_client.rs b/core/common/src/traits/message_client.rs
similarity index 99%
rename from core/binary_protocol/src/client/binary_clients/message_client.rs
rename to core/common/src/traits/message_client.rs
index 95bc9511e..62ebf4aec 100644
--- a/core/binary_protocol/src/client/binary_clients/message_client.rs
+++ b/core/common/src/traits/message_client.rs
@@ -15,10 +15,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-use async_trait::async_trait;
-use iggy_common::{
+use crate::{
Consumer, Identifier, IggyError, IggyMessage, Partitioning, PolledMessages, PollingStrategy,
};
+use async_trait::async_trait;
/// This trait defines the methods to interact with the messaging module.
#[async_trait]
diff --git a/core/common/src/traits/mod.rs b/core/common/src/traits/mod.rs
index 6b8d3f182..701a0bb9c 100644
--- a/core/common/src/traits/mod.rs
+++ b/core/common/src/traits/mod.rs
@@ -15,7 +15,24 @@
// specific language governing permissions and limitations
// under the License.
+pub(crate) mod binary_auth;
+pub(crate) mod binary_client;
+mod binary_impls;
+pub(crate) mod binary_mapper;
+pub(crate) mod binary_transport;
pub(crate) mod bytes_serializable;
+pub(crate) mod client;
+pub(crate) mod cluster_client;
+pub(crate) mod consumer_group_client;
+pub(crate) mod consumer_offset_client;
+pub(crate) mod message_client;
+pub(crate) mod partition_client;
pub(crate) mod partitioner;
+pub(crate) mod personal_access_token_client;
+pub(crate) mod segment_client;
pub(crate) mod sizeable;
+pub(crate) mod stream_client;
+pub(crate) mod system_client;
+pub(crate) mod topic_client;
+pub(crate) mod user_client;
pub(crate) mod validatable;
diff --git a/core/binary_protocol/src/client/binary_clients/partition_client.rs b/core/common/src/traits/partition_client.rs
similarity index 97%
rename from core/binary_protocol/src/client/binary_clients/partition_client.rs
rename to core/common/src/traits/partition_client.rs
index 7f7324d91..c3c2f540a 100644
--- a/core/binary_protocol/src/client/binary_clients/partition_client.rs
+++ b/core/common/src/traits/partition_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{Identifier, IggyError};
use async_trait::async_trait;
-use iggy_common::{Identifier, IggyError};
/// This trait defines the methods to interact with the partition module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/personal_access_token_client.rs b/core/common/src/traits/personal_access_token_client.rs
similarity index 99%
rename from core/binary_protocol/src/client/binary_clients/personal_access_token_client.rs
rename to core/common/src/traits/personal_access_token_client.rs
index fe2e90fef..603352b93 100644
--- a/core/binary_protocol/src/client/binary_clients/personal_access_token_client.rs
+++ b/core/common/src/traits/personal_access_token_client.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use async_trait::async_trait;
-use iggy_common::{
+use crate::{
IdentityInfo, IggyError, PersonalAccessTokenExpiry, PersonalAccessTokenInfo,
RawPersonalAccessToken,
};
+use async_trait::async_trait;
/// This trait defines the methods to interact with the personal access token module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/segment_client.rs b/core/common/src/traits/segment_client.rs
similarity index 97%
rename from core/binary_protocol/src/client/binary_clients/segment_client.rs
rename to core/common/src/traits/segment_client.rs
index 3e3ba0d1a..c70964e4a 100644
--- a/core/binary_protocol/src/client/binary_clients/segment_client.rs
+++ b/core/common/src/traits/segment_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{Identifier, IggyError};
use async_trait::async_trait;
-use iggy_common::{Identifier, IggyError};
/// This trait defines the methods to interact with the partition module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/stream_client.rs b/core/common/src/traits/stream_client.rs
similarity index 97%
rename from core/binary_protocol/src/client/binary_clients/stream_client.rs
rename to core/common/src/traits/stream_client.rs
index b56c44b3d..5d3ef3564 100644
--- a/core/binary_protocol/src/client/binary_clients/stream_client.rs
+++ b/core/common/src/traits/stream_client.rs
@@ -16,8 +16,8 @@
* under the License.
*/
+use crate::{Identifier, IggyError, Stream, StreamDetails};
use async_trait::async_trait;
-use iggy_common::{Identifier, IggyError, Stream, StreamDetails};
/// This trait defines the methods to interact with the stream module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/system_client.rs b/core/common/src/traits/system_client.rs
similarity index 99%
rename from core/binary_protocol/src/client/binary_clients/system_client.rs
rename to core/common/src/traits/system_client.rs
index 937673626..a674139be 100644
--- a/core/binary_protocol/src/client/binary_clients/system_client.rs
+++ b/core/common/src/traits/system_client.rs
@@ -16,11 +16,11 @@
* under the License.
*/
-use async_trait::async_trait;
-use iggy_common::{
+use crate::{
ClientInfo, ClientInfoDetails, IggyDuration, IggyError, Snapshot, SnapshotCompression, Stats,
SystemSnapshotType,
};
+use async_trait::async_trait;
/// This trait defines the methods to interact with the system module.
#[async_trait]
diff --git a/core/binary_protocol/src/client/binary_clients/topic_client.rs b/core/common/src/traits/topic_client.rs
similarity index 99%
rename from core/binary_protocol/src/client/binary_clients/topic_client.rs
rename to core/common/src/traits/topic_client.rs
index bc2c0b201..bf3406ebe 100644
--- a/core/binary_protocol/src/client/binary_clients/topic_client.rs
+++ b/core/common/src/traits/topic_client.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use async_trait::async_trait;
-use iggy_common::{
+use crate::{
CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize, Topic, TopicDetails,
};
+use async_trait::async_trait;
/// This trait defines the methods to interact with the topic module.
#[allow(clippy::too_many_arguments)]
diff --git a/core/binary_protocol/src/client/binary_clients/user_client.rs b/core/common/src/traits/user_client.rs
similarity index 99%
rename from core/binary_protocol/src/client/binary_clients/user_client.rs
rename to core/common/src/traits/user_client.rs
index bc794a1c8..5964a093b 100644
--- a/core/binary_protocol/src/client/binary_clients/user_client.rs
+++ b/core/common/src/traits/user_client.rs
@@ -16,10 +16,10 @@
* under the License.
*/
-use async_trait::async_trait;
-use iggy_common::{
+use crate::{
Identifier, IdentityInfo, IggyError, Permissions, UserInfo, UserInfoDetails, UserStatus,
};
+use async_trait::async_trait;
/// This trait defines the methods to interact with the user module.
#[async_trait]
diff --git a/core/integration/Cargo.toml b/core/integration/Cargo.toml
index 4c58bcb26..b0cf3baf9 100644
--- a/core/integration/Cargo.toml
+++ b/core/integration/Cargo.toml
@@ -41,7 +41,7 @@ futures = { workspace = true }
harness_derive = { workspace = true }
humantime = { workspace = true }
iggy = { workspace = true }
-iggy_binary_protocol = { workspace = true }
+iggy-cli = { workspace = true }
iggy_common = { workspace = true }
iggy_connector_sdk = { workspace = true, features = ["api"] }
keyring = { workspace = true }
diff --git a/core/integration/src/harness/seeds.rs b/core/integration/src/harness/seeds.rs
index 13ddf4d43..dd91d7fec 100644
--- a/core/integration/src/harness/seeds.rs
+++ b/core/integration/src/harness/seeds.rs
@@ -18,13 +18,13 @@
*/
use iggy::prelude::{IggyClient, StreamClient, TopicClient};
-use iggy_binary_protocol::{
- ConsumerGroupClient, ConsumerOffsetClient, MessageClient, PersonalAccessTokenClient, UserClient,
-};
use iggy_common::{
CompressionAlgorithm, Consumer, Identifier, IggyExpiry, IggyMessage, MaxTopicSize,
Partitioning, PersonalAccessTokenExpiry, UserStatus,
};
+use iggy_common::{
+ ConsumerGroupClient, ConsumerOffsetClient, MessageClient, PersonalAccessTokenClient, UserClient,
+};
use std::error::Error;
/// Seed error type for compatibility.
diff --git a/core/integration/tests/cli/context/common.rs b/core/integration/tests/cli/context/common.rs
index ec6e7dd2a..19c02184f 100644
--- a/core/integration/tests/cli/context/common.rs
+++ b/core/integration/tests/cli/context/common.rs
@@ -18,7 +18,7 @@
use std::path::PathBuf;
-use iggy_binary_protocol::cli::binary_context::common::{ContextReaderWriter, ContextsConfigMap};
+use iggy_cli::commands::binary_context::common::{ContextReaderWriter, ContextsConfigMap};
use tempfile::{TempDir, tempdir};
pub struct TestIggyContext {
diff --git a/core/integration/tests/cli/context/test_context_applied.rs b/core/integration/tests/cli/context/test_context_applied.rs
index 59f42a2c8..30a9457b3 100644
--- a/core/integration/tests/cli/context/test_context_applied.rs
+++ b/core/integration/tests/cli/context/test_context_applied.rs
@@ -22,7 +22,7 @@ use assert_cmd::assert::Assert;
use async_trait::async_trait;
use iggy::prelude::ArgsOptional;
use iggy::prelude::Client;
-use iggy_binary_protocol::cli::binary_context::common::ContextConfig;
+use iggy_cli::commands::binary_context::common::ContextConfig;
use integration::harness::ServerHandle;
use predicates::str::{contains, starts_with};
use serial_test::parallel;
diff --git a/core/integration/tests/cli/context/test_context_list_command.rs b/core/integration/tests/cli/context/test_context_list_command.rs
index 85047ff05..0656ce0e4 100644
--- a/core/integration/tests/cli/context/test_context_list_command.rs
+++ b/core/integration/tests/cli/context/test_context_list_command.rs
@@ -24,7 +24,7 @@ use crate::cli::common::{
use assert_cmd::assert::Assert;
use async_trait::async_trait;
use iggy::prelude::Client;
-use iggy_binary_protocol::cli::binary_context::common::ContextConfig;
+use iggy_cli::commands::binary_context::common::ContextConfig;
use predicates::str::contains;
use serial_test::parallel;
diff --git a/core/integration/tests/cli/context/test_context_use_command.rs b/core/integration/tests/cli/context/test_context_use_command.rs
index cbdd68f60..9be8be0ea 100644
--- a/core/integration/tests/cli/context/test_context_use_command.rs
+++ b/core/integration/tests/cli/context/test_context_use_command.rs
@@ -24,7 +24,7 @@ use crate::cli::common::{
use assert_cmd::assert::Assert;
use async_trait::async_trait;
use iggy::prelude::Client;
-use iggy_binary_protocol::cli::binary_context::common::ContextConfig;
+use iggy_cli::commands::binary_context::common::ContextConfig;
use predicates::str::contains;
use serial_test::parallel;
diff --git a/core/integration/tests/cli/system/test_login_cmd.rs b/core/integration/tests/cli/system/test_login_cmd.rs
index 4f511559e..160d81bca 100644
--- a/core/integration/tests/cli/system/test_login_cmd.rs
+++ b/core/integration/tests/cli/system/test_login_cmd.rs
@@ -21,7 +21,7 @@ use assert_cmd::assert::Assert;
use async_trait::async_trait;
use iggy::prelude::Client;
use iggy::prelude::PersonalAccessTokenExpiry;
-use iggy_binary_protocol::cli::binary_system::session::ServerSession;
+use iggy_cli::commands::binary_system::session::ServerSession;
use predicates::str::diff;
#[derive(Debug)]
diff --git a/core/integration/tests/cli/system/test_logout_cmd.rs b/core/integration/tests/cli/system/test_logout_cmd.rs
index d58fbdb19..9897dd372 100644
--- a/core/integration/tests/cli/system/test_logout_cmd.rs
+++ b/core/integration/tests/cli/system/test_logout_cmd.rs
@@ -20,7 +20,7 @@ use crate::cli::common::{IggyCmdCommand, IggyCmdTestCase};
use assert_cmd::assert::Assert;
use async_trait::async_trait;
use iggy::prelude::Client;
-use iggy_binary_protocol::cli::binary_system::session::ServerSession;
+use iggy_cli::commands::binary_system::session::ServerSession;
use predicates::str::diff;
#[derive(Debug)]
diff --git a/core/integration/tests/cli/system/test_stats_command.rs b/core/integration/tests/cli/system/test_stats_command.rs
index 4f921c7d6..2d4bd72e1 100644
--- a/core/integration/tests/cli/system/test_stats_command.rs
+++ b/core/integration/tests/cli/system/test_stats_command.rs
@@ -25,7 +25,7 @@ use iggy::prelude::Client;
use iggy::prelude::Identifier;
use iggy::prelude::IggyExpiry;
use iggy::prelude::MaxTopicSize;
-use iggy_binary_protocol::cli::binary_system::stats::GetStatsOutput;
+use iggy_cli::commands::binary_system::stats::GetStatsOutput;
use predicates::str::{contains, starts_with};
use serial_test::parallel;
diff --git a/core/integration/tests/connectors/elasticsearch/elasticsearch_sink.rs b/core/integration/tests/connectors/elasticsearch/elasticsearch_sink.rs
index 7478a6e6b..ad6ea1c86 100644
--- a/core/integration/tests/connectors/elasticsearch/elasticsearch_sink.rs
+++ b/core/integration/tests/connectors/elasticsearch/elasticsearch_sink.rs
@@ -22,8 +22,8 @@ use crate::connectors::create_test_messages;
use crate::connectors::fixtures::ElasticsearchSinkFixture;
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/elasticsearch/elasticsearch_source.rs b/core/integration/tests/connectors/elasticsearch/elasticsearch_source.rs
index eb9e3fa1d..5001bf0cc 100644
--- a/core/integration/tests/connectors/elasticsearch/elasticsearch_source.rs
+++ b/core/integration/tests/connectors/elasticsearch/elasticsearch_source.rs
@@ -19,7 +19,7 @@
use super::{POLL_ATTEMPTS, POLL_INTERVAL_MS, TEST_MESSAGE_COUNT};
use crate::connectors::fixtures::ElasticsearchSourcePreCreatedFixture;
-use iggy_binary_protocol::MessageClient;
+use iggy_common::MessageClient;
use iggy_common::{Consumer, Identifier, PollingStrategy};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/iceberg/iceberg_sink.rs b/core/integration/tests/connectors/iceberg/iceberg_sink.rs
index f4f553bc7..777214116 100644
--- a/core/integration/tests/connectors/iceberg/iceberg_sink.rs
+++ b/core/integration/tests/connectors/iceberg/iceberg_sink.rs
@@ -23,8 +23,8 @@ use crate::connectors::fixtures::{
};
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use iggy_connector_sdk::api::SinkInfoResponse;
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/mongodb/mongodb_sink.rs b/core/integration/tests/connectors/mongodb/mongodb_sink.rs
index 0bf666a4b..37c522e34 100644
--- a/core/integration/tests/connectors/mongodb/mongodb_sink.rs
+++ b/core/integration/tests/connectors/mongodb/mongodb_sink.rs
@@ -24,8 +24,8 @@ use crate::connectors::fixtures::{
};
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use iggy_connector_sdk::api::{ConnectorRuntimeStats, ConnectorStatus, SinkInfoResponse};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/postgres/postgres_sink.rs b/core/integration/tests/connectors/postgres/postgres_sink.rs
index bbe9c52b2..2032c025e 100644
--- a/core/integration/tests/connectors/postgres/postgres_sink.rs
+++ b/core/integration/tests/connectors/postgres/postgres_sink.rs
@@ -24,8 +24,8 @@ use crate::connectors::fixtures::{
use crate::connectors::{TestMessage, create_test_messages};
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/postgres/postgres_source.rs b/core/integration/tests/connectors/postgres/postgres_source.rs
index 5d322df36..bbfd0307b 100644
--- a/core/integration/tests/connectors/postgres/postgres_source.rs
+++ b/core/integration/tests/connectors/postgres/postgres_source.rs
@@ -24,7 +24,7 @@ use crate::connectors::fixtures::{
PostgresSourceJsonFixture, PostgresSourceJsonbFixture, PostgresSourceMarkFixture,
PostgresSourceOps,
};
-use iggy_binary_protocol::MessageClient;
+use iggy_common::MessageClient;
use iggy_common::{Consumer, Identifier, PollingStrategy};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/postgres/restart.rs b/core/integration/tests/connectors/postgres/restart.rs
index 97d9f2422..e6e5f203b 100644
--- a/core/integration/tests/connectors/postgres/restart.rs
+++ b/core/integration/tests/connectors/postgres/restart.rs
@@ -22,8 +22,8 @@ use crate::connectors::fixtures::{PostgresOps, PostgresSinkFixture};
use crate::connectors::{TestMessage, create_test_messages};
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use iggy_connector_sdk::api::{ConnectorStatus, SinkInfoResponse};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/quickwit/quickwit_sink.rs b/core/integration/tests/connectors/quickwit/quickwit_sink.rs
index 30f4efedd..ce3abd364 100644
--- a/core/integration/tests/connectors/quickwit/quickwit_sink.rs
+++ b/core/integration/tests/connectors/quickwit/quickwit_sink.rs
@@ -21,8 +21,8 @@ use crate::connectors::create_test_messages;
use crate::connectors::fixtures::{QuickwitFixture, QuickwitOps, QuickwitPreCreatedFixture};
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use integration::harness::seeds;
use integration::iggy_harness;
use serde::{Deserialize, Serialize};
diff --git a/core/integration/tests/connectors/random/random_source.rs b/core/integration/tests/connectors/random/random_source.rs
index 772f4c9df..5efb6fd08 100644
--- a/core/integration/tests/connectors/random/random_source.rs
+++ b/core/integration/tests/connectors/random/random_source.rs
@@ -17,7 +17,7 @@
* under the License.
*/
-use iggy_binary_protocol::MessageClient;
+use iggy_common::MessageClient;
use iggy_common::{Consumer, Identifier, PollingStrategy};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/integration/tests/connectors/stdout/stdout_sink.rs b/core/integration/tests/connectors/stdout/stdout_sink.rs
index b5fa268da..be247588c 100644
--- a/core/integration/tests/connectors/stdout/stdout_sink.rs
+++ b/core/integration/tests/connectors/stdout/stdout_sink.rs
@@ -20,8 +20,8 @@
use crate::connectors::create_test_messages;
use bytes::Bytes;
use iggy::prelude::{IggyMessage, Partitioning};
-use iggy_binary_protocol::MessageClient;
use iggy_common::Identifier;
+use iggy_common::MessageClient;
use iggy_connector_sdk::api::{ConnectorRuntimeStats, ConnectorStatus, SinkInfoResponse};
use integration::harness::seeds;
use integration::iggy_harness;
diff --git a/core/sdk/Cargo.toml b/core/sdk/Cargo.toml
index cf5c77c86..4d2af3e6e 100644
--- a/core/sdk/Cargo.toml
+++ b/core/sdk/Cargo.toml
@@ -38,7 +38,6 @@ dashmap = { workspace = true }
flume = { workspace = true }
futures = { workspace = true }
futures-util = { workspace = true }
-iggy_binary_protocol = { workspace = true }
iggy_common = { workspace = true }
quinn = { workspace = true }
reqwest = { workspace = true }
diff --git a/core/binary_protocol/src/cli/binary_client/mod.rs b/core/sdk/src/binary/mod.rs
similarity index 93%
rename from core/binary_protocol/src/cli/binary_client/mod.rs
rename to core/sdk/src/binary/mod.rs
index f544e1215..d6266c217 100644
--- a/core/binary_protocol/src/cli/binary_client/mod.rs
+++ b/core/sdk/src/binary/mod.rs
@@ -16,5 +16,4 @@
* under the License.
*/
-pub mod get_client;
-pub mod get_clients;
+pub use iggy_common::{BinaryClient, BinaryTransport};
diff --git a/core/sdk/src/client_provider.rs b/core/sdk/src/client_provider.rs
index 1b9eba736..fa93fd2c8 100644
--- a/core/sdk/src/client_provider.rs
+++ b/core/sdk/src/client_provider.rs
@@ -25,7 +25,7 @@ use crate::prelude::{
};
use crate::quic::quic_client::QuicClient;
use crate::tcp::tcp_client::TcpClient;
-use iggy_binary_protocol::Client;
+use iggy_common::Client;
use iggy_common::{
AutoLogin, Credentials, TransportProtocol, WebSocketClientConfig,
WebSocketClientReconnectionConfig, WebSocketConfig,
diff --git a/core/sdk/src/client_wrappers/binary_client.rs b/core/sdk/src/client_wrappers/binary_client.rs
index ee650c777..41de3a480 100644
--- a/core/sdk/src/client_wrappers/binary_client.rs
+++ b/core/sdk/src/client_wrappers/binary_client.rs
@@ -19,7 +19,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_broadcast::Receiver;
use async_trait::async_trait;
-use iggy_binary_protocol::Client;
+use iggy_common::Client;
use iggy_common::{DiagnosticEvent, IggyError};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_cluster_client.rs b/core/sdk/src/client_wrappers/binary_cluster_client.rs
index ca3cd3478..20b30e242 100644
--- a/core/sdk/src/client_wrappers/binary_cluster_client.rs
+++ b/core/sdk/src/client_wrappers/binary_cluster_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::ClusterClient;
+use iggy_common::ClusterClient;
use iggy_common::{ClusterMetadata, IggyError};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_consumer_group_client.rs b/core/sdk/src/client_wrappers/binary_consumer_group_client.rs
index d0f3d74b7..cfc744ab0 100644
--- a/core/sdk/src/client_wrappers/binary_consumer_group_client.rs
+++ b/core/sdk/src/client_wrappers/binary_consumer_group_client.rs
@@ -19,8 +19,8 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_dropper::AsyncDrop;
use async_trait::async_trait;
-use iggy_binary_protocol::{ConsumerGroupClient, UserClient};
use iggy_common::{ConsumerGroup, ConsumerGroupDetails, Identifier, IggyError};
+use iggy_common::{ConsumerGroupClient, UserClient};
#[async_trait]
impl ConsumerGroupClient for ClientWrapper {
diff --git a/core/sdk/src/client_wrappers/binary_consumer_offset_client.rs b/core/sdk/src/client_wrappers/binary_consumer_offset_client.rs
index d934f7de9..40b644c27 100644
--- a/core/sdk/src/client_wrappers/binary_consumer_offset_client.rs
+++ b/core/sdk/src/client_wrappers/binary_consumer_offset_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::ConsumerOffsetClient;
+use iggy_common::ConsumerOffsetClient;
use iggy_common::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_message_client.rs b/core/sdk/src/client_wrappers/binary_message_client.rs
index 48cffbb00..4742249fe 100644
--- a/core/sdk/src/client_wrappers/binary_message_client.rs
+++ b/core/sdk/src/client_wrappers/binary_message_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::MessageClient;
+use iggy_common::MessageClient;
use iggy_common::{
Consumer, Identifier, IggyError, IggyMessage, Partitioning, PolledMessages, PollingStrategy,
};
diff --git a/core/sdk/src/client_wrappers/binary_partition_client.rs b/core/sdk/src/client_wrappers/binary_partition_client.rs
index 83e60ed8e..b53a7a4e5 100644
--- a/core/sdk/src/client_wrappers/binary_partition_client.rs
+++ b/core/sdk/src/client_wrappers/binary_partition_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::PartitionClient;
+use iggy_common::PartitionClient;
use iggy_common::{Identifier, IggyError};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_personal_access_token_client.rs b/core/sdk/src/client_wrappers/binary_personal_access_token_client.rs
index 388f52450..063be39f7 100644
--- a/core/sdk/src/client_wrappers/binary_personal_access_token_client.rs
+++ b/core/sdk/src/client_wrappers/binary_personal_access_token_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::PersonalAccessTokenClient;
+use iggy_common::PersonalAccessTokenClient;
use iggy_common::{
IdentityInfo, IggyError, PersonalAccessTokenExpiry, PersonalAccessTokenInfo,
RawPersonalAccessToken,
diff --git a/core/sdk/src/client_wrappers/binary_segment_client.rs b/core/sdk/src/client_wrappers/binary_segment_client.rs
index f0e3b8cff..3eb833008 100644
--- a/core/sdk/src/client_wrappers/binary_segment_client.rs
+++ b/core/sdk/src/client_wrappers/binary_segment_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::SegmentClient;
+use iggy_common::SegmentClient;
use iggy_common::{Identifier, IggyError};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_stream_client.rs b/core/sdk/src/client_wrappers/binary_stream_client.rs
index a14d26c0a..79649e3b1 100644
--- a/core/sdk/src/client_wrappers/binary_stream_client.rs
+++ b/core/sdk/src/client_wrappers/binary_stream_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::StreamClient;
+use iggy_common::StreamClient;
use iggy_common::{Identifier, IggyError, Stream, StreamDetails};
#[async_trait]
diff --git a/core/sdk/src/client_wrappers/binary_system_client.rs b/core/sdk/src/client_wrappers/binary_system_client.rs
index 39363b726..c95d08f39 100644
--- a/core/sdk/src/client_wrappers/binary_system_client.rs
+++ b/core/sdk/src/client_wrappers/binary_system_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::SystemClient;
+use iggy_common::SystemClient;
use iggy_common::{
ClientInfo, ClientInfoDetails, IggyDuration, IggyError, Snapshot, SnapshotCompression, Stats,
SystemSnapshotType,
diff --git a/core/sdk/src/client_wrappers/binary_topic_client.rs b/core/sdk/src/client_wrappers/binary_topic_client.rs
index 9c8307fe0..a8044513a 100644
--- a/core/sdk/src/client_wrappers/binary_topic_client.rs
+++ b/core/sdk/src/client_wrappers/binary_topic_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::TopicClient;
+use iggy_common::TopicClient;
use iggy_common::{
CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize, Topic, TopicDetails,
};
diff --git a/core/sdk/src/client_wrappers/binary_user_client.rs b/core/sdk/src/client_wrappers/binary_user_client.rs
index a51234f89..85dd394db 100644
--- a/core/sdk/src/client_wrappers/binary_user_client.rs
+++ b/core/sdk/src/client_wrappers/binary_user_client.rs
@@ -18,7 +18,7 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use async_trait::async_trait;
-use iggy_binary_protocol::UserClient;
+use iggy_common::UserClient;
use iggy_common::{
Identifier, IdentityInfo, IggyError, Permissions, UserInfo, UserInfoDetails, UserStatus,
};
diff --git a/core/sdk/src/clients/binary_cluster.rs b/core/sdk/src/clients/binary_cluster.rs
index 6ab7ead4a..6de1449a1 100644
--- a/core/sdk/src/clients/binary_cluster.rs
+++ b/core/sdk/src/clients/binary_cluster.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::ClusterClient;
+use iggy_common::ClusterClient;
use iggy_common::{ClusterMetadata, IggyError, locking::IggyRwLockFn};
#[async_trait]
diff --git a/core/sdk/src/clients/binary_consumer_group.rs b/core/sdk/src/clients/binary_consumer_group.rs
index 4209dba39..938155a76 100644
--- a/core/sdk/src/clients/binary_consumer_group.rs
+++ b/core/sdk/src/clients/binary_consumer_group.rs
@@ -19,10 +19,10 @@
use crate::prelude::IggyClient;
use async_dropper::AsyncDrop;
use async_trait::async_trait;
-use iggy_binary_protocol::{ConsumerGroupClient, UserClient};
use iggy_common::{
ConsumerGroup, ConsumerGroupDetails, Identifier, IggyError, locking::IggyRwLockFn,
};
+use iggy_common::{ConsumerGroupClient, UserClient};
#[async_trait]
impl ConsumerGroupClient for IggyClient {
diff --git a/core/sdk/src/clients/binary_consumer_offset.rs b/core/sdk/src/clients/binary_consumer_offset.rs
index d1c50f237..1f28f9292 100644
--- a/core/sdk/src/clients/binary_consumer_offset.rs
+++ b/core/sdk/src/clients/binary_consumer_offset.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::ConsumerOffsetClient;
+use iggy_common::ConsumerOffsetClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{Consumer, ConsumerOffsetInfo, Identifier, IggyError};
diff --git a/core/sdk/src/clients/binary_message.rs b/core/sdk/src/clients/binary_message.rs
index 024646d37..63f064d8a 100644
--- a/core/sdk/src/clients/binary_message.rs
+++ b/core/sdk/src/clients/binary_message.rs
@@ -19,7 +19,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
use bytes::Bytes;
-use iggy_binary_protocol::MessageClient;
+use iggy_common::MessageClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{
Consumer, Identifier, IggyError, IggyMessage, Partitioning, PolledMessages, PollingStrategy,
diff --git a/core/sdk/src/clients/binary_partitions.rs b/core/sdk/src/clients/binary_partitions.rs
index d593a266a..57511dedd 100644
--- a/core/sdk/src/clients/binary_partitions.rs
+++ b/core/sdk/src/clients/binary_partitions.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::PartitionClient;
+use iggy_common::PartitionClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{Identifier, IggyError};
diff --git a/core/sdk/src/clients/binary_personal_access_tokens.rs b/core/sdk/src/clients/binary_personal_access_tokens.rs
index 91e4ba760..c97a93a6e 100644
--- a/core/sdk/src/clients/binary_personal_access_tokens.rs
+++ b/core/sdk/src/clients/binary_personal_access_tokens.rs
@@ -18,8 +18,8 @@
use crate::prelude::{ClientWrapper, IggyClient};
use async_trait::async_trait;
-use iggy_binary_protocol::{Client, PersonalAccessTokenClient};
use iggy_common::locking::IggyRwLockFn;
+use iggy_common::{Client, PersonalAccessTokenClient};
use iggy_common::{
IdentityInfo, IggyError, PersonalAccessTokenExpiry, PersonalAccessTokenInfo,
RawPersonalAccessToken,
diff --git a/core/sdk/src/clients/binary_segments.rs b/core/sdk/src/clients/binary_segments.rs
index 917335cb8..17a712764 100644
--- a/core/sdk/src/clients/binary_segments.rs
+++ b/core/sdk/src/clients/binary_segments.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::SegmentClient;
+use iggy_common::SegmentClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{Identifier, IggyError};
diff --git a/core/sdk/src/clients/binary_streams.rs b/core/sdk/src/clients/binary_streams.rs
index b64e8c6c0..63d0041ef 100644
--- a/core/sdk/src/clients/binary_streams.rs
+++ b/core/sdk/src/clients/binary_streams.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::StreamClient;
+use iggy_common::StreamClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{Identifier, IggyError, Stream, StreamDetails};
diff --git a/core/sdk/src/clients/binary_system.rs b/core/sdk/src/clients/binary_system.rs
index 719aac170..1caa74f59 100644
--- a/core/sdk/src/clients/binary_system.rs
+++ b/core/sdk/src/clients/binary_system.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::SystemClient;
+use iggy_common::SystemClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{
ClientInfo, ClientInfoDetails, IggyDuration, IggyError, Snapshot, SnapshotCompression, Stats,
diff --git a/core/sdk/src/clients/binary_topics.rs b/core/sdk/src/clients/binary_topics.rs
index 28c2b3462..9a1ed4e6b 100644
--- a/core/sdk/src/clients/binary_topics.rs
+++ b/core/sdk/src/clients/binary_topics.rs
@@ -18,7 +18,7 @@
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::TopicClient;
+use iggy_common::TopicClient;
use iggy_common::locking::IggyRwLockFn;
use iggy_common::{
CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize, Topic, TopicDetails,
diff --git a/core/sdk/src/clients/binary_users.rs b/core/sdk/src/clients/binary_users.rs
index b1b4db86f..7c5bedd92 100644
--- a/core/sdk/src/clients/binary_users.rs
+++ b/core/sdk/src/clients/binary_users.rs
@@ -19,8 +19,8 @@
use crate::client_wrappers::client_wrapper::ClientWrapper;
use crate::prelude::IggyClient;
use async_trait::async_trait;
-use iggy_binary_protocol::{Client, UserClient};
use iggy_common::locking::IggyRwLockFn;
+use iggy_common::{Client, UserClient};
use iggy_common::{
Identifier, IdentityInfo, IggyError, Permissions, UserInfo, UserInfoDetails, UserStatus,
};
diff --git a/core/sdk/src/clients/client.rs b/core/sdk/src/clients/client.rs
index b2dd19689..6ed641e69 100644
--- a/core/sdk/src/clients/client.rs
+++ b/core/sdk/src/clients/client.rs
@@ -29,9 +29,9 @@ use crate::tcp::tcp_client::TcpClient;
use crate::websocket::websocket_client::WebSocketClient;
use async_broadcast::Receiver;
use async_trait::async_trait;
-use iggy_binary_protocol::{Client, SystemClient};
use iggy_common::Consumer;
use iggy_common::locking::{IggyRwLock, IggyRwLockFn};
+use iggy_common::{Client, SystemClient};
use iggy_common::{ConnectionStringUtils, DiagnosticEvent, Partitioner, TransportProtocol};
use std::fmt::Debug;
use std::sync::Arc;
diff --git a/core/sdk/src/clients/consumer.rs b/core/sdk/src/clients/consumer.rs
index 81be663a7..37b203286 100644
--- a/core/sdk/src/clients/consumer.rs
+++ b/core/sdk/src/clients/consumer.rs
@@ -21,10 +21,10 @@ use bytes::Bytes;
use dashmap::DashMap;
use futures::Stream;
use futures_util::{FutureExt, StreamExt};
-use iggy_binary_protocol::{
+use iggy_common::locking::{IggyRwLock, IggyRwLockFn};
+use iggy_common::{
Client, ConsumerGroupClient, ConsumerOffsetClient, MessageClient, StreamClient, TopicClient,
};
-use iggy_common::locking::{IggyRwLock, IggyRwLockFn};
use iggy_common::{
Consumer, ConsumerKind, DiagnosticEvent, EncryptorKind, IdKind, Identifier, IggyDuration,
IggyError, IggyMessage, IggyTimestamp, PolledMessages, PollingKind, PollingStrategy,
diff --git a/core/sdk/src/clients/producer.rs b/core/sdk/src/clients/producer.rs
index 67a5bf8d4..badd909f0 100644
--- a/core/sdk/src/clients/producer.rs
+++ b/core/sdk/src/clients/producer.rs
@@ -23,8 +23,8 @@ use crate::clients::producer_config::DirectConfig;
use crate::clients::producer_dispatcher::ProducerDispatcher;
use bytes::Bytes;
use futures_util::StreamExt;
-use iggy_binary_protocol::{Client, MessageClient, StreamClient, TopicClient};
use iggy_common::locking::{IggyRwLock, IggyRwLockFn};
+use iggy_common::{Client, MessageClient, StreamClient, TopicClient};
use iggy_common::{
CompressionAlgorithm, DiagnosticEvent, EncryptorKind, IdKind, Identifier, IggyDuration,
IggyError, IggyExpiry, IggyMessage, IggyTimestamp, MaxTopicSize, Partitioner, Partitioning,
diff --git a/core/sdk/src/http/cluster.rs b/core/sdk/src/http/cluster.rs
index 6a1ac1fff..cec3a2e3c 100644
--- a/core/sdk/src/http/cluster.rs
+++ b/core/sdk/src/http/cluster.rs
@@ -19,7 +19,7 @@
use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use async_trait::async_trait;
-use iggy_binary_protocol::ClusterClient;
+use iggy_common::ClusterClient;
use iggy_common::{ClusterMetadata, IggyError};
#[async_trait]
diff --git a/core/sdk/src/http/consumer_groups.rs b/core/sdk/src/http/consumer_groups.rs
index 389c1aa99..c309cbd27 100644
--- a/core/sdk/src/http/consumer_groups.rs
+++ b/core/sdk/src/http/consumer_groups.rs
@@ -20,7 +20,7 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::IggyError;
use async_trait::async_trait;
-use iggy_binary_protocol::ConsumerGroupClient;
+use iggy_common::ConsumerGroupClient;
use iggy_common::Identifier;
use iggy_common::create_consumer_group::CreateConsumerGroup;
use iggy_common::{ConsumerGroup, ConsumerGroupDetails};
diff --git a/core/sdk/src/http/consumer_offsets.rs b/core/sdk/src/http/consumer_offsets.rs
index a9abb26d9..34b8a3ce0 100644
--- a/core/sdk/src/http/consumer_offsets.rs
+++ b/core/sdk/src/http/consumer_offsets.rs
@@ -21,7 +21,7 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::Identifier;
use crate::prelude::IggyError;
use async_trait::async_trait;
-use iggy_binary_protocol::ConsumerOffsetClient;
+use iggy_common::ConsumerOffsetClient;
use iggy_common::get_consumer_offset::GetConsumerOffset;
use iggy_common::store_consumer_offset::StoreConsumerOffset;
use iggy_common::{Consumer, ConsumerOffsetInfo};
diff --git a/core/sdk/src/http/messages.rs b/core/sdk/src/http/messages.rs
index 13840265a..2792c902d 100644
--- a/core/sdk/src/http/messages.rs
+++ b/core/sdk/src/http/messages.rs
@@ -23,8 +23,8 @@ use crate::prelude::{
PolledMessages, PollingStrategy, SendMessages,
};
use async_trait::async_trait;
-use iggy_binary_protocol::MessageClient;
use iggy_common::IggyMessagesBatch;
+use iggy_common::MessageClient;
#[async_trait]
impl MessageClient for HttpClient {
diff --git a/core/sdk/src/http/partitions.rs b/core/sdk/src/http/partitions.rs
index 956f0d3d0..f74e41544 100644
--- a/core/sdk/src/http/partitions.rs
+++ b/core/sdk/src/http/partitions.rs
@@ -20,7 +20,7 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::{Identifier, IggyError};
use async_trait::async_trait;
-use iggy_binary_protocol::PartitionClient;
+use iggy_common::PartitionClient;
use iggy_common::create_partitions::CreatePartitions;
use iggy_common::delete_partitions::DeletePartitions;
diff --git a/core/sdk/src/http/personal_access_tokens.rs b/core/sdk/src/http/personal_access_tokens.rs
index 7c2fb3f94..f9c6923a2 100644
--- a/core/sdk/src/http/personal_access_tokens.rs
+++ b/core/sdk/src/http/personal_access_tokens.rs
@@ -20,8 +20,8 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::IggyError;
use async_trait::async_trait;
-use iggy_binary_protocol::PersonalAccessTokenClient;
use iggy_common::IdentityInfo;
+use iggy_common::PersonalAccessTokenClient;
use iggy_common::PersonalAccessTokenExpiry;
use iggy_common::create_personal_access_token::CreatePersonalAccessToken;
use iggy_common::login_with_personal_access_token::LoginWithPersonalAccessToken;
diff --git a/core/sdk/src/http/segments.rs b/core/sdk/src/http/segments.rs
index cfd91e50c..27b245eb8 100644
--- a/core/sdk/src/http/segments.rs
+++ b/core/sdk/src/http/segments.rs
@@ -19,7 +19,7 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::{Identifier, IggyError};
use async_trait::async_trait;
-use iggy_binary_protocol::SegmentClient;
+use iggy_common::SegmentClient;
use iggy_common::delete_segments::DeleteSegments;
#[async_trait]
diff --git a/core/sdk/src/http/streams.rs b/core/sdk/src/http/streams.rs
index 509cbd590..b2a5afb17 100644
--- a/core/sdk/src/http/streams.rs
+++ b/core/sdk/src/http/streams.rs
@@ -21,7 +21,7 @@ use crate::http::http_transport::HttpTransport;
use crate::prelude::Identifier;
use crate::prelude::IggyError;
use async_trait::async_trait;
-use iggy_binary_protocol::StreamClient;
+use iggy_common::StreamClient;
use iggy_common::create_stream::CreateStream;
use iggy_common::update_stream::UpdateStream;
use iggy_common::{Stream, StreamDetails};
diff --git a/core/sdk/src/http/system.rs b/core/sdk/src/http/system.rs
index 4373ffd32..295925c7a 100644
--- a/core/sdk/src/http/system.rs
+++ b/core/sdk/src/http/system.rs
@@ -20,9 +20,9 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::{IggyDuration, IggyError};
use async_trait::async_trait;
-use iggy_binary_protocol::SystemClient;
use iggy_common::Snapshot;
use iggy_common::Stats;
+use iggy_common::SystemClient;
use iggy_common::get_snapshot::GetSnapshot;
use iggy_common::{ClientInfo, ClientInfoDetails};
use iggy_common::{SnapshotCompression, SystemSnapshotType};
diff --git a/core/sdk/src/http/topics.rs b/core/sdk/src/http/topics.rs
index 7ac71d2ae..9ef0227d8 100644
--- a/core/sdk/src/http/topics.rs
+++ b/core/sdk/src/http/topics.rs
@@ -20,7 +20,7 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::{CompressionAlgorithm, Identifier, IggyError, IggyExpiry, MaxTopicSize};
use async_trait::async_trait;
-use iggy_binary_protocol::TopicClient;
+use iggy_common::TopicClient;
use iggy_common::create_topic::CreateTopic;
use iggy_common::update_topic::UpdateTopic;
use iggy_common::{Topic, TopicDetails};
diff --git a/core/sdk/src/http/users.rs b/core/sdk/src/http/users.rs
index 73cfed5d5..496e94e86 100644
--- a/core/sdk/src/http/users.rs
+++ b/core/sdk/src/http/users.rs
@@ -20,7 +20,7 @@ use crate::http::http_client::HttpClient;
use crate::http::http_transport::HttpTransport;
use crate::prelude::{Identifier, IggyError};
use async_trait::async_trait;
-use iggy_binary_protocol::UserClient;
+use iggy_common::UserClient;
use iggy_common::change_password::ChangePassword;
use iggy_common::create_user::CreateUser;
use iggy_common::login_user::LoginUser;
diff --git a/core/sdk/src/leader_aware.rs b/core/sdk/src/leader_aware.rs
index d09f31a0a..e20b2f5a2 100644
--- a/core/sdk/src/leader_aware.rs
+++ b/core/sdk/src/leader_aware.rs
@@ -16,7 +16,7 @@
* under the License.
*/
-use iggy_binary_protocol::ClusterClient;
+use iggy_common::ClusterClient;
use iggy_common::{
ClusterMetadata, ClusterNodeRole, ClusterNodeStatus, IggyError, TransportProtocol,
};
diff --git a/core/sdk/src/lib.rs b/core/sdk/src/lib.rs
index f36471c1e..9fa07df91 100644
--- a/core/sdk/src/lib.rs
+++ b/core/sdk/src/lib.rs
@@ -16,6 +16,7 @@
* under the License.
*/
+pub mod binary;
pub mod client_provider;
pub mod client_wrappers;
pub mod clients;
diff --git a/core/sdk/src/prelude.rs b/core/sdk/src/prelude.rs
index bcbb44f82..2f0d9c8aa 100644
--- a/core/sdk/src/prelude.rs
+++ b/core/sdk/src/prelude.rs
@@ -48,11 +48,6 @@ pub use crate::stream_builder::{IggyProducerConfig, IggyStreamProducer};
pub use crate::stream_builder::{IggyStream, IggyStreamConfig};
pub use crate::tcp::tcp_client::TcpClient;
pub use crate::websocket::websocket_client::WebSocketClient;
-pub use iggy_binary_protocol::{
- Client, ClusterClient, ConsumerGroupClient, ConsumerOffsetClient, MessageClient,
- PartitionClient, PersonalAccessTokenClient, SegmentClient, StreamClient, SystemClient,
- TopicClient, UserClient,
-};
pub use iggy_common::{
Aes256GcmEncryptor, Args, ArgsOptional, AutoLogin, BytesSerializable, CacheMetrics,
CacheMetricsKey, ClientError, ClientInfoDetails, ClusterMetadata, ClusterNode, ClusterNodeRole,
@@ -69,6 +64,11 @@ pub use iggy_common::{
TransportProtocol, UserId, UserStatus, Validatable, WebSocketClientConfig,
WebSocketClientConfigBuilder, WebSocketClientReconnectionConfig, defaults, locking,
};
+pub use iggy_common::{
+ Client, ClusterClient, ConsumerGroupClient, ConsumerOffsetClient, MessageClient,
+ PartitionClient, PersonalAccessTokenClient, SegmentClient, StreamClient, SystemClient,
+ TopicClient, UserClient,
+};
pub use iggy_common::{
IGGY_MESSAGE_CHECKSUM_OFFSET_RANGE, IGGY_MESSAGE_HEADER_SIZE,
IGGY_MESSAGE_HEADERS_LENGTH_OFFSET_RANGE, IGGY_MESSAGE_ID_OFFSET_RANGE,
diff --git a/core/sdk/src/quic/quic_client.rs b/core/sdk/src/quic/quic_client.rs
index 0a2972f31..6cde88509 100644
--- a/core/sdk/src/quic/quic_client.rs
+++ b/core/sdk/src/quic/quic_client.rs
@@ -18,9 +18,7 @@
use crate::leader_aware::{LeaderRedirectionState, check_and_redirect_to_leader};
use crate::prelude::AutoLogin;
-use iggy_binary_protocol::{
- BinaryClient, BinaryTransport, Client, PersonalAccessTokenClient, UserClient,
-};
+use iggy_common::{BinaryClient, BinaryTransport, Client, PersonalAccessTokenClient, UserClient};
use crate::prelude::{IggyDuration, IggyError, IggyTimestamp, QuicClientConfig};
use crate::quic::skip_server_verification::SkipServerVerification;
diff --git a/core/sdk/src/stream_builder/build/build_iggy_client.rs b/core/sdk/src/stream_builder/build/build_iggy_client.rs
index bf06b9722..3c1293fd5 100644
--- a/core/sdk/src/stream_builder/build/build_iggy_client.rs
+++ b/core/sdk/src/stream_builder/build/build_iggy_client.rs
@@ -16,7 +16,7 @@
* under the License.
*/
use crate::prelude::{IggyClient, IggyError};
-use iggy_binary_protocol::Client;
+use iggy_common::Client;
/// Builds an `IggyClient` from the given connection string.
///
diff --git a/core/sdk/src/tcp/tcp_client.rs b/core/sdk/src/tcp/tcp_client.rs
index 01aa47449..bd61df2ca 100644
--- a/core/sdk/src/tcp/tcp_client.rs
+++ b/core/sdk/src/tcp/tcp_client.rs
@@ -25,12 +25,12 @@ use crate::tcp::tcp_tls_connection_stream::TcpTlsConnectionStream;
use async_broadcast::{Receiver, Sender, broadcast};
use async_trait::async_trait;
use bytes::{BufMut, Bytes, BytesMut};
-use iggy_binary_protocol::{BinaryClient, BinaryTransport, PersonalAccessTokenClient, UserClient};
use iggy_common::{
AutoLogin, ClientState, Command, ConnectionString, ConnectionStringUtils, Credentials,
DiagnosticEvent, IggyDuration, IggyError, IggyErrorDiscriminants, IggyTimestamp,
TcpConnectionStringOptions, TransportProtocol,
};
+use iggy_common::{BinaryClient, BinaryTransport, PersonalAccessTokenClient, UserClient};
use rustls::pki_types::{CertificateDer, ServerName, pem::PemObject};
use std::net::SocketAddr;
use std::str::FromStr;
diff --git a/core/sdk/src/websocket/websocket_client.rs b/core/sdk/src/websocket/websocket_client.rs
index 7da76d559..0cbeb6b28 100644
--- a/core/sdk/src/websocket/websocket_client.rs
+++ b/core/sdk/src/websocket/websocket_client.rs
@@ -26,12 +26,12 @@ use crate::prelude::Client;
use async_broadcast::{Receiver, Sender, broadcast};
use async_trait::async_trait;
use bytes::{BufMut, Bytes, BytesMut};
-use iggy_binary_protocol::{BinaryClient, BinaryTransport, PersonalAccessTokenClient, UserClient};
use iggy_common::{
AutoLogin, ClientState, Command, ConnectionString, Credentials, DiagnosticEvent, IggyDuration,
IggyError, IggyErrorDiscriminants, IggyTimestamp, WebSocketClientConfig,
WebSocketConnectionStringOptions,
};
+use iggy_common::{BinaryClient, BinaryTransport, PersonalAccessTokenClient, UserClient};
use std::net::SocketAddr;
use std::sync::Arc;
use tokio::net::TcpStream;