mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-13 21:45:58 +08:00
Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode
# Conflicts: # pkg/common/db/mysql_model/im_mysql_model/group_model_k.go
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"Open_IM/pkg/common/config"
|
||||
"github.com/OpenIMSDK/getcdv3"
|
||||
"github.com/OpenIMSDK/open_utils/constant"
|
||||
"google.golang.org/grpc"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetConn(operationID, serviceName string) (*grpc.ClientConn, error) {
|
||||
conn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","),
|
||||
serviceName, operationID, config.Config.Etcd.UserName, config.Config.Etcd.Password)
|
||||
if conn == nil {
|
||||
return nil, constant.ErrGetRpcConn
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
Reference in New Issue
Block a user