feat 初次提交
This commit is contained in:
27
app/grpc.go
Normal file
27
app/grpc.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"common/net/grpc/service"
|
||||
"user/config"
|
||||
"user/internal/grpc_server/server"
|
||||
)
|
||||
|
||||
// ModuleGrpcServer Grpc服务模块
|
||||
type ModuleGrpcServer struct {
|
||||
server service.IService
|
||||
}
|
||||
|
||||
func (m *ModuleGrpcServer) init() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ModuleGrpcServer) start() error {
|
||||
m.server = 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
|
||||
}
|
||||
Reference in New Issue
Block a user