1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Extractor trait for data extraction from various sources
use crateResult;
/// Extractor trait for extracting data from a source
///
/// Implementors define how to extract items from sources like:
/// - Kibana APIs
/// - File systems
/// - Databases
///
/// # Example
/// ```no_run
/// use kibana_sync::etl::Extractor;
/// use kibana_sync::Result;
/// use std::path::PathBuf;
///
/// struct FileExtractor {
/// path: PathBuf,
/// }
///
/// impl Extractor for FileExtractor {
/// type Item = String;
///
/// async fn extract(&self) -> Result<Vec<Self::Item>> {
/// // Read files and return items
/// Ok(vec![])
/// }
/// }
/// ```