431 has refactored service discover and treat DNS resolver as a service discover for HTTP client, but the previous implementation does not have strong scalability, for example, the Target is designed for DNS resolver only.
Solution
This PR refactored the Target and added TypeMap and FastStrMap for it. In addition, a new param target_parser is also added.
For resolving an address, the conversion path is:
Parse str to Uri and build a Target from the Uri
Call the target_parser so that it can resolve the Target and set necessary information to Endpoint
The service discover will resolve Endpoint to Address
Motivation
431 has refactored service discover and treat DNS resolver as a service discover for HTTP client, but the previous implementation does not have strong scalability, for example, the
Target
is designed for DNS resolver only.Solution
This PR refactored the
Target
and addedTypeMap
andFastStrMap
for it. In addition, a new paramtarget_parser
is also added.For resolving an address, the conversion path is:
str
toUri
and build aTarget
from theUri
target_parser
so that it can resolve theTarget
and set necessary information toEndpoint
Endpoint
toAddress
Fixes: #431