Documentation ¶
Index ¶
- func AddUnaryInterceptor(interceptor grpc.UnaryClientInterceptor)
- func BarrierFromGrpc(ctx context.Context) (*dtmcli.BranchBarrier, error)
- func DtmError2GrpcError(res interface{}) error
- func GrpcError2DtmError(err error) error
- func MustGenGid(grpcServer string) string
- func TccGlobalTransaction(dtm string, gid string, tccFunc TccGlobalFunc) (rerr error)
- func TccGlobalTransaction2(dtm string, gid string, custom func(*TccGrpc), tccFunc TccGlobalFunc) (rerr error)
- func UseDriver(driverName string) error
- func XaGlobalTransaction(server string, gid string, xaFunc XaGrpcGlobalFunc) error
- func XaGlobalTransaction2(server string, gid string, custom func(*XaGrpc), xaFunc XaGrpcGlobalFunc) error
- func XaLocalTransaction(ctx context.Context, dbConf dtmcli.DBConf, xaFunc XaGrpcLocalFunc) error
- type MsgGrpc
- func (s *MsgGrpc) Add(action string, msg proto.Message) *MsgGrpc
- func (s *MsgGrpc) DoAndSubmit(queryPrepared string, busiCall func(bb *dtmcli.BranchBarrier) error) error
- func (s *MsgGrpc) DoAndSubmitDB(queryPrepared string, db *sql.DB, busiCall dtmcli.BarrierBusiFunc) error
- func (s *MsgGrpc) Prepare(queryPrepared string) error
- func (s *MsgGrpc) SetDelay(delay uint64) *MsgGrpc
- func (s *MsgGrpc) Submit() error
- type SagaGrpc
- type TccGlobalFunc
- type TccGrpc
- type XaGrpc
- type XaGrpcGlobalFunc
- type XaGrpcLocalFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUnaryInterceptor ¶ added in v1.8.2
func AddUnaryInterceptor(interceptor grpc.UnaryClientInterceptor)
AddUnaryInterceptor adds grpc.UnaryClientInterceptor
func BarrierFromGrpc ¶
func BarrierFromGrpc(ctx context.Context) (*dtmcli.BranchBarrier, error)
BarrierFromGrpc generate a Barrier from grpc context
func DtmError2GrpcError ¶ added in v1.10.0
func DtmError2GrpcError(res interface{}) error
DtmError2GrpcError translate dtm error to grpc error
func GrpcError2DtmError ¶ added in v1.11.1
GrpcError2DtmError translate grpc error to dtm error
func MustGenGid ¶
MustGenGid must gen a gid from grpcServer
func TccGlobalTransaction ¶
func TccGlobalTransaction(dtm string, gid string, tccFunc TccGlobalFunc) (rerr error)
TccGlobalTransaction begin a tcc global transaction dtm dtm server url gid global transaction id tccFunc tcc busi func, define the transaction logic
func TccGlobalTransaction2 ¶ added in v1.8.4
func TccGlobalTransaction2(dtm string, gid string, custom func(*TccGrpc), tccFunc TccGlobalFunc) (rerr error)
TccGlobalTransaction2 new version of TccGlobalTransaction
func XaGlobalTransaction ¶ added in v1.13.0
func XaGlobalTransaction(server string, gid string, xaFunc XaGrpcGlobalFunc) error
XaGlobalTransaction start a xa global transaction
func XaGlobalTransaction2 ¶ added in v1.13.0
func XaGlobalTransaction2(server string, gid string, custom func(*XaGrpc), xaFunc XaGrpcGlobalFunc) error
XaGlobalTransaction2 new version of XaGlobalTransaction. support custom
func XaLocalTransaction ¶ added in v1.13.0
XaLocalTransaction start a xa local transaction
Types ¶
type MsgGrpc ¶
MsgGrpc reliable msg type
func (*MsgGrpc) DoAndSubmit ¶ added in v1.11.1
func (s *MsgGrpc) DoAndSubmit(queryPrepared string, busiCall func(bb *dtmcli.BranchBarrier) error) error
DoAndSubmit one method for the entire prepare->busi->submit the error returned by busiCall will be returned if busiCall return ErrFailure, then abort is called directly if busiCall return not nil error other than ErrFailure, then DoAndSubmit will call queryPrepared to get the result
func (*MsgGrpc) DoAndSubmitDB ¶ added in v1.11.1
func (s *MsgGrpc) DoAndSubmitDB(queryPrepared string, db *sql.DB, busiCall dtmcli.BarrierBusiFunc) error
DoAndSubmitDB short method for Do on db type. please see DoAndSubmit
type SagaGrpc ¶
SagaGrpc struct of saga
func (*SagaGrpc) AddBranchOrder ¶
AddBranchOrder specify that branch should be after preBranches. branch should is larger than all the element in preBranches
func (*SagaGrpc) EnableConcurrent ¶
EnableConcurrent enable the concurrent exec of sub trans
type TccGlobalFunc ¶
TccGlobalFunc type of global tcc call
type XaGrpc ¶
XaGrpc xa transaction
func XaGrpcFromRequest ¶
XaGrpcFromRequest construct xa info from request
type XaGrpcGlobalFunc ¶
XaGrpcGlobalFunc type of xa global function