DataSource is the common interface implemented by all acquisition modules. A DataSource can always be configured from YAML.
| 17 | // |
| 18 | // A DataSource can always be configured from YAML. |
| 19 | type DataSource interface { |
| 20 | // identity, lifecycle |
| 21 | |
| 22 | // GetMode returns the operating mode of the datasource (e.g. TAIL, CAT, SERVER). |
| 23 | GetMode() string |
| 24 | |
| 25 | // GetName returns the module name (e.g. "file", "journalctl", "docker"). |
| 26 | GetName() string |
| 27 | |
| 28 | // GetUuid returns a unique identifier for this datasource instance. |
| 29 | GetUuid() string |
| 30 | |
| 31 | Dump() any |
| 32 | |
| 33 | // CanRun reports whether the datasource can run on the current platform/environment |
| 34 | // (e.g. journalctl not available on some systems like BSD). |
| 35 | CanRun() error |
| 36 | |
| 37 | // configuration |
| 38 | |
| 39 | // UnmarshalConfig decodes and pre-validates the YAML datasource configuration. |
| 40 | // Implementations should validate everything that can be checked without I/O. |
| 41 | UnmarshalConfig(yamlConfig []byte) error |
| 42 | |
| 43 | // Configure completes datasource configuration and performs runtime checks. |
| 44 | Configure(ctx context.Context, yamlConfig []byte, logger *log.Entry, metricsLevel metrics.AcquisitionMetricsLevel) error |
| 45 | } |
| 46 | |
| 47 | // DataSourceFactory constructs a new unconfigured DataSource instance. |
| 48 | type DataSourceFactory func() DataSource |
no outgoing calls
no test coverage detected
searching dependent graphs…