Skip to content

feat(drive): Phase 3D — Drive client + folder cache (with oauth refactor) - #9

Merged
smallchungus merged 4 commits into
mainfrom
phase-3d-drive-client
Apr 18, 2026
Merged

feat(drive): Phase 3D — Drive client + folder cache (with oauth refactor)#9
smallchungus merged 4 commits into
mainfrom
phase-3d-drive-client

Conversation

@smallchungus

Copy link
Copy Markdown
Owner

Phase 3D: Drive-side I/O + small refactor.

  • Refactor: token helpers (LoadToken, SaveToken, NewSavingSource, EncryptToken/DecryptToken) move from internal/gmail to internal/oauth so both Gmail and Drive consume them.
  • internal/drive/client.go — Client.New, EnsureFolder (looks up by name+parent, creates if missing), Upload (simple media upload).
  • internal/drive/cache.go — FolderCache wrapping Redis (drive_folder_cache:: -> folderID), with Set/Get + TTL.
  • 3 integration tests for Drive client (httptest mocks Drive API) + 2 for FolderCache (real Redis via testutil).

Phase 3E (handlers) wires this together.

LoadToken, SaveToken, EncryptToken, DecryptToken, and NewSavingSource now
live in internal/oauth. gmail.Client updated to call oauth.* directly.
gmail.SaveToken no longer exported.
@smallchungus
smallchungus merged commit 5cf94ba into main Apr 18, 2026
3 checks passed
@smallchungus
smallchungus deleted the phase-3d-drive-client branch April 18, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant