You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/getcdv3/temp.go

36 lines
1.1 KiB

2 years ago
package getcdv3
2 years ago
import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/trace_log"
"context"
"github.com/OpenIMSDK/getcdv3"
"google.golang.org/grpc"
"strings"
)
2 years ago
func GetDefaultConn(arg1, arg2, arg3, arg4 string) *grpc.ClientConn {
2 years ago
return getcdv3.GetConn(arg1, arg2, arg3, arg4, config.Config.Etcd.UserName, config.Config.Etcd.Password)
2 years ago
}
2 years ago
func GetConn(ctx context.Context, serviceName string) (conn *grpc.ClientConn, err error) {
defer func() {
2 years ago
trace_log.SetCtxInfo(ctx, "GetConn", err, "serviceName", serviceName)
2 years ago
}()
conn = getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","),
serviceName, trace_log.GetOperationID(ctx), config.Config.Etcd.UserName, config.Config.Etcd.Password)
if conn == nil {
return nil, &constant.ErrInternalServer
2 years ago
}
return conn, nil
}
func GetDefaultGatewayConn4Unique(schema, addr, operationID string) []*grpc.ClientConn {
return nil
}
func RegisterEtcd(schema, etcdAddr, myHost string, myPort int, serviceName string, ttl int, operationID string) error {
return getcdv3.RegisterEtcd(schema, etcdAddr, myHost, myPort, serviceName, ttl, operationID)
}