Repository navigation
feat: new API to use ResolvedService instead of ServiceInfo for resolved service event - #362
Conversation
|
I guess we also should consider updating the query example to use the new proposed API. |
I've updated the query example. |
|
Can we make the struct |
modify query example to use the new ServiceDetailed
eab38af to
2ebc146
Compare
Exported |
Thanks, I was maybe a bit imprecise on which direction the trait goes. I wanted to implement a |
| HostIp::V4(v4) => write!(f, "{}", v4.addr), | ||
| HostIp::V6(v6) => { | ||
| if v6.scope_id.index != 0 { | ||
| write!(f, "{}%{}", v6.addr, v6.scope_id.name) |
There was a problem hiding this comment.
I'm not sure whether address%index would be more feasible, as for example Windows does not use interface names but rather an interface index as a scope id.
There was a problem hiding this comment.
I've updated it to use index. For myself reference: RFC 4007 section 11.3
|
@oysteintveit-nordicsemi may I ask you help review the changes to This is a breaking change for |
|
Hello, this is @oysteintveit-nordicsemi from my non-work account, thank you for reaching out! I no longer work there so I don't have access to the code, but I can have a look at it and see if I can tell from memory. I currently don't have access to a computer either (not until next week), but I had a quick skim through the diff and if the only thing that changed is the wrapping struct and the address inside is still accessible to the library user in some way, I think it'll be fine 😁 |
@h7x4 thank you! I appreciated that. |
h7x4
left a comment
There was a problem hiding this comment.
I had a closer look today, the changes look good to me. Thank you for providing the to and from functions for HostIp and IpAddr, that should make it easy to migrate :)
Pinging @michaeljones for a heads up
This is to address issue #358. The basic approach is:
ServiceEvent::ServiceResolvedevent, which returnsServiceInfo.ServiceEvent::ServiceDetailedto returnResolvedService. UpdateResolvedService.addressesto beHashSet<HostIp>, whereHostIpis a wrapper ofIpAddrthat includesscope_idfor IPv6 addresses.To opt in to receive
ServiceEvent::ServiceDetailedinstead ofServiceEvent::ServiceResolved, the user would callServiceDaemon::use_service_detailed(true)of its client daemon.So, in short, to use IPv6 address with scope (interface id), one needs to use the new
ServiceDetailedevent andResolvedServicestruct instead ofServiceInfo. In the long term, I hope to deprecate the uses ofServiceInfoon the client (querier) side.Also note,
HostnameResolutionEventis also updated to useHostIpinstead ofIpAddr. I think it's better to make this breaking change at the same time.