为收集配置添加一个检查配置清单的方法
This commit is contained in:
11
src/lib.rs
11
src/lib.rs
@@ -114,3 +114,14 @@ pub struct LayerConfig {
|
||||
pub node_name: String,
|
||||
pub index_name: String,
|
||||
}
|
||||
|
||||
impl LayerConfig {
|
||||
/// 检查配置文件是否有值
|
||||
pub fn is_exist(&self) -> bool {
|
||||
!self.zinc_search_host.is_empty()
|
||||
|| !self.username.is_empty()
|
||||
|| !self.password.is_empty()
|
||||
|| !self.node_name.is_empty()
|
||||
|| !self.index_name.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user