Documentation ¶
Index ¶
- Variables
- func CronExpiredTrans(num int)
- func CronTransOnce() (gid string)
- func CronUpdateTopicsMap()
- func GenGid() string
- func GetStore() storage.Store
- func PopulateDB(skipDrop bool)
- func StartSvr() *gin.Engine
- func Subscribe(topic, url, remark string) error
- func Unsubscribe(topic, url string) error
- type Subscriber
- type Topic
- type TransBranch
- type TransGlobal
Constants ¶
This section is empty.
Variables ¶
var CronForwardDuration = time.Duration(0)
CronForwardDuration will be set in test. cron will fetch trans which expire in CronForwardDuration
var NowForwardDuration = time.Duration(0)
NowForwardDuration will be set in test, trans may be timeout
var TransProcessedTestChan chan string
TransProcessedTestChan only for test usage. when transaction processed once, write gid to this chan
var UpdateBranchAsyncInterval = 200 * time.Millisecond
UpdateBranchAsyncInterval interval to flush branch
var Version = ""
Version store the passin version for dtm server
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 Subscriber ¶
Subscriber define subscriber info
type Topic ¶
type Topic struct { Name string `json:"k"` Subscribers []Subscriber `json:"v"` Version uint64 `json:"version"` }
Topic define topic info
type TransGlobal ¶
type TransGlobal struct { storage.TransGlobalStore ReqExtra map[string]string `json:"req_extra"` Context context.Context // contains filtered or unexported fields }
TransGlobal global transaction
func GetTransGlobal ¶
func GetTransGlobal(gid string) *TransGlobal
GetTransGlobal construct trans from db
func TransFromContext ¶
func TransFromContext(c *gin.Context) *TransGlobal
TransFromContext TransFromContext
func TransFromDtmRequest ¶
func TransFromDtmRequest(ctx context.Context, c *dtmgpb.DtmRequest) *TransGlobal
TransFromDtmRequest TransFromContext
func TransFromJrpcParams ¶
func TransFromJrpcParams(params interface{}) *TransGlobal
TransFromJrpcParams construct TransGlobal from jrpc params
func (*TransGlobal) Process ¶
func (t *TransGlobal) Process(branches []TransBranch) error
Process process global transaction once