tcc

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TCC_ACTION_NAME = "TccActionName"

	TRY_METHOD     = "Try"
	CONFIRM_METHOD = "Confirm"
	CANCEL_METHOD  = "Cancel"

	ACTION_START_TIME = "action-start-time"
	ACTION_NAME       = "actionName"
	PREPARE_METHOD    = "sys::prepare"
	COMMIT_METHOD     = "sys::commit"
	ROLLBACK_METHOD   = "sys::rollback"
	HOST_NAME         = "host-name"

	TCC_METHOD_ARGUMENTS = "arguments"
	TCC_METHOD_RESULT    = "result"
)
View Source
var (
	TCC_ACTION_CONTEXT = "actionContext"
)

Functions

func ImplementTCC

func ImplementTCC(v TccProxyService)

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 TccProxyService

type TccProxyService interface {
	GetTccService() TccService
}

type TccService

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

Jump to

Keyboard shortcuts

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