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.
14 lines
350 B
14 lines
350 B
package dtmgrpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/yedf/dtm/dtmcli"
|
|
"github.com/yedf/dtm/dtmgrpc/dtmgimp"
|
|
)
|
|
|
|
// BarrierFromGrpc generate a Barrier from grpc context
|
|
func BarrierFromGrpc(ctx context.Context) (*dtmcli.BranchBarrier, error) {
|
|
tb := dtmgimp.TransBaseFromGrpc(ctx)
|
|
return dtmcli.BarrierFrom(tb.TransType, tb.Gid, tb.BranchID, tb.Op)
|
|
}
|
|
|