Files
karma/internal/config/models.go
Łukasz Mierzwa 6273a5a585 Rewrite flag & env handling to use viper
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.
2017-11-27 20:34:36 -08:00

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
}
}