summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/config.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 662159e..ba2719d 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -14,6 +14,10 @@ type Config struct {
TrelloAPIKey string
TrelloToken string
+ // Google Calendar
+ GoogleCredentialsFile string
+ GoogleCalendarID string
+
// Paths
DatabasePath string
TemplateDir string
@@ -34,6 +38,10 @@ func Load() (*Config, error) {
TrelloAPIKey: os.Getenv("TRELLO_API_KEY"),
TrelloToken: os.Getenv("TRELLO_TOKEN"),
+ // Google Calendar
+ GoogleCredentialsFile: os.Getenv("GOOGLE_CREDENTIALS_FILE"),
+ GoogleCalendarID: getEnvWithDefault("GOOGLE_CALENDAR_ID", "primary"),
+
// Paths
DatabasePath: getEnvWithDefault("DATABASE_PATH", "./dashboard.db"),
TemplateDir: getEnvWithDefault("TEMPLATE_DIR", "web/templates"),
@@ -81,6 +89,11 @@ func (c *Config) HasTrello() bool {
return c.TrelloAPIKey != "" && c.TrelloToken != ""
}
+// HasGoogleCalendar checks if Google Calendar is configured
+func (c *Config) HasGoogleCalendar() bool {
+ return c.GoogleCredentialsFile != ""
+}
+
// getEnvWithDefault returns environment variable value or default if not set
func getEnvWithDefault(key, defaultValue string) string {
if value := os.Getenv(key); value != "" {