Handler function definition for the RPC service
authorJulien Andrieux <julien@pantomath.io>
Wed, 4 Oct 2017 21:52:35 +0000 (23:52 +0200)
committerJulien Andrieux <julien@pantomath.io>
Thu, 5 Oct 2017 10:52:52 +0000 (12:52 +0200)
api/handler.go [new file with mode: 0644]

diff --git a/api/handler.go b/api/handler.go
new file mode 100644 (file)
index 0000000..f123180
--- /dev/null
@@ -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
+}