Source File
balancer.go
Belonging Package
google.golang.org/grpc/balancer
package balancer
import (
)
func ( string) {
delete(m, )
}
func () {
internal.BalancerUnregister = unregisterForTesting
}
Connect()
}
RemoveSubConn(SubConn)
UpdateState(State)
ResolveNow(resolver.ResolveNowOptions)
Target() string
}
Name() string
}
ParseConfig(LoadBalancingConfigJSON json.RawMessage) (serviceconfig.LoadBalancingConfig, error)
}
ServerLoad interface{}
}
ErrTransientFailure = errors.New("all SubConns are in TransientFailure")
)
Pick(info PickInfo) (PickResult, error)
}
Close()
}
type ClientConnState struct {
var ErrBadResolverState = errors.New("bad resolver state")
type ConnectivityStateEvaluator struct {
numReady uint64 // Number of addrConns in ready state.
numConnecting uint64 // Number of addrConns in connecting state.
}
for , := range []connectivity.State{, } {
:= 2*uint64() - 1 // -1 for oldState and +1 for new.
switch {
case connectivity.Ready:
.numReady +=
case connectivity.Connecting:
.numConnecting +=
}
}
if .numReady > 0 {
return connectivity.Ready
}
if .numConnecting > 0 {
return connectivity.Connecting
}
return connectivity.TransientFailure
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |