refactor: add service package and start splitting HTTP handling #1427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Progress for #1206.
No user visible changes in this PR: it's just refactoring and the new config cannot be set from the YAML file.
Instead the new config structs are filled with the info from
ports:
until we're ready to deprecateports
fully.The first part of the commits refactor how we setup the HTTP listeners.
The second part adds a new
service
package with interfaces used to split upserver.Server
.The commits after adding that package refactor the DoH, metrics, and API to be services.
Here's the docs that package as an overview of the design:
This doesn't touch DNS listener/server code (besides moving the TLS config to a single spot), but I think we'll be able to re-use the same code to setup DNS listeners, and split the DNS server logic into a bunch of services + one server.
The follow-up work is to continue removing things from
configureHTTPRouter
until it's empty and we can remove the transitionalhttpMiscService
.At that point we'll be ready to deprecate
ports
and switch to the newservices
config format under discussion in #1206.