From 0467a8532bff0c16549df08f4420e89a6888eba7 Mon Sep 17 00:00:00 2001 From: Easwar Swaminathan Date: Mon, 14 Oct 2019 23:15:54 +0000 Subject: [PATCH] Add new 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 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/resolver/resolver.go b/resolver/resolver.go index 147e2314c334..ab3c1a7d2d58 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,22 @@ 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 + // CredsBundle is the credentials bundle that a resolver implementation can + // use while dialing a remote name resolution server. If both DialCreds and + // CredsBundle are set, the former takes precedence. + CredsBundle credentials.Bundle + // 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.