MCPcopy
hub / github.com/grpc/grpc-go / Register

Function Register

balancer/balancer.go:58–67  ·  view source on GitHub ↗

Register registers the balancer builder to the balancer map. b.Name will be used as the name registered with this builder. If the Builder implements ConfigParser, ParseConfig will be called when new service configs are received by the resolver, and the result will be provided to the Balancer in Upda

(b Builder)

Source from the content-addressed store, hash-verified

56// an init() function), and is not thread-safe. If multiple Balancers are
57// registered with the same name, the one registered last will take effect.
58func Register(b Builder) {
59 name := b.Name()
60 if !envconfig.CaseSensitiveBalancerRegistries {
61 name = strings.ToLower(name)
62 if name != b.Name() {
63 logger.Warningf("Balancer registered with name %q. grpc-go has switched to case sensitive balancer registries. GRPC_GO_EXPERIMENTAL_CASE_SENSITIVE_BALANCER_REGISTRIES env variable will be removed in release v1.82.0", b.Name())
64 }
65 }
66 m[name] = b
67}
68
69// unregisterForTesting deletes the balancer with the given name from the
70// balancer map.

Callers 15

initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
RegisterRLSChildPolicyFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
TestGRPCLB_FallbackMethod · 0.92

Calls 2

NameMethod · 0.65
WarningfMethod · 0.65