-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from openmeterio/aggregation
feat: rename processing to aggregation
- Loading branch information
Showing
8 changed files
with
67 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package config | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
type AggregationConfiguration struct { | ||
ClickHouse ClickHouseAggregationConfiguration | ||
} | ||
|
||
// Validate validates the configuration. | ||
func (c AggregationConfiguration) Validate() error { | ||
if err := c.ClickHouse.Validate(); err != nil { | ||
return fmt.Errorf("clickhouse: %w", err) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
type ClickHouseAggregationConfiguration struct { | ||
Address string | ||
TLS bool | ||
Username string | ||
Password string | ||
Database string | ||
} | ||
|
||
func (c ClickHouseAggregationConfiguration) Validate() error { | ||
if c.Address == "" { | ||
return errors.New("address is required") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// ConfigureAggregation configures some defaults in the Viper instance. | ||
func ConfigureAggregation(v *viper.Viper) { | ||
v.SetDefault("aggregation.clickhouse.address", "127.0.0.1:9000") | ||
v.SetDefault("aggregation.clickhouse.tls", false) | ||
v.SetDefault("aggregation.clickhouse.database", "openmeter") | ||
v.SetDefault("aggregation.clickhouse.username", "default") | ||
v.SetDefault("aggregation.clickhouse.password", "default") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ ingest: | |
kafka: | ||
broker: kafka:29092 | ||
|
||
processor: | ||
aggregation: | ||
clickhouse: | ||
address: clickhouse:9000 | ||
|
||
|