mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-17 07:19:02 +08:00
cobra
This commit is contained in:
@@ -3,24 +3,24 @@ package api
|
||||
import (
|
||||
"OpenIM/internal/api/a2r"
|
||||
"OpenIM/pkg/common/config"
|
||||
"OpenIM/pkg/discoveryregistry"
|
||||
auth "OpenIM/pkg/proto/auth"
|
||||
"context"
|
||||
"github.com/OpenIMSDK/openKeeper"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var _ context.Context // 解决goland编辑器bug
|
||||
|
||||
func NewAuth(zk *openKeeper.ZkClient) *Auth {
|
||||
return &Auth{zk: zk}
|
||||
func NewAuth(c discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
||||
return &Auth{c: c}
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
zk *openKeeper.ZkClient
|
||||
c discoveryregistry.SvcDiscoveryRegistry
|
||||
}
|
||||
|
||||
func (o *Auth) client() (auth.AuthClient, error) {
|
||||
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImAuthName)
|
||||
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImAuthName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user