Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genericize BorderClient creation in Synchronizer using an interface #33

Open
ciroque opened this issue Apr 6, 2023 · 1 comment
Open

Comments

@ciroque
Copy link
Collaborator

ciroque commented Apr 6, 2023

Is your feature request related to a problem? Please describe

No Problem.

In order to allow extension and implement support for various Border Servers the Synchronizer module should not import the NGINX Plus client ("github.com/nginxinc/nginx-plus-go-client/client") directly. It does this presently in 'Synchronizer::buildBorderClient' method on line 93.

This direct creation of a concrete implementation should use an interface and factory to create an instance of a configurable implementation.

Describe the solution you'd like

Define an interface that is generic against the NGINX Plus client that can be extended for other clients down the road (sure, this is a modicum of 'future-proofing', but will hopefully incentivize more developers to join in the fun and contribute.

Describe alternatives you've considered

The current implementation is the alternative. Use clients directly with no separation that would allow for easier testing and extension.

Additional context

Add any other context or screenshots about the feature request here.

@ciroque
Copy link
Collaborator Author

ciroque commented Apr 6, 2023

Alternative: simply pass the HttpClient into a factory method on the HttpBorderClient / TcpBorderClient and let those modules create the NGINX Plus client.

This is cleaner, does it adversely affect testing?

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

No branches or pull requests

1 participant