From 657e8f9e669e75da2881da82a72b85e13880a4d6 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Mon, 14 Oct 2019 23:15:54 +0000 Subject: [PATCH] Add a couple of fields to resolver.BuildOption struct. These fields will be used by resolver implementations which need to talk to a remote name resolver. --- resolver/resolver.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resolver/resolver.go b/resolver/resolver.go index 147e2314c334..0ab74ed4d143 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -21,6 +21,10 @@ package resolver import ( + "context" + "net" + + "google.golang.org/grpc/credentials" "google.golang.org/grpc/serviceconfig" ) @@ -105,8 +109,18 @@ type Address struct { // BuildOption includes additional information for the builder to create // the resolver. type BuildOption struct { - // DisableServiceConfig indicates whether resolver should fetch service config data. + // DisableServiceConfig indicates whether a resolver implementation should + // fetch service config data. DisableServiceConfig bool + // DialCreds is the transport credentials that a resolver implementation + // can use to dial a remote name resolution server. Resolver + // implementations which do not need to talk to another party securely can + // safely ignore this field. + DialCreds credentials.TransportCredentials + // Dialer is the custom dialer that a resolver implementation can use to + // dial a remote name resolution server. Resolver implementations which do + // not need to talk to another party securely can safely ignore this field. + Dialer func(context.Context, string) (net.Conn, error) } // State contains the current Resolver state relevant to the ClientConn.