Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ExtractorConfig `json:"extractor"`
// Lib modules configs.
libconf.MonitoringConfig `json:"monitoring"`
libconf.LoggingConfig `json:"logging"`
libconf.DBConfig `json:"db"`
// Generally needed to expose an /up endpoint.
libconf.APIConfig `json:"api"`
}
type DependencyGraph ¶
type DependencyGraph[K comparable] struct { // Dependencies between the individual steps. Dependencies map[K][]K // List of individual steps. Nodes []K }
Dependency graph.
func (*DependencyGraph[K]) DistinctSubgraphs ¶
func (g *DependencyGraph[K]) DistinctSubgraphs(condition func(K) bool) []DependencyGraph[K]
Get distinct subgraphs from the dependency graph where a condition is met.
Example: consider the following graph:
- A -> B (condition: true) -> C, D (condition: true) -> E
- F (condition: true) -> G, H -> I
The result would be two subgraphs: B -> C, D -> E and F -> G, H -> I. The subgraph after node D is part of B's subgraph, therefore we don't get three results.
func (*DependencyGraph[K]) Resolve ¶
func (g *DependencyGraph[K]) Resolve() ([][]K, error)
Resolve the dependency graph into an execution order. This function returns a list of steps which may contain one or multiple steps that can be run in parallel. It starts with the steps that have no dependencies and then recursively resolves the dependencies of the steps that depend on them.
type ExtractorConfig ¶
type ExtractorConfig struct {
Plugins []FeatureExtractorConfig `json:"plugins"`
}
Configuration for the features module.
type FeatureExtractorConfig ¶
type FeatureExtractorConfig struct {
// The name of the extractor.
Name string `json:"name"`
// Custom options for the extractor, as a raw yaml map.
Options libconf.RawOpts `json:"options,omitempty"`
// The dependencies this extractor needs.
libconf.DependencyConfig `json:"dependencies,omitempty"`
// Recency that tells how old a feature needs to be to be recalculated
RecencySeconds *int `json:"recencySeconds,omitempty"`
// MQTT topic to publish the features to.
// If not set, the extractor will not publish features to MQTT.
MQTTTopic string `json:"mqttTopic,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.