|
|
@ -9,13 +9,15 @@ import (
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msggateway"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msggateway"
|
|
|
|
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient/notification"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/startrpc"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/startrpc"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func (s *Server) InitServer(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
|
|
|
func (s *Server) InitServer(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
|
|
|
msggateway.RegisterMsgGatewayServer(server, &Server{})
|
|
|
|
s.notification = notification.NewCheck(client)
|
|
|
|
|
|
|
|
msggateway.RegisterMsgGatewayServer(server, s)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -24,6 +26,7 @@ func (s *Server) Start() error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Server struct {
|
|
|
|
type Server struct {
|
|
|
|
|
|
|
|
notification *notification.Check
|
|
|
|
rpcPort int
|
|
|
|
rpcPort int
|
|
|
|
prometheusPort int
|
|
|
|
prometheusPort int
|
|
|
|
LongConnServer LongConnServer
|
|
|
|
LongConnServer LongConnServer
|
|
|
@ -31,6 +34,10 @@ type Server struct {
|
|
|
|
//rpcServer *RpcServer
|
|
|
|
//rpcServer *RpcServer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (s *Server) Notification() *notification.Check {
|
|
|
|
|
|
|
|
return s.notification
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func NewServer(rpcPort int, longConnServer LongConnServer) *Server {
|
|
|
|
func NewServer(rpcPort int, longConnServer LongConnServer) *Server {
|
|
|
|
return &Server{rpcPort: rpcPort, LongConnServer: longConnServer, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
|
|
|
return &Server{rpcPort: rpcPort, LongConnServer: longConnServer, pushTerminal: []int{constant.IOSPlatformID, constant.AndroidPlatformID}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|