Documentation
¶
Index ¶
- func InitResourceManager(addressing string, client apis.ResourceManagerServiceClient)
- func RegisterTransactionServiceServer(rm ResourceManagerInterface)
- type ResourceManager
- func (manager ResourceManager) BranchCommit(ctx context.Context, request *apis.BranchCommitRequest) (*apis.BranchCommitResponse, error)
- func (manager *ResourceManager) BranchRegister(ctx context.Context, xid string, resourceID string, ...) (int64, error)
- func (manager *ResourceManager) BranchReport(ctx context.Context, xid string, branchID int64, ...) error
- func (manager *ResourceManager) BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error)
- func (manager *ResourceManager) LockQuery(ctx context.Context, xid string, resourceID string, ...) (bool, error)
- func (manager *ResourceManager) RegisterResource(resource model.Resource)
- func (manager *ResourceManager) UnregisterResource(resource model.Resource)
- type ResourceManagerInterface
- type ResourceManagerOutbound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitResourceManager ¶
func InitResourceManager(addressing string, client apis.ResourceManagerServiceClient)
func RegisterTransactionServiceServer ¶
func RegisterTransactionServiceServer(rm ResourceManagerInterface)
Types ¶
type ResourceManager ¶
type ResourceManager struct {
// contains filtered or unexported fields
}
func GetResourceManager ¶
func GetResourceManager() *ResourceManager
func (ResourceManager) BranchCommit ¶
func (manager ResourceManager) BranchCommit(ctx context.Context, request *apis.BranchCommitRequest) (*apis.BranchCommitResponse, error)
func (*ResourceManager) BranchRegister ¶
func (*ResourceManager) BranchReport ¶
func (manager *ResourceManager) BranchReport(ctx context.Context, xid string, branchID int64, branchType apis.BranchSession_BranchType, status apis.BranchSession_BranchStatus, applicationData []byte) error
func (*ResourceManager) BranchRollback ¶
func (manager *ResourceManager) BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error)
func (*ResourceManager) LockQuery ¶
func (manager *ResourceManager) LockQuery(ctx context.Context, xid string, resourceID string, branchType apis.BranchSession_BranchType, lockKeys string) (bool, error)
func (*ResourceManager) RegisterResource ¶
func (manager *ResourceManager) RegisterResource(resource model.Resource)
func (*ResourceManager) UnregisterResource ¶
func (manager *ResourceManager) UnregisterResource(resource model.Resource)
type ResourceManagerInterface ¶
type ResourceManagerInterface interface {
BranchCommit(ctx context.Context, request *apis.BranchCommitRequest) (*apis.BranchCommitResponse, error)
BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error)
// RegisterResource Register a Resource to be managed by Resource Manager.
RegisterResource(resource model.Resource)
// UnregisterResource Unregister a Resource from the Resource Manager.
UnregisterResource(resource model.Resource)
// GetBranchType ...
GetBranchType() apis.BranchSession_BranchType
}
type ResourceManagerOutbound ¶
type ResourceManagerOutbound interface {
// BranchRegister register branch transaction.
BranchRegister(ctx context.Context, xid string, resourceID string, branchType apis.BranchSession_BranchType,
applicationData []byte, lockKeys string) (int64, error)
// BranchReport report branch transaction status.
BranchReport(ctx context.Context, xid string, branchID int64, branchType apis.BranchSession_BranchType,
status apis.BranchSession_BranchStatus, applicationData []byte) error
// LockQuery lock resource by lockKeys.
LockQuery(ctx context.Context, xid string, resourceID string, branchType apis.BranchSession_BranchType, lockKeys string) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.