INNER CODE UNIT · Go
NewHTTPSClientStore
go-kratos/gateway · client/node.go:130
func NewHTTPSClientStore(clientConfigs map[string]*tls.Config) *HTTPSClientStore {
return &HTTPSClientStore{
clientConfigs: clientConfigs,
clients: make(map[string]*http.Client),
}
}
func (s *HTTPSClientStore) GetClient(name string) *http.Client {
if name == "" {
return _globalClient
}
client, ok := s.clients[name]
if ok {
return client
}
tlsConfig, ok := s.clientConfigs[name]
if !ok {
LOG.Warnf("tls config not found for %s, using default instead", name)