This commit is contained in:
wangchuxiao
2023-06-02 20:52:16 +08:00
parent 0ab9294fab
commit 97aa17af6c
7 changed files with 63 additions and 36 deletions
+4 -6
View File
@@ -5,20 +5,18 @@ import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/a2r"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/auth"
"github.com/gin-gonic/gin"
"google.golang.org/grpc"
)
func NewAuth(c discoveryregistry.SvcDiscoveryRegistry) *Auth {
conn, err := c.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
if err != nil {
panic(err)
// panic(err)
}
log.ZInfo(context.Background(), "auth rpc conn", "conn", conn)
return &Auth{conn: conn, discov: c}
return &Auth{conn: conn, discov: discov}
}
type Auth struct {