25 lines
679 B
Go
25 lines
679 B
Go
package dtmsvr
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/yedf/dtm/dtmgrpc"
|
|
pb "github.com/yedf/dtm/dtmgrpc"
|
|
"google.golang.org/protobuf/types/known/emptypb"
|
|
)
|
|
|
|
// dtmServer is used to implement helloworld.GreeterServer.
|
|
type dtmServer struct {
|
|
pb.UnimplementedDtmServer
|
|
}
|
|
|
|
func (s *dtmServer) Submit(ctx context.Context, in *pb.DtmRequest) (*emptypb.Empty, error) {
|
|
r, err := svcSubmit(TransFromDtmRequest(in), in.WaitResult)
|
|
return &emptypb.Empty{}, dtmgrpc.Result2Error(r, err)
|
|
}
|
|
|
|
func (s *dtmServer) Prepare(ctx context.Context, in *pb.DtmRequest) (*emptypb.Empty, error) {
|
|
r, err := svcPrepare(TransFromDtmRequest(in))
|
|
return &emptypb.Empty{}, dtmgrpc.Result2Error(r, err)
|
|
}
|