This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/user/internal/grpc_server/server/server_init.go

33 lines
524 B
Go

package server
import (
"common/discover/common"
"common/net/grpc/service"
"common/proto/ss/grpc_pb"
"google.golang.org/grpc"
)
type Server struct {
grpc_pb.UnimplementedUserServer
service.Base
}
func NewServer(ttl int64) *Server {
s := &Server{
Base: service.Base{
Target: common.KeyDiscoverUser,
EtcdTTL: ttl,
},
}
s.Base.OnInit = s.OnInit
s.Base.OnClose = s.OnClose
return s
}
func (s *Server) OnInit(serve *grpc.Server) {
grpc_pb.RegisterUserServer(serve, s)
}
func (s *Server) OnClose() {
}