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

refactor: add service package and start splitting HTTP handling #1595

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ThinkChaos
Copy link
Collaborator

@ThinkChaos ThinkChaos commented Sep 5, 2024

Progress for #1206

Can't reopen 1427, so making a new PR.

EDIT: at least this way we get a codecov patch diff percentage back 😄

Allow helpertest to use util since only the tests need helpertests, we
can use util from there without creating a circular dependency.
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`.
@ThinkChaos ThinkChaos changed the title Refactor/services refactor: add service package and start splitting HTTP handling Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 89.79118% with 44 lines in your changes missing coverage. Please review.

Project coverage is 91.83%. Comparing base (fe84ab8) to head (02da233).
Report is 147 commits behind head on main.

Files with missing lines Patch % Lines
server/server.go 77.46% 12 Missing and 4 partials ⚠️
config/config.go 0.00% 11 Missing ⚠️
server/doh.go 90.47% 6 Missing and 2 partials ⚠️
metrics/metrics.go 0.00% 5 Missing ⚠️
cmd/serve.go 0.00% 2 Missing and 1 partial ⚠️
metrics/metrics_event_publisher.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1595      +/-   ##
==========================================
- Coverage   93.88%   91.83%   -2.06%     
==========================================
  Files          78       91      +13     
  Lines        6361     7003     +642     
==========================================
+ Hits         5972     6431     +459     
- Misses        300      487     +187     
+ Partials       89       85       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Oct 20, 2024
Copy link
Contributor

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions bot closed this Oct 31, 2024
@ThinkChaos ThinkChaos reopened this Nov 6, 2024
@github-actions github-actions bot removed the Stale label Nov 7, 2024
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.

1 participant