Skip to content

refactor: define interfaces for Google API clients#58

Merged
rianjs merged 1 commit intomainfrom
refactor/35-api-interfaces
Jan 25, 2026
Merged

refactor: define interfaces for Google API clients#58
rianjs merged 1 commit intomainfrom
refactor/35-api-interfaces

Conversation

@rianjs
Copy link
Copy Markdown
Contributor

@rianjs rianjs commented Jan 25, 2026

Summary

Adds interface definitions for Gmail, Calendar, and Contacts clients to enable unit testing through mock implementations.

Interfaces defined:

  • GmailClientInterface: GetMessage, SearchMessages, GetThread, FetchLabels, GetLabelName, GetLabels, GetAttachments, DownloadAttachment, DownloadInlineAttachment
  • CalendarClientInterface: ListCalendars, ListEvents, GetEvent
  • ContactsClientInterface: ListContacts, SearchContacts, GetContact, ListContactGroups

Each interface includes compile-time verification that the concrete Client type implements it via var _ Interface = (*Client)(nil).

Test plan

  • All tests pass (make test)
  • Lint passes (make lint)
  • Compile-time interface verification included

Closes #35

Add interface definitions for Gmail, Calendar, and Contacts clients
to enable unit testing through mock implementations.

- GmailClientInterface: GetMessage, SearchMessages, GetThread, FetchLabels,
  GetLabelName, GetLabels, GetAttachments, DownloadAttachment, DownloadInlineAttachment
- CalendarClientInterface: ListCalendars, ListEvents, GetEvent
- ContactsClientInterface: ListContacts, SearchContacts, GetContact, ListContactGroups

Each interface includes compile-time verification that the concrete Client
type implements it.

Closes #35
@rianjs rianjs merged commit b9de397 into main Jan 25, 2026
2 checks passed
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.

refactor: define interfaces for Google API clients to enable unit testing

1 participant