This commit is contained in:
mkelcik
2023-12-09 16:12:58 +01:00
parent 51958d719e
commit ecd2776a50
5 changed files with 113 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ const (
envKeyOnChangeComment = "ON_CHANGE_COMMENT"
envKeyCheckIntervalSeconds = "CHECK_INTERVAL_SECONDS"
envKeyNotifiers = "NOTIFIERS"
envKeyIgnoredIpChange = "IGNORED_IP_CHANGE"
)
type Config struct {
@@ -28,6 +29,7 @@ type Config struct {
OnChangeComment string
Notifiers []string
CheckInterval time.Duration
IgnoredIpChange []string
}
func (c Config) Validate() error {
@@ -61,5 +63,6 @@ func NewConfig() Config {
OnChangeComment: os.Getenv(envKeyOnChangeComment),
Notifiers: parseCommaDelimited(os.Getenv(envKeyNotifiers)),
CheckInterval: time.Duration(checkInterval) * time.Second,
IgnoredIpChange: parseCommaDelimited(os.Getenv(envKeyIgnoredIpChange)),
}
}