Documentation ¶
Index ¶
- func InitTCC()
- type Config
- type TCCResource
- type TCCResourceManager
- func (t *TCCResourceManager) BranchCommit(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)
- func (t *TCCResourceManager) BranchRegister(ctx context.Context, param rm.BranchRegisterParam) (int64, error)
- func (t *TCCResourceManager) BranchReport(ctx context.Context, param rm.BranchReportParam) error
- func (t *TCCResourceManager) BranchRollback(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)
- func (t *TCCResourceManager) GetBranchType() branch.BranchType
- func (t *TCCResourceManager) GetCachedResources() *sync.Map
- func (t *TCCResourceManager) LockQuery(ctx context.Context, param rm.LockQueryParam) (bool, error)
- func (t *TCCResourceManager) RegisterResource(resource rm.Resource) error
- func (t *TCCResourceManager) UnregisterResource(resource rm.Resource) error
- type TCCServiceProxy
- func (t *TCCServiceProxy) GetTransactionInfo() tm.GtxConfig
- func (t *TCCServiceProxy) Prepare(ctx context.Context, params interface{}) (interface{}, error)
- func (t *TCCServiceProxy) Reference() string
- func (t *TCCServiceProxy) RegisterResource() error
- func (t *TCCServiceProxy) SetReferenceName(referenceName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TCCResource ¶
type TCCResource struct { ResourceGroupId string `default:"DEFAULT"` AppName string *rm.TwoPhaseAction }
func ParseTCCResource ¶
func ParseTCCResource(v interface{}) (*TCCResource, error)
func (*TCCResource) GetBranchType ¶
func (t *TCCResource) GetBranchType() branch.BranchType
func (*TCCResource) GetResourceGroupId ¶
func (t *TCCResource) GetResourceGroupId() string
func (*TCCResource) GetResourceId ¶
func (t *TCCResource) GetResourceId() string
type TCCResourceManager ¶
type TCCResourceManager struct {
// contains filtered or unexported fields
}
func GetTCCResourceManagerInstance ¶
func GetTCCResourceManagerInstance() *TCCResourceManager
func (*TCCResourceManager) BranchCommit ¶
func (t *TCCResourceManager) BranchCommit(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)
Commit a branch transaction
func (*TCCResourceManager) BranchRegister ¶
func (t *TCCResourceManager) BranchRegister(ctx context.Context, param rm.BranchRegisterParam) (int64, error)
BranchRegister register transaction branch
func (*TCCResourceManager) BranchReport ¶
func (t *TCCResourceManager) BranchReport(ctx context.Context, param rm.BranchReportParam) error
BranchReport report status of transaction branch
func (*TCCResourceManager) BranchRollback ¶
func (t *TCCResourceManager) BranchRollback(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)
Rollback a branch transaction
func (*TCCResourceManager) GetBranchType ¶
func (t *TCCResourceManager) GetBranchType() branch.BranchType
func (*TCCResourceManager) GetCachedResources ¶
func (t *TCCResourceManager) GetCachedResources() *sync.Map
func (*TCCResourceManager) LockQuery ¶
func (t *TCCResourceManager) LockQuery(ctx context.Context, param rm.LockQueryParam) (bool, error)
LockQuery query lock status of transaction branch
func (*TCCResourceManager) RegisterResource ¶
func (t *TCCResourceManager) RegisterResource(resource rm.Resource) error
func (*TCCResourceManager) UnregisterResource ¶
func (t *TCCResourceManager) UnregisterResource(resource rm.Resource) error
type TCCServiceProxy ¶
type TCCServiceProxy struct { *TCCResource // contains filtered or unexported fields }
func NewTCCServiceProxy ¶
func NewTCCServiceProxy(service interface{}) (*TCCServiceProxy, error)
func (*TCCServiceProxy) GetTransactionInfo ¶
func (t *TCCServiceProxy) GetTransactionInfo() tm.GtxConfig
func (*TCCServiceProxy) Prepare ¶
func (t *TCCServiceProxy) Prepare(ctx context.Context, params interface{}) (interface{}, error)
func (*TCCServiceProxy) Reference ¶
func (t *TCCServiceProxy) Reference() string
func (*TCCServiceProxy) RegisterResource ¶
func (t *TCCServiceProxy) RegisterResource() error
func (*TCCServiceProxy) SetReferenceName ¶
func (t *TCCServiceProxy) SetReferenceName(referenceName string)
Click to show internal directories.
Click to hide internal directories.