use async_trait::async_trait;

pub struct AllPeers {
    pub nodes: Vec<String>,
    pub leader: Option<String>,
}

// Trait for service registration and discovery
#[async_trait]
pub trait DiscoveryClient: Send + Sync {
    async fn register(
        &mut self,
        service_addr: &str,
        service_info: &str,
    ) -> Result<(), anyhow::Error>;
    async fn deregister(&mut self, service_addr: &str) -> Result<(), anyhow::Error>;
    async fn get_all_peers(&self) -> Result<AllPeers, anyhow::Error>;
    async fn stop_watch(&mut self) -> Result<(), anyhow::Error>;
}
