Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CronForwardDuration time.Duration = time.Duration(0)
CronForwardDuration will be set in test. cron will fetch trans which expire in CronForwardDuration
View Source
var NowForwardDuration time.Duration = time.Duration(0)
NowForwardDuration will be set in test, trans may be timeout
View Source
var TransProcessedTestChan chan string = nil
TransProcessedTestChan only for test usage. when transaction processed once, write gid to this chan
View Source
var UpdateBranchAsyncInterval = 200 * time.Millisecond
UpdateBranchAsyncInterval interval to flush branch
Functions ¶
func CronExpiredTrans ¶
func CronExpiredTrans(num int)
CronExpiredTrans cron expired trans, num == -1 indicate for ever
func CronTransOnce ¶
func CronTransOnce() (gid string)
CronTransOnce cron expired trans. use expireIn as expire time
Types ¶
type TransBranch ¶
type TransBranch struct { common.ModelBase Gid string URL string `json:"url"` BinData []byte BranchID string `json:"branch_id"` Op string Status string FinishTime *time.Time RollbackTime *time.Time }
TransBranch branch transaction
type TransGlobal ¶
type TransGlobal struct { common.ModelBase Gid string `json:"gid"` TransType string `json:"trans_type"` Steps []map[string]string `json:"steps" gorm:"-"` Payloads []string `json:"payloads" gorm:"-"` BinPayloads [][]byte `json:"-" gorm:"-"` Status string `json:"status"` QueryPrepared string `json:"query_prepared"` Protocol string `json:"protocol"` CommitTime *time.Time FinishTime *time.Time RollbackTime *time.Time Options string CustomData string `json:"custom_data"` NextCronInterval int64 NextCronTime *time.Time dtmimp.TransOptions // contains filtered or unexported fields }
TransGlobal global transaction
func TransFromContext ¶
func TransFromContext(c *gin.Context) *TransGlobal
TransFromContext TransFromContext
func TransFromDtmRequest ¶ added in v0.10.0
func TransFromDtmRequest(c *dtmgimp.DtmRequest) *TransGlobal
TransFromDtmRequest TransFromContext
Click to show internal directories.
Click to hide internal directories.