Documentation
¶
Index ¶
- Variables
- func ImplementTCC(v ProxyService)
- type ProxyService
- type Resource
- type ResourceManager
- func (resourceManager ResourceManager) Commit(ctx context.Context, bs *api.BranchSession) (api.BranchSession_BranchStatus, error)
- func (resourceManager ResourceManager) GetBranchType() api.BranchSession_BranchType
- func (resourceManager ResourceManager) RegisterResource(resource *Resource)
- func (resourceManager ResourceManager) Rollback(ctx context.Context, bs *api.BranchSession) (api.BranchSession_BranchStatus, error)
- func (resourceManager ResourceManager) UnregisterResource(resource *Resource)
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ActionNameTag = "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" )
View Source
var (
ActionContext = "actionContext"
)
Functions ¶
func ImplementTCC ¶
func ImplementTCC(v ProxyService)
Types ¶
type ProxyService ¶
type ProxyService interface {
GetService() Service
}
type Resource ¶
type Resource struct {
ActionName string
PrepareMethodName string
CommitMethodName string
CommitMethod *proxy.MethodDescriptor
RollbackMethodName string
RollbackMethod *proxy.MethodDescriptor
}
func (*Resource) GetBranchType ¶
func (resource *Resource) GetBranchType() api.BranchSession_BranchType
func (*Resource) GetResourceID ¶
type ResourceManager ¶
func GetResourceManager ¶
func GetResourceManager() ResourceManager
func (ResourceManager) Commit ¶
func (resourceManager ResourceManager) Commit(ctx context.Context, bs *api.BranchSession) (api.BranchSession_BranchStatus, error)
func (ResourceManager) GetBranchType ¶
func (resourceManager ResourceManager) GetBranchType() api.BranchSession_BranchType
func (ResourceManager) RegisterResource ¶
func (resourceManager ResourceManager) RegisterResource(resource *Resource)
func (ResourceManager) Rollback ¶
func (resourceManager ResourceManager) Rollback(ctx context.Context, bs *api.BranchSession) (api.BranchSession_BranchStatus, error)
func (ResourceManager) UnregisterResource ¶
func (resourceManager ResourceManager) UnregisterResource(resource *Resource)
type Service ¶
type Service interface {
Try(ctx *ctx.BusinessActionContext) (bool, error)
Confirm(ctx *ctx.BusinessActionContext) bool
Cancel(ctx *ctx.BusinessActionContext) bool
}
Click to show internal directories.
Click to hide internal directories.