dtm/examples/main_grpc.go
2021-08-09 16:07:34 +08:00

20 lines
459 B
Go

package examples
import (
"context"
"log"
dtmpb "github.com/yedf/dtm/dtmpb"
)
// busiServer is used to implement helloworld.GreeterServer.
type busiServer struct {
UnimplementedBusiServer
}
// SayHello implements helloworld.GreeterServer
func (s *busiServer) Call(ctx context.Context, in *dtmpb.BusiRequest) (*dtmpb.BusiReply, error) {
log.Printf("busiServer received: %v", in)
return &dtmpb.BusiReply{DtmResult: "SUCCESS", DtmMessage: "ok"}, nil
}