-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add caching infrastructure for Drive metadata #84
Copy link
Copy link
Closed
Description
Summary
Add a caching layer to support fast repeated lookups for Drive API metadata. This is Phase 1 of shared drive support (Phase 2: #85).
Motivation
When using --drive <name> flags (Phase 2), the CLI needs to resolve drive names to IDs. Without caching, every command would require an API call to list shared drives. Caching enables fast repeated lookups.
Implementation
Cache Package (internal/cache/)
- TTL-based cache with configurable expiration
GetDrives()/SetDrives()for shared drive listsClear()to remove all cached dataGetStatus()for status reporting- Cache stored in
~/.config/google-readonly/cache/
Config Updates (internal/config/)
Configstruct for user settingsLoadConfig()/SaveConfig()for persistence- Default 24-hour cache TTL
New Commands
gro config cache show # Display cache status
gro config cache clear # Clear all cached data
gro config cache ttl <N> # Set cache TTL to N hoursInit Integration
- Add cache TTL prompt during
gro initsetup
Files to Create/Modify
internal/cache/cache.go- NEWinternal/cache/cache_test.go- NEWinternal/cmd/config/cache.go- NEWinternal/config/config.go- Add Config structinternal/cmd/config/config.go- Register cache subcommandinternal/cmd/initcmd/init.go- Add cache TTL promptREADME.md- Document cache configuration
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels