From 61c67402b962e4f94e9f671e07f117f1a7148d8b Mon Sep 17 00:00:00 2001 From: Menghan Li Date: Fri, 1 Dec 2017 13:25:57 -0800 Subject: [PATCH] Add comments to ClientConn/SubConn interfaces to indicate new methods may be added (#1680) --- balancer/balancer.go | 10 ++++++++++ resolver/resolver.go | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/balancer/balancer.go b/balancer/balancer.go index b7c685ad4..8bdfe069b 100644 --- a/balancer/balancer.go +++ b/balancer/balancer.go @@ -63,6 +63,11 @@ func Get(name string) Builder { // When the connection encounters an error, it will reconnect immediately. // When the connection becomes IDLE, it will not reconnect unless Connect is // called. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. type SubConn interface { // UpdateAddresses updates the addresses used in this SubConn. // gRPC checks if currently-connected address is still in the new list. @@ -80,6 +85,11 @@ type SubConn interface { type NewSubConnOptions struct{} // ClientConn represents a gRPC ClientConn. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. type ClientConn interface { // NewSubConn is called by balancer to create a new SubConn. // It doesn't block and wait for the connections to be established. diff --git a/resolver/resolver.go b/resolver/resolver.go index 15be62dcb..9efcffb3a 100644 --- a/resolver/resolver.go +++ b/resolver/resolver.go @@ -94,6 +94,11 @@ type BuildOption struct { // ClientConn contains the callbacks for resolver to notify any updates // to the gRPC ClientConn. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. type ClientConn interface { // NewAddress is called by resolver to notify ClientConn a new list // of resolved addresses.