rpc-sample/server/hello-server.go

20 lines
265 B
Go

package server
type HelloRequest struct {
Name string
}
type HelloResponse struct {
Reply string
}
type Hello struct {
}
func (*Hello) Say(req HelloRequest, reply *HelloResponse) error {
*reply = HelloResponse{
Reply: "hello " + req.Name,
}
return nil
}