|
@@ -44,6 +44,8 @@ type balancer interface {
|
|
|
endpoints() []string
|
|
endpoints() []string
|
|
|
// pinned returns the current pinned endpoint.
|
|
// pinned returns the current pinned endpoint.
|
|
|
pinned() string
|
|
pinned() string
|
|
|
|
|
+ // endpointError handles error from server-side.
|
|
|
|
|
+ endpointError(addr string, err error)
|
|
|
|
|
|
|
|
// up is Up but includes whether the balancer will use the connection.
|
|
// up is Up but includes whether the balancer will use the connection.
|
|
|
up(addr grpc.Address) (func(error), bool)
|
|
up(addr grpc.Address) (func(error), bool)
|
|
@@ -150,6 +152,8 @@ func (b *simpleBalancer) pinned() string {
|
|
|
return b.pinAddr
|
|
return b.pinAddr
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (b *simpleBalancer) endpointError(addr string, err error) { return }
|
|
|
|
|
+
|
|
|
func getHost2ep(eps []string) map[string]string {
|
|
func getHost2ep(eps []string) map[string]string {
|
|
|
hm := make(map[string]string, len(eps))
|
|
hm := make(map[string]string, len(eps))
|
|
|
for i := range eps {
|
|
for i := range eps {
|