use std::net::SocketAddr;

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(default)]
pub struct GrpcConfig {
    pub listen: SocketAddr,
    /// Proto files for gRPC reflection. Imports are resolved automatically.
    /// When empty, reflection is disabled.
    #[serde(default)]
    pub proto: Vec<String>,
}

impl Default for GrpcConfig {
    fn default() -> Self {
        Self {
            listen: "0.0.0.0:50051".parse().unwrap(),
            proto: vec![],
        }
    }
}
