From: Julien Andrieux Date: Wed, 4 Oct 2017 21:52:35 +0000 (+0200) Subject: Handler function definition for the RPC service X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=d785b9fe9059f8456dbcaffa17e998aea056d342;p=demo-grpc.git Handler function definition for the RPC service --- diff --git a/api/handler.go b/api/handler.go new file mode 100644 index 0000000..f123180 --- /dev/null +++ b/api/handler.go @@ -0,0 +1,17 @@ +package api + +import ( + "log" + + "golang.org/x/net/context" +) + +// Server represents the gRPC server +type Server struct { +} + +// SayHello generates response to a Ping request +func (s *Server) SayHello(ctx context.Context, in *PingMessage) (*PingMessage, error) { + log.Printf("Receive message %s", in.Greeting) + return &PingMessage{Greeting: "bar"}, nil +}