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.
67 lines
2.0 KiB
67 lines
2.0 KiB
/*
|
|
* Copyright (c) 2021 yedf. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style
|
|
* license that can be found in the LICENSE file.
|
|
*/
|
|
|
|
package dtmcli
|
|
|
|
import (
|
|
"github.com/dtm-labs/dtm/dtmcli/dtmimp"
|
|
)
|
|
|
|
const (
|
|
// StatusPrepared status for global/branch trans status.
|
|
StatusPrepared = "prepared"
|
|
// StatusSubmitted status for global trans status.
|
|
StatusSubmitted = "submitted"
|
|
// StatusSucceed status for global/branch trans status.
|
|
StatusSucceed = "succeed"
|
|
// StatusFailed status for global/branch trans status.
|
|
StatusFailed = "failed"
|
|
// StatusAborting status for global trans status.
|
|
StatusAborting = "aborting"
|
|
|
|
// BranchTry branch type for TCC
|
|
BranchTry = "try"
|
|
// BranchConfirm branch type for TCC
|
|
BranchConfirm = "confirm"
|
|
// BranchCancel branch type for TCC
|
|
BranchCancel = "cancel"
|
|
// BranchAction branch type for message, SAGA, XA
|
|
BranchAction = "action"
|
|
// BranchCompensate branch type for SAGA
|
|
BranchCompensate = "compensate"
|
|
// BranchCommit branch type for XA
|
|
BranchCommit = "commit"
|
|
// BranchRollback branch type for XA
|
|
BranchRollback = "rollback"
|
|
|
|
// ResultSuccess for result of a trans/trans branch
|
|
ResultSuccess = dtmimp.ResultSuccess
|
|
// ResultFailure for result of a trans/trans branch
|
|
ResultFailure = dtmimp.ResultFailure
|
|
// ResultOngoing for result of a trans/trans branch
|
|
ResultOngoing = dtmimp.ResultOngoing
|
|
|
|
// DBTypeMysql const for driver mysql
|
|
DBTypeMysql = dtmimp.DBTypeMysql
|
|
// DBTypePostgres const for driver postgres
|
|
DBTypePostgres = dtmimp.DBTypePostgres
|
|
)
|
|
|
|
// MapSuccess HTTP result of SUCCESS
|
|
var MapSuccess = dtmimp.MapSuccess
|
|
|
|
// MapFailure HTTP result of FAILURE
|
|
var MapFailure = dtmimp.MapFailure
|
|
|
|
// ErrFailure error for returned failure
|
|
var ErrFailure = dtmimp.ErrFailure
|
|
|
|
// ErrOngoing error for returned ongoing
|
|
var ErrOngoing = dtmimp.ErrOngoing
|
|
|
|
// ErrDuplicated error of DUPLICATED for only msg
|
|
// if QueryPrepared executed before call. then DoAndSubmit return this error
|
|
var ErrDuplicated = dtmimp.ErrDuplicated
|
|
|