tcc

package
v0.0.0-...-1fef4f5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TCCActionName
	TCCActionName = "TCCActionName"

	// TryMethod
	TryMethod = "Try"
	// ConfirmMethod
	ConfirmMethod = "Confirm"
	// CancelMethod
	CancelMethod = "Cancel"

	// ActionStartTime
	ActionStartTime = "action-start-time"
	// ActionName
	ActionName = "actionName"
	// PrepareMethod
	PrepareMethod = "sys::prepare"
	// CommitMethod
	CommitMethod = "sys::commit"
	// RollbackMethod
	RollbackMethod = "sys::rollback"
	// HostName
	HostName = "host-name"

	// TCCMethodArguments
	TCCMethodArguments = "arguments"
	// TCCMethodResult
	TCCMethodResult = "result"
)
View Source
var (
	TCC_ACTION_CONTEXT = "actionContext"
)

Functions

func ImplementTCC

func ImplementTCC(v TCCServiceProxy)

func InitTCCResourceManager

func InitTCCResourceManager()

Types

type TCCResource

type TCCResource struct {
	ResourceGroupID    string
	AppName            string
	ActionName         string
	PrepareMethodName  string
	CommitMethodName   string
	CommitMethod       *proxy.MethodDescriptor
	RollbackMethodName string
	RollbackMethod     *proxy.MethodDescriptor
}

func (*TCCResource) GetBranchType

func (resource *TCCResource) GetBranchType() meta.BranchType

func (*TCCResource) GetResourceGroupID

func (resource *TCCResource) GetResourceGroupID() string

func (*TCCResource) GetResourceID

func (resource *TCCResource) GetResourceID() string

type TCCResourceManager

type TCCResourceManager struct {
	rm.AbstractResourceManager
}

func (TCCResourceManager) BranchCommit

func (resourceManager TCCResourceManager) BranchCommit(branchType meta.BranchType, xid string, branchID int64,
	resourceID string, applicationData []byte) (meta.BranchStatus, error)

func (TCCResourceManager) BranchRollback

func (resourceManager TCCResourceManager) BranchRollback(branchType meta.BranchType, xid string, branchID int64,
	resourceID string, applicationData []byte) (meta.BranchStatus, error)

func (TCCResourceManager) GetBranchType

func (resourceManager TCCResourceManager) GetBranchType() meta.BranchType

type TCCService

type TCCService interface {
	Try(ctx *context.BusinessActionContext) (bool, error)
	Confirm(ctx *context.BusinessActionContext) bool
	Cancel(ctx *context.BusinessActionContext) bool
}

type TCCServiceProxy

type TCCServiceProxy interface {
	GetTCCService() TCCService
}

Jump to

Keyboard shortcuts

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