mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 11:36:44 +08:00
conn
This commit is contained in:
parent
da3f9670e9
commit
74ea708893
@ -12,11 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImAuthName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Auth{conn: conn, discov: discov}
|
return &Auth{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Auth struct {
|
type Auth struct {
|
||||||
|
@ -12,11 +12,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation {
|
func NewConversation(discov discoveryregistry.SvcDiscoveryRegistry) *Conversation {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImConversationName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Conversation{conn: conn, discov: discov}
|
return &Conversation{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Conversation struct {
|
type Conversation struct {
|
||||||
|
@ -13,11 +13,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend {
|
func NewFriend(discov discoveryregistry.SvcDiscoveryRegistry) *Friend {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImFriendName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Friend{conn: conn, discov: discov}
|
return &Friend{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Friend struct {
|
type Friend struct {
|
||||||
|
@ -13,11 +13,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group {
|
func NewGroup(discov discoveryregistry.SvcDiscoveryRegistry) *Group {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Group{conn: conn, discov: discov}
|
return &Group{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Group struct {
|
type Group struct {
|
||||||
|
@ -22,11 +22,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewMsg(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
|
func NewMsg(discov discoveryregistry.SvcDiscoveryRegistry) *Message {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImMsgName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Message{conn: conn, validate: validator.New(), discov: discov}
|
return &Message{validate: validator.New(), discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
|
@ -18,11 +18,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third {
|
func NewThird(discov discoveryregistry.SvcDiscoveryRegistry) *Third {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImThirdName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
return &Third{conn: conn, discov: discov}
|
return &Third{discov: discov}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Third struct {
|
type Third struct {
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apiresp"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/apistruct"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/log"
|
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/tokenverify"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
@ -18,12 +17,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
|
||||||
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
// conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
// panic(err)
|
// panic(err)
|
||||||
}
|
// }
|
||||||
log.ZInfo(context.Background(), "user rpc conn", "conn", conn)
|
return &User{discov: discov}
|
||||||
return &User{conn: conn, discov: discov}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user