Files
service-user/app/grpc.go

28 lines
609 B
Go

package app
import (
"git.hlsq.asia/mmorpg/service-common/net/grpc/service"
"git.hlsq.asia/mmorpg/service-user/config"
"git.hlsq.asia/mmorpg/service-user/internal/grpc_server"
)
// ModuleGrpcServer Grpc服务模块
type ModuleGrpcServer struct {
server service.IService
}
func (m *ModuleGrpcServer) init() error {
return nil
}
func (m *ModuleGrpcServer) start() error {
m.server = grpc_server.NewServer(config.Get().Serve.Grpc.TTL)
m.server.Init(config.Get().Serve.Grpc.Address, config.Get().Serve.Grpc.Port)
return nil
}
func (m *ModuleGrpcServer) stop() error {
m.server.Close()
return nil
}