mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
817 B
28 lines
817 B
package examples
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/yedf/dtm/dtmcli"
|
|
dtmpb "github.com/yedf/dtm/dtmpb"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// busiServer is used to implement helloworld.GreeterServer.
|
|
type busiServer struct {
|
|
UnimplementedBusiServer
|
|
}
|
|
|
|
func (s *busiServer) TransIn(ctx context.Context, in *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
|
req := TransReq{}
|
|
dtmcli.MustUnmarshal(in.AppData, &req)
|
|
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
|
return &emptypb.Empty{}, nil
|
|
}
|
|
|
|
func (s *busiServer) TransOut(ctx context.Context, in *dtmpb.BusiRequest) (*emptypb.Empty, error) {
|
|
req := TransReq{}
|
|
dtmcli.MustUnmarshal(in.AppData, &req)
|
|
dtmcli.Logf("busiServer %s received: %v %v", dtmcli.GetFuncName(), in.Info, req)
|
|
return &emptypb.Empty{}, nil
|
|
}
|
|
|