mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-09 19:45:58 +08:00
feat: merge v3dev into main
This commit is contained in:
@@ -17,7 +17,6 @@ package rpcclient
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
@@ -33,17 +32,16 @@ import (
|
||||
type User struct {
|
||||
conn grpc.ClientConnInterface
|
||||
Client user.UserClient
|
||||
discov discoveryregistry.SvcDiscoveryRegistry
|
||||
Discov discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
||||
ctx, _ := context.WithTimeout(context.Background(), time.Second*3)
|
||||
conn, err := discov.GetConn(ctx, config.Config.RpcRegisterName.OpenImUserName)
|
||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
client := user.NewUserClient(conn)
|
||||
return &User{discov: discov, Client: client, conn: conn}
|
||||
return &User{Discov: discov, Client: client, conn: conn}
|
||||
}
|
||||
|
||||
type UserRpcClient User
|
||||
|
||||
Reference in New Issue
Block a user