use anyhow::Result;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::identity::AgentIdentity;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DiscoveryProtocol {
Manual,
Registry,
Mdns,
Gossip,
Custom(String),
}
#[async_trait]
pub trait Discovery: Send + Sync {
async fn register(&self, identity: &AgentIdentity) -> Result<()>;
async fn deregister(&self, id: &Uuid) -> Result<()>;
async fn discover(&self) -> Result<Vec<AgentIdentity>>;
async fn lookup(&self, id: &Uuid) -> Result<Option<AgentIdentity>>;
fn protocol(&self) -> DiscoveryProtocol;
}