Commit Graph

6 Commits

Author SHA1 Message Date
ThinkChaos 48cad3b786
refactor: add `service.SimpleHTTP` to reduce required boilerplate 2024-04-03 17:48:51 -04:00
ThinkChaos 1515e17f0f
refactor: switch HTTP API to Service pattern 2024-04-03 13:40:04 -04:00
ThinkChaos d7a2952b1d
refactor: switch DoH to Service pattern 2024-04-03 13:40:04 -04:00
ThinkChaos c11f9a1c98
refactor: add `service` package to prepare for split HTTP handling
Package service exposes types to abstract services from the networking.

The idea is that we build a set of services and a set of network
endpoints (Listener). The services are then assigned to endpoints based
on the address(es) they were configured for.

Actual service to endpoint binding is not handled by the abstractions in
this package as it is protocol specific.
The general pattern is to make a "server" that wraps a service, and can
then be started on an endpoint using a `Serve` method,
similar to `http.Server`.

To support exposing multiple compatible services on a single endpoint
(example: DoH + metrics on a single port),
services can implement `Merger`.
2024-04-03 13:40:04 -04:00
ThinkChaos 36d443728d
refactor(server): move middleware setup to `httpServer` 2024-04-02 22:06:09 -04:00
ThinkChaos 35b1c16878
refactor(server): deduplicate HTTP server setup with new `httpServer` 2024-04-02 20:20:53 -04:00