feat: merge v3dev into main

This commit is contained in:
Gordon
2023-07-12 15:12:23 +08:00
123 changed files with 7377 additions and 10288 deletions
+3 -5
View File
@@ -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