tcc

package
v2.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TccActionName = "TccActionName"

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

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

	TccMethodArguments = "arguments"
	TccMethodResult    = "result"
)
View Source
var (
	TccActionContext = "actionContext"
)

Functions

func ImplementTCC

func ImplementTCC(v TccProxyService)

Types

type TCCResource

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

func (*TCCResource) GetBranchType

func (resource *TCCResource) GetBranchType() apis.BranchSession_BranchType

func (*TCCResource) GetResourceID

func (resource *TCCResource) GetResourceID() string

type TCCResourceManager

type TCCResourceManager struct {
	ResourceCache map[string]model.Resource
}

func GetTCCResourceManager

func GetTCCResourceManager() TCCResourceManager

func (TCCResourceManager) BranchCommit

func (resourceManager TCCResourceManager) BranchCommit(ctx context.Context, request *apis.BranchCommitRequest) (*apis.BranchCommitResponse, error)

func (TCCResourceManager) BranchRollback

func (resourceManager TCCResourceManager) BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error)

func (TCCResourceManager) GetBranchType

func (resourceManager TCCResourceManager) GetBranchType() apis.BranchSession_BranchType

func (TCCResourceManager) RegisterResource

func (resourceManager TCCResourceManager) RegisterResource(resource model.Resource)

func (TCCResourceManager) UnregisterResource

func (resourceManager TCCResourceManager) UnregisterResource(resource model.Resource)

type TccProxyService

type TccProxyService interface {
	GetTccService() TccService
}

type TccService

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

Jump to

Keyboard shortcuts

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