From 72ff2aa4a8881b957a58dfa3bba86aed3a1551fd Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Mon, 9 Aug 2021 14:45:18 +0800 Subject: [PATCH] server call busi seems ok --- examples/main_grpc.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 examples/main_grpc.go diff --git a/examples/main_grpc.go b/examples/main_grpc.go new file mode 100644 index 0000000..1ca8a2f --- /dev/null +++ b/examples/main_grpc.go @@ -0,0 +1,19 @@ +package examples + +import ( + "context" + "log" + + dtmcli "github.com/yedf/dtm/dtmcli" +) + +// busiServer is used to implement helloworld.GreeterServer. +type busiServer struct { + UnimplementedBusiServer +} + +// SayHello implements helloworld.GreeterServer +func (s *busiServer) Call(ctx context.Context, in *dtmcli.BusiRequest) (*dtmcli.BusiReply, error) { + log.Printf("busiServer received: %v", in) + return &dtmcli.BusiReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil +}