use std::{io::Error as IoError, path::PathBuf};
use fluvio_types::defaults::SC_PUBLIC_PORT;
use fluvio_types::defaults::SC_PRIVATE_PORT;
pub trait ScConfigBuilder {
#[allow(clippy::wrong_self_convention)]
fn to_sc_config(self) -> Result<ScConfig, IoError>;
}
#[derive(Debug, Clone, PartialEq)]
pub struct ScConfig {
pub public_endpoint: String,
pub private_endpoint: String,
pub run_k8_dispatchers: bool,
pub namespace: String,
pub x509_auth_scopes: Option<PathBuf>,
}
impl ::std::default::Default for ScConfig {
fn default() -> Self {
Self {
public_endpoint: format!("0.0.0.0:{}", SC_PUBLIC_PORT),
private_endpoint: format!("0.0.0.0:{}", SC_PRIVATE_PORT),
run_k8_dispatchers: true,
namespace: "default".to_owned(),
x509_auth_scopes: None,
}
}
}