aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/config.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/config/config.go b/config/config.go
index 52ed1db..139687d 100644
--- a/config/config.go
+++ b/config/config.go
@@ -10,7 +10,7 @@ import (
type Config struct {
Name string `mapstructure:"name" yaml:"name"`
- Telegram TelegramConfig `mapstructure:"telegram" yaml:"telegram"`
+ Notifiers NotifiersConfig `mapstructure:"notifiers" yaml:"notifiers"`
Database DatabaseConfig `mapstructure:"database" yaml:"database"`
Jwt JwtConfig `mapstructure:"jwt" yaml:"jwt"`
Server ServerConfig `mapstructure:"server" yaml:"server"`
@@ -20,6 +20,10 @@ type Config struct {
IsDoneTickDotCom bool `mapstructure:"is_done_tick_dot_com" yaml:"is_done_tick_dot_com"`
}
+type NotifiersConfig struct {
+ Telegram TelegramConfig `mapstructure:"telegram" yaml:"telegram"`
+}
+
type TelegramConfig struct {
Token string `mapstructure:"token" yaml:"token"`
}
@@ -80,9 +84,6 @@ type EmailConfig struct {
func NewConfig() *Config {
return &Config{
- Telegram: TelegramConfig{
- Token: "",
- },
Database: DatabaseConfig{
Type: "sqlite",
Migration: true,
@@ -96,7 +97,7 @@ func NewConfig() *Config {
}
func configEnvironmentOverrides(Config *Config) {
if os.Getenv("DONETICK_TELEGRAM_TOKEN") != "" {
- Config.Telegram.Token = os.Getenv("DONETICK_TELEGRAM_TOKEN")
+ Config.Notifiers.Telegram.Token = os.Getenv("DONETICK_TELEGRAM_TOKEN")
}
}
func LoadConfig() *Config {