Skip to content

Expose gateway controllers as interfaces#441

Merged
ubettigole merged 1 commit into
mainfrom
abettigole/controller_interfaces
Jul 24, 2026
Merged

Expose gateway controllers as interfaces#441
ubettigole merged 1 commit into
mainfrom
abettigole/controller_interfaces

Conversation

@ubettigole

@ubettigole ubettigole commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Convert the six gateway controllers (ping, cancel, list, land, request_summary, request_history) from concrete structs to exported interfaces backed by unexported implementations, with constructors now returning the interface type. This makes mocking in unit tests easier for callers.

Behavior is unchanged: constructors still return pointer-backed implementations, so no copying occurs; only the declared API surface changed. The GatewayServer fields and affected tests were updated to the interface types accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Test Plan

Unit tested

Issues

Convert the six gateway controllers (ping, cancel, list, land, request_summary, request_history) from concrete structs to exported interfaces backed by unexported implementations, with constructors now returning the interface type.

This lets consumers generate gomock mocks for these controllers via mockgen. gomock can only mock interfaces, so as concrete structs they were unmockable, forcing downstream services (e.g. Uber's internal go-code sq-gateway) to hand-write wrapper interfaces solely to enable mocking. Exposing the interfaces here removes the need for those wrappers.

Behavior is unchanged: constructors still return pointer-backed implementations, so no copying occurs; only the declared API surface changed. The GatewayServer fields and affected tests were updated to the interface types accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ubettigole
ubettigole marked this pull request as ready for review July 24, 2026 19:14
@ubettigole
ubettigole requested review from a team, behinddwalls and sbalabanov as code owners July 24, 2026 19:14
@ubettigole
ubettigole added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 2773fa2 Jul 24, 2026
27 checks passed
@behinddwalls
behinddwalls deleted the abettigole/controller_interfaces branch July 24, 2026 19:34
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.

2 participants