dnsResolver watches for the name resolution update for a non-IP target.
| 168 | |
| 169 | // dnsResolver watches for the name resolution update for a non-IP target. |
| 170 | type dnsResolver struct { |
| 171 | host string |
| 172 | port string |
| 173 | resolver internal.NetResolver |
| 174 | ctx context.Context |
| 175 | cancel context.CancelFunc |
| 176 | cc resolver.ClientConn |
| 177 | // rn channel is used by ResolveNow() to force an immediate resolution of the |
| 178 | // target. |
| 179 | rn chan struct{} |
| 180 | // wg is used to enforce Close() to return after the watcher() goroutine has |
| 181 | // finished. Otherwise, data race will be possible. [Race Example] in |
| 182 | // dns_resolver_test we replace the real lookup functions with mocked ones to |
| 183 | // facilitate testing. If Close() doesn't wait for watcher() goroutine |
| 184 | // finishes, race detector sometimes will warn lookup (READ the lookup |
| 185 | // function pointers) inside watcher() goroutine has data race with |
| 186 | // replaceNetFunc (WRITE the lookup function pointers). |
| 187 | wg sync.WaitGroup |
| 188 | enableServiceConfig bool |
| 189 | } |
| 190 | |
| 191 | // ResolveNow invoke an immediate resolution of the target that this |
| 192 | // dnsResolver watches. |
nothing calls this directly
no outgoing calls
no test coverage detected