GRPC C++
1.71.0
|
Provides asynchronous resolution. More...
#include <event_engine.h>
Data Structures | |
struct | ResolverOptions |
Optional configuration for DNSResolvers. More... | |
struct | SRVRecord |
DNS SRV record type. More... | |
Public Types | |
using | LookupHostnameCallback = absl::AnyInvocable< void(absl::StatusOr< std::vector< ResolvedAddress > >)> |
Called with the collection of sockaddrs that were resolved from a given target address. More... | |
using | LookupSRVCallback = absl::AnyInvocable< void(absl::StatusOr< std::vector< SRVRecord > >)> |
Called with a collection of SRV records. More... | |
using | LookupTXTCallback = absl::AnyInvocable< void(absl::StatusOr< std::vector< std::string > >)> |
Called with the result of a TXT record lookup. More... | |
Public Member Functions | |
virtual | ~DNSResolver ()=default |
virtual void | LookupHostname (LookupHostnameCallback on_resolve, absl::string_view name, absl::string_view default_port)=0 |
Asynchronously resolve an address. More... | |
virtual void | LookupSRV (LookupSRVCallback on_resolve, absl::string_view name)=0 |
Asynchronously perform an SRV record lookup. More... | |
virtual void | LookupTXT (LookupTXTCallback on_resolve, absl::string_view name)=0 |
Asynchronously perform a TXT record lookup. More... | |
Provides asynchronous resolution.
This object has a destruction-is-cancellation semantic. Implementations should make sure that all pending requests are cancelled when the object is destroyed and all pending callbacks will be called shortly. If cancellation races with request completion, implementations may choose to either cancel or satisfy the request.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupHostnameCallback = absl::AnyInvocable<void(absl::StatusOr<std::vector<ResolvedAddress> >)> |
Called with the collection of sockaddrs that were resolved from a given target address.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupSRVCallback = absl::AnyInvocable<void(absl::StatusOr<std::vector<SRVRecord> >)> |
Called with a collection of SRV records.
using grpc_event_engine::experimental::EventEngine::DNSResolver::LookupTXTCallback = absl::AnyInvocable<void(absl::StatusOr<std::vector<std::string> >)> |
Called with the result of a TXT record lookup.
|
virtualdefault |
|
pure virtual |
Asynchronously resolve an address.
default_port may be a non-numeric named service port, and will only be used if address does not already contain a port component.
When the lookup is complete or cancelled, the on_resolve callback will be invoked with a status indicating the success or failure of the lookup. Implementations should pass the appropriate statuses to the callback. For example, callbacks might expect to receive CANCELLED or NOT_FOUND.
|
pure virtual |
Asynchronously perform an SRV record lookup.
on_resolve has the same meaning and expectations as LookupHostname's on_resolve callback.
|
pure virtual |
Asynchronously perform a TXT record lookup.
on_resolve has the same meaning and expectations as LookupHostname's on_resolve callback.