git://git.halfball.org
/
demo-grpc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7e88c6
)
Handler function definition for the RPC service
author
Julien Andrieux
<julien@pantomath.io>
Wed, 4 Oct 2017 21:52:35 +0000
(23:52 +0200)
committer
Julien Andrieux
<julien@pantomath.io>
Thu, 5 Oct 2017 10:52:52 +0000
(12:52 +0200)
api/handler.go
[new file with mode: 0644]
patch
|
blob
diff --git a/api/handler.go
b/api/handler.go
new file mode 100644
(file)
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
+}