diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-22 15:28:06 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-22 15:31:50 -1000 |
| commit | e97a1bc259d3aa91956ec73a522421cdb621ae57 (patch) | |
| tree | a9f424ef97673c0dd7da8cee6044413e6417b626 /internal/config | |
| parent | db5deb2330448c75ba6b719e6a397832362b222a (diff) | |
Add Google Calendar integration
- Add GoogleCalendarClient for fetching upcoming events
- Add GoogleCalendarAPI interface and CalendarEvent model
- Add config for GOOGLE_CREDENTIALS_FILE and GOOGLE_CALENDAR_ID
- Display events in Planning tab with date/time formatting
- Update handlers and tests to support optional calendar client
Config env vars:
- GOOGLE_CREDENTIALS_FILE: Path to service account JSON
- GOOGLE_CALENDAR_ID: Calendar ID (defaults to "primary")
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'internal/config')
| -rw-r--r-- | internal/config/config.go | 13 |
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 != "" { |
