pub struct IronpostConfig {
pub general: GeneralConfig,
pub metrics: MetricsConfig,
pub ebpf: EbpfConfig,
pub log_pipeline: LogPipelineConfig,
pub container: ContainerConfig,
pub sbom: SbomConfig,
}Expand description
Ironpost 통합 설정
ironpost.toml 파일의 최상위 구조를 나타냅니다.
각 모듈은 자기 섹션만 읽어 사용합니다.
Fields§
§general: GeneralConfig일반 설정
metrics: MetricsConfig메트릭 수집 및 Prometheus 노출 설정
ebpf: EbpfConfigeBPF 엔진 설정
log_pipeline: LogPipelineConfig로그 파이프라인 설정
container: ContainerConfig컨테이너 가드 설정
sbom: SbomConfigSBOM 스캐너 설정
Implementations§
Source§impl IronpostConfig
impl IronpostConfig
Sourcepub async fn load(path: impl AsRef<Path>) -> Result<Self, IronpostError>
pub async fn load(path: impl AsRef<Path>) -> Result<Self, IronpostError>
TOML 파일에서 설정을 로드하고 환경변수 오버라이드를 적용합니다.
설정 로딩 순서:
- TOML 파일 파싱
- 환경변수 오버라이드 적용
§Examples
use ironpost_core::config::IronpostConfig;
// 기본 설정 파일 로드
let config = IronpostConfig::load("ironpost.toml").await?;
// 환경변수로 오버라이드 가능
// IRONPOST_EBPF_INTERFACE=eth0 ./ironpost§Errors
다음의 경우 에러를 반환합니다:
- 파일이 존재하지 않을 때 (
ConfigError::FileNotFound) - TOML 파싱 실패 시 (
ConfigError::ParseFailed) - 설정 검증 실패 시 (
ConfigError::InvalidValue)
Sourcepub fn parse(toml_str: &str) -> Result<Self, IronpostError>
pub fn parse(toml_str: &str) -> Result<Self, IronpostError>
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
환경변수로 설정값을 오버라이드합니다.
환경변수 네이밍 규칙: IRONPOST_{SECTION}_{FIELD}
예: IRONPOST_EBPF_INTERFACE=eth0
Sourcepub fn validate(&self) -> Result<(), IronpostError>
pub fn validate(&self) -> Result<(), IronpostError>
Trait Implementations§
Source§impl Clone for IronpostConfig
impl Clone for IronpostConfig
Source§fn clone(&self) -> IronpostConfig
fn clone(&self) -> IronpostConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IronpostConfig
impl Debug for IronpostConfig
Source§impl Default for IronpostConfig
impl Default for IronpostConfig
Source§fn default() -> IronpostConfig
fn default() -> IronpostConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for IronpostConfig
impl<'de> Deserialize<'de> for IronpostConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IronpostConfig
impl RefUnwindSafe for IronpostConfig
impl Send for IronpostConfig
impl Sync for IronpostConfig
impl Unpin for IronpostConfig
impl UnwindSafe for IronpostConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more