consts

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 1 Imported by: 1

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

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

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