Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertBranchActionToGrpc(action BranchAction) proto.Action
- func ConvertBranchStateToGrpc(state BranchState) proto.BranchState
- func ConvertStateToGrpc(state GlobalState) proto.GlobalState
- func ConvertTranTypeToGrpc(tranType TransactionType) proto.TranType
- type BranchAction
- type BranchState
- type GlobalState
- type Level
- type TransactionType
Constants ¶
View Source
const ( TransactionUnknown TransactionType = "unknown" TCC TransactionType = "tcc" SAGA TransactionType = "saga" ActionUnknown = "unknown" Try BranchAction = "try" Confirm BranchAction = "confirm" Cancel BranchAction = "cancel" // Normal and Compensation branch type for SAGA Normal BranchAction = "normal" Compensation BranchAction = "compensation" )
View Source
const ( // Init init global state Init GlobalState = "init" //**********Phase1************ Phase1Preparing GlobalState = "preparing" Phase1Failed GlobalState = "p1_failed" Phase1Success GlobalState = "p1_success" //**********Phase2************* Phase2Committing GlobalState = "p2_committing" Phase2CommitFailed GlobalState = "p2_commit_failed" Phase2Rollbacking GlobalState = "p2_rollbacking" Phase2RollbackFailed GlobalState = "p2_rollback_failed" Committed GlobalState = "committed" Rollbacked GlobalState = "rollbacked" BranchInit BranchState = "init" BranchRetrying BranchState = "retrying" BranchSucceed BranchState = "succeed" BranchFailState BranchState = "failed" )
Variables ¶
View Source
var P1InProgressStates = []string{ string(Phase1Preparing), }
View Source
var P2InProgressStates = []string{ string(Phase1Success), string(Phase2Committing), string(Phase2CommitFailed), string(Phase1Failed), string(Phase2Rollbacking), string(Phase2RollbackFailed), }
Functions ¶
func ConvertBranchActionToGrpc ¶
func ConvertBranchActionToGrpc(action BranchAction) proto.Action
ConvertBranchActionToGrpc Convert branch action to pb action
func ConvertBranchStateToGrpc ¶
func ConvertBranchStateToGrpc(state BranchState) proto.BranchState
ConvertBranchStateToGrpc Convert branch state to pb state
func ConvertStateToGrpc ¶
func ConvertStateToGrpc(state GlobalState) proto.GlobalState
ConvertStateToGrpc Convert global state to pb state
func ConvertTranTypeToGrpc ¶
func ConvertTranTypeToGrpc(tranType TransactionType) proto.TranType
ConvertTranTypeToGrpc Convert branch tranType to pb tranType
Types ¶
type BranchAction ¶
type BranchAction string
BranchAction branch action,such as tcc (try、confirm、cancel)
type BranchState ¶
type BranchState string
BranchState branch state, such as tcc (try、confirm、cancel)
type GlobalState ¶
type GlobalState string
Click to show internal directories.
Click to hide internal directories.