aboutsummaryrefslogtreecommitdiff
path: root/src/membership.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-18 19:30:05 +0200
committerAlex Auvolat <alex@adnab.me>2020-04-18 19:30:05 +0200
commitbd1618e78e4c4305a73bdd40004de2abe46c3ceb (patch)
tree8d84b73808a3a968941a59672aae398a61f8d5ff /src/membership.rs
parentf41583e1b731574b4bb13a20d4b3fd9fe3a899f5 (diff)
downloadgarage-bd1618e78e4c4305a73bdd40004de2abe46c3ceb.tar.gz
garage-bd1618e78e4c4305a73bdd40004de2abe46c3ceb.zip
Remove proto.rs & move some definitions out of data.rs
Diffstat (limited to 'src/membership.rs')
-rw-r--r--src/membership.rs28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/membership.rs b/src/membership.rs
index 499637fb..e2f4bb90 100644
--- a/src/membership.rs
+++ b/src/membership.rs
@@ -19,7 +19,6 @@ use tokio::sync::Mutex;
use crate::background::BackgroundRunner;
use crate::data::*;
use crate::error::Error;
-use crate::proto::*;
use crate::rpc_client::*;
use crate::rpc_server::*;
use crate::server::Config;
@@ -40,6 +39,33 @@ pub enum Message {
impl RpcMessage for Message {}
+#[derive(Debug, Serialize, Deserialize)]
+pub struct PingMessage {
+ pub id: UUID,
+ pub rpc_port: u16,
+
+ pub status_hash: Hash,
+ pub config_version: u64,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct AdvertisedNode {
+ pub id: UUID,
+ pub addr: SocketAddr,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct NetworkConfig {
+ pub members: HashMap<UUID, NetworkConfigEntry>,
+ pub version: u64,
+}
+
+#[derive(Clone, Debug, Serialize, Deserialize)]
+pub struct NetworkConfigEntry {
+ pub datacenter: String,
+ pub n_tokens: u32,
+}
+
pub struct System {
pub config: Config,
pub id: UUID,