func (cm *ClientManager) AddIfNotExists(target string, opts ...grpc.DialOption) error {
	cm.connectionsMu.Lock()
	defer cm.connectionsMu.Unlock()
	if _, exists := cm.connections[target]; exists {
		return nil
	}
	cc, err := grpc.Dial(target, opts...)
	if err != nil {
		return errors.Wrap(err, "grpc.Dial failed")
	}
	cm.connections[target] = &conn{
		gc: cc,
	}
	return nil
}
AddIfNotExists adds a client if it doesn't exist already
package clientmanager
import (
	"sync"
	"github.com/bio-routing/bio-rd/util/grpc/clientmanager/metrics"
	"github.com/pkg/errors"
	"google.golang.org/grpc"
)
type ClientManager struct {
	connections   map[string]*conn
	connectionsMu sync.RWMutex
}
type conn struct {
	gc       *grpc.ClientConn
	refCount uint
}
func New() *ClientManager {
	return &ClientManager{
		connections: make(map[string]*conn),
	}
}
func (cm *ClientManager) Get(target string) *grpc.ClientConn {
	cm.connectionsMu.Lock()
	defer cm.connectionsMu.Unlock()
	if _, exists := cm.connections[target]; !exists {
		return nil
	}
	cm.connections[target].refCount++
	return cm.connections[target].gc
}