|
|
|
@ -144,6 +144,8 @@ void XdsResolver::StartLocked() { |
|
|
|
|
|
|
|
|
|
class XdsResolverFactory : public ResolverFactory { |
|
|
|
|
public: |
|
|
|
|
explicit XdsResolverFactory(const char* scheme) : scheme_(scheme) {} |
|
|
|
|
|
|
|
|
|
bool IsValidUri(const grpc_uri* uri) const override { |
|
|
|
|
if (GPR_UNLIKELY(0 != strcmp(uri->authority, ""))) { |
|
|
|
|
gpr_log(GPR_ERROR, "URI authority not supported"); |
|
|
|
@ -157,16 +159,26 @@ class XdsResolverFactory : public ResolverFactory { |
|
|
|
|
return MakeOrphanable<XdsResolver>(std::move(args)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const char* scheme() const override { return "xds-experimental"; } |
|
|
|
|
const char* scheme() const override { return scheme_; } |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
const char* scheme_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
constexpr char kXdsScheme[] = "xds"; |
|
|
|
|
constexpr char kXdsExperimentalScheme[] = "xds-experimental"; |
|
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
} // namespace grpc_core
|
|
|
|
|
|
|
|
|
|
void grpc_resolver_xds_init() { |
|
|
|
|
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory( |
|
|
|
|
absl::make_unique<grpc_core::XdsResolverFactory>()); |
|
|
|
|
absl::make_unique<grpc_core::XdsResolverFactory>(grpc_core::kXdsScheme)); |
|
|
|
|
// TODO(roth): Remov this in the 1.31 release.
|
|
|
|
|
grpc_core::ResolverRegistry::Builder::RegisterResolverFactory( |
|
|
|
|
absl::make_unique<grpc_core::XdsResolverFactory>( |
|
|
|
|
grpc_core::kXdsExperimentalScheme)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void grpc_resolver_xds_shutdown() {} |
|
|
|
|