containered launch empty web status
This commit is contained in:
@@ -3,6 +3,7 @@ name = "mm-core"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
|
||||
@@ -8,4 +8,4 @@ pub mod model;
|
||||
|
||||
pub use error::{BridgeError, ErrorKind};
|
||||
pub use ids::{ChannelId, PostId, ServerId, TeamId, UserId};
|
||||
pub use model::{BridgeState, ServerSummary};
|
||||
pub use model::{BridgeInfo, BridgeState, BridgeStatus, ServerSummary};
|
||||
|
||||
@@ -12,3 +12,27 @@ pub struct ServerSummary {
|
||||
pub server_id: ServerId,
|
||||
pub state: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct BridgeInfo {
|
||||
pub version: String,
|
||||
pub state: BridgeState,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct BridgeStatus {
|
||||
pub bridge: BridgeInfo,
|
||||
pub servers: Vec<ServerSummary>,
|
||||
}
|
||||
|
||||
impl BridgeStatus {
|
||||
pub fn running(version: impl Into<String>) -> Self {
|
||||
Self {
|
||||
bridge: BridgeInfo {
|
||||
version: version.into(),
|
||||
state: BridgeState::Running,
|
||||
},
|
||||
servers: Vec::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user