daemon: refactor and modularize daemon and pkg/daemon #4868
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.
This PR refactors the daemon codebase to prepare for standalone operation support. It separates concerns and moves reusable components to
pkg/daemon.This is part 1 of a series splitting #4853 into smaller, reviewable PRs. The original PR will be closed.
Main Changes
Split daemon server: Separated the existing daemon gRPC server into transport (
daemon/grpc/server.go) and core logic (DaemonEngineinpkg/daemon/private/engine) components. The engine contains the business logic, independent of transport.Move fetcher to pkg: Relocated
daemon/fetchertopkg/daemon/fetcherto make it accessible for in-process usage.Move drkey to private: Relocated
daemon/drkeytoprivate/drkeyas it is shared infrastructure.Add ASInfo abstraction: Introduced
pkg/daemon/asinfoto provide local AS information from topology files.Add trust utilities: Created
pkg/daemon/private/trustwith helpers for trust verification setup.Add AcceptAll verifier: Added
private/segment/verifier/acceptall.gofor scenarios where segment verification should be skipped.Rename daemon.go to connector.go: Clarified the purpose of the
Connectorinterface inpkg/daemon.