Get returns the resolver builder registered with the given name. Note that the compare is done in a case-sensitive fashion. If no builder is register with the name, nil will be returned.
(name string)
| 82 | // Note that the compare is done in a case-sensitive fashion. |
| 83 | // If no builder is register with the name, nil will be returned. |
| 84 | func Get(name string) Builder { |
| 85 | if !envconfig.CaseSensitiveBalancerRegistries { |
| 86 | lowerName := strings.ToLower(name) |
| 87 | if lowerName != name { |
| 88 | logger.Warningf("Balancer retrieved for 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", name) |
| 89 | } |
| 90 | name = lowerName |
| 91 | } |
| 92 | if b, ok := m[name]; ok { |
| 93 | return b |
| 94 | } |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | // NewSubConnOptions contains options to create new SubConn. |
| 99 | type NewSubConnOptions struct { |