diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 20:55:50 -1000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-01-26 20:55:50 -1000 |
| commit | a3156a2f399ea03c645ee23b0099d9d722ce7e1e (patch) | |
| tree | 03c813717e77ae27d8aee9e676f1b75a6a01648c /cmd/dashboard | |
| parent | 70e6e51b6781a3986c51e3496b81c88665286872 (diff) | |
Add Google Tasks integration (#43)
- New GoogleTasksClient for fetching and managing Google Tasks
- Tasks appear in Timeline view with yellow indicator dot
- Tap checkbox to complete/uncomplete tasks via Google API
- Shares credentials file with Google Calendar (GOOGLE_CREDENTIALS_FILE)
- Configure task list via GOOGLE_TASKS_LIST_ID env var (default: @default)
- Supports comma-separated list IDs for multiple lists
New files:
- internal/api/google_tasks.go - Google Tasks API client
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'cmd/dashboard')
| -rw-r--r-- | cmd/dashboard/main.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index a02ece4..920ccf2 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -106,8 +106,21 @@ func main() { } } - // Initia lize handlers - h := handlers.New(db, todoistClient, trelloClient, planToEatClient, googleCalendarClient, cfg) + var googleTasksClient api.GoogleTasksAPI + if cfg.HasGoogleTasks() { + initCtx, cancel := context.WithTimeout(context.Background(), config.GoogleCalendarInitTimeout) + var err error + googleTasksClient, err = api.NewGoogleTasksClient(initCtx, cfg.GoogleCredentialsFile, cfg.GoogleTasksListID, cfg.Timezone) + cancel() + if err != nil { + log.Printf("Warning: failed to initialize Google Tasks client: %v", err) + } else { + log.Printf("Google Tasks client initialized for list: %s", cfg.GoogleTasksListID) + } + } + + // Initialize handlers + h := handlers.New(db, todoistClient, trelloClient, planToEatClient, googleCalendarClient, googleTasksClient, cfg) // Set up router r := chi.NewRouter() |
