Create & Init Project...
This commit is contained in:
28
app/service/main/identify-game/rpc/server/rpc.go
Normal file
28
app/service/main/identify-game/rpc/server/rpc.go
Normal file
@ -0,0 +1,28 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"go-common/app/service/main/identify-game/conf"
|
||||
"go-common/app/service/main/identify-game/service"
|
||||
"go-common/library/net/rpc"
|
||||
"go-common/library/net/rpc/context"
|
||||
)
|
||||
|
||||
// RPC define rpc.
|
||||
type RPC struct {
|
||||
s *service.Service
|
||||
}
|
||||
|
||||
// New new rpc server.
|
||||
func New(c *conf.Config, s *service.Service) (svr *rpc.Server) {
|
||||
r := &RPC{s: s}
|
||||
svr = rpc.NewServer(c.RPCServer)
|
||||
if err := svr.Register(r); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Ping check connection success.
|
||||
func (r *RPC) Ping(c context.Context, arg *struct{}, res *struct{}) (err error) {
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user