mirror of
https://github.com/prymitive/karma
synced 2026-05-11 03:46:48 +00:00
This adds support for reading configuration from file, env support is still there and legacy env variables will still work, but flags are now following config schema, so they don't match old flags. Having a config file allows to express more complex configuration options, which is needed for some feature requests.
59 lines
793 B
Go
59 lines
793 B
Go
package config
|
|
|
|
import "time"
|
|
|
|
type alertmanagerConfig struct {
|
|
Name string
|
|
URI string
|
|
Timeout time.Duration
|
|
}
|
|
|
|
type jiraRule struct {
|
|
Regex string
|
|
URI string
|
|
}
|
|
|
|
type configSchema struct {
|
|
Alertmanager struct {
|
|
Interval time.Duration
|
|
Servers []alertmanagerConfig
|
|
}
|
|
Annotations struct {
|
|
Default struct {
|
|
Hidden bool
|
|
}
|
|
Hidden []string
|
|
Visible []string
|
|
}
|
|
Colors struct {
|
|
Labels struct {
|
|
Static []string
|
|
Unique []string
|
|
}
|
|
}
|
|
Debug bool
|
|
Filters struct {
|
|
Default []string
|
|
}
|
|
Labels struct {
|
|
Strip []string
|
|
Keep []string
|
|
}
|
|
Listen struct {
|
|
Address string
|
|
Port int
|
|
Prefix string
|
|
}
|
|
Log struct {
|
|
Level string
|
|
}
|
|
JIRA []jiraRule
|
|
Receivers struct {
|
|
Strip []string
|
|
}
|
|
Sentry struct {
|
|
Private string
|
|
Public string
|
|
}
|
|
}
|