Documentation
¶
Index ¶
- func BarrierFromGrpc(ctx context.Context) (*dtmcli.BranchBarrier, error)
- func GetCurrentDBType() string
- func MustGenGid(grpcServer string) string
- func SetCurrentDBType(dbType string)
- func TccGlobalTransaction(dtm string, gid string, tccFunc TccGlobalFunc) (rerr error)
- func UseDriver(driverName string) error
- type MsgGrpc
- type SagaGrpc
- type TccGlobalFunc
- type TccGrpc
- type XaGrpc
- type XaGrpcClient
- type XaGrpcGlobalFunc
- type XaGrpcLocalFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BarrierFromGrpc ¶ added in v0.10.1
func BarrierFromGrpc(ctx context.Context) (*dtmcli.BranchBarrier, error)
BarrierFromGrpc generate a Barrier from grpc context
func GetCurrentDBType ¶ added in v1.5.0
func GetCurrentDBType() string
GetCurrentDBType set the current db type
func MustGenGid ¶
MustGenGid must gen a gid from grpcServer
func SetCurrentDBType ¶ added in v1.3.0
func SetCurrentDBType(dbType string)
SetCurrentDBType set the current db type
func TccGlobalTransaction ¶
func TccGlobalTransaction(dtm string, gid string, tccFunc TccGlobalFunc) (rerr error)
TccGlobalTransaction begin a tcc global transaction dtm dtm服务器地址 gid 全局事务id tccFunc tcc事务函数,里面会定义全局事务的分支
Types ¶
type MsgGrpc ¶
MsgGrpc reliable msg type
type SagaGrpc ¶
SagaGrpc struct of saga
func NewSagaGrpc ¶ added in v1.5.0
NewSagaGrpc create a saga
func (*SagaGrpc) AddBranchOrder ¶ added in v1.5.0
AddBranchOrder specify that branch should be after preBranches. branch should is larger than all the element in preBranches
func (*SagaGrpc) EnableConcurrent ¶ added in v1.5.0
EnableConcurrent enable the concurrent exec of sub trans
type TccGlobalFunc ¶
TccGlobalFunc type of global tcc call
type TccGrpc ¶
TccGrpc struct of tcc
func TccFromGrpc ¶ added in v1.5.0
TccFromGrpc tcc from request info
type XaGrpc ¶
XaGrpc xa transaction
func XaGrpcFromRequest ¶
XaGrpcFromRequest construct xa info from request
type XaGrpcClient ¶
type XaGrpcClient struct {
dtmimp.XaClientBase
}
XaGrpcClient xa client
func NewXaGrpcClient ¶
func NewXaGrpcClient(server string, mysqlConf dtmcli.DBConf, notifyURL string) *XaGrpcClient
NewXaGrpcClient construct a xa client
func (*XaGrpcClient) HandleCallback ¶
HandleCallback 处理commit/rollback的回调
func (*XaGrpcClient) XaGlobalTransaction ¶
func (xc *XaGrpcClient) XaGlobalTransaction(gid string, xaFunc XaGrpcGlobalFunc) error
XaGlobalTransaction start a xa global transaction
func (*XaGrpcClient) XaLocalTransaction ¶
func (xc *XaGrpcClient) XaLocalTransaction(ctx context.Context, msg proto.Message, xaFunc XaGrpcLocalFunc) error
XaLocalTransaction start a xa local transaction
type XaGrpcGlobalFunc ¶
XaGrpcGlobalFunc type of xa global function