Commit Graph

4 Commits

Author SHA1 Message Date
ThinkChaos 74b8931998
refactor(service): make `Info` fields private 2024-04-03 17:49:59 -04:00
ThinkChaos 48cad3b786
refactor: add `service.SimpleHTTP` to reduce required boilerplate 2024-04-03 17:48:51 -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