consts

package
v0.0.0-...-535fc81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

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),
}

Functions

func ConvertBranchActionToGrpc

func ConvertBranchActionToGrpc(action BranchAction) proto.Action

func ConvertBranchStateToGrpc

func ConvertBranchStateToGrpc(state BranchState) proto.BranchState

func ConvertStateToGrpc

func ConvertStateToGrpc(state GlobalState) proto.GlobalState

func ConvertTranTypeToGrpc

func ConvertTranTypeToGrpc(tranType TransactionType) proto.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

type Level

type Level uint32

Level branch level, 0 is first level,same level can executed concurrently

type TransactionType

type TransactionType string

TransactionType transaction type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL