diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-18 19:30:05 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-18 19:30:05 +0200 |
commit | bd1618e78e4c4305a73bdd40004de2abe46c3ceb (patch) | |
tree | 8d84b73808a3a968941a59672aae398a61f8d5ff /src/membership.rs | |
parent | f41583e1b731574b4bb13a20d4b3fd9fe3a899f5 (diff) | |
download | garage-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.rs | 28 |
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, |