Documentation ¶
Index ¶
- Variables
- type AbstractResourceManager
- func (resourceManager AbstractResourceManager) BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, ...) (int64, error)
- func (resourceManager AbstractResourceManager) BranchReport(branchType meta.BranchType, xid string, branchID int64, ...) error
- func (resourceManager AbstractResourceManager) GetManagedResources() map[string]model.IResource
- func (resourceManager AbstractResourceManager) LockQuery(ctx *context.RootContext, branchType meta.BranchType, resourceID string, ...) (bool, error)
- func (resourceManager AbstractResourceManager) RegisterResource(resource model.IResource)
- func (resourceManager AbstractResourceManager) UnregisterResource(resource model.IResource)
- type ResourceManager
- type ResourceManagerInbound
- type ResourceManagerOutbound
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DBKEYS_SPLIT_CHAR = ","
)
Functions ¶
This section is empty.
Types ¶
type AbstractResourceManager ¶
type AbstractResourceManager struct { RpcClient *rpc_client.RpcRemoteClient ResourceCache map[string]model.IResource }
func NewAbstractResourceManager ¶
func NewAbstractResourceManager(client *rpc_client.RpcRemoteClient) AbstractResourceManager
func (AbstractResourceManager) BranchRegister ¶
func (resourceManager AbstractResourceManager) BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, applicationData []byte, lockKeys string) (int64, error)
func (AbstractResourceManager) BranchReport ¶
func (resourceManager AbstractResourceManager) BranchReport(branchType meta.BranchType, xid string, branchID int64, status meta.BranchStatus, applicationData []byte) error
func (AbstractResourceManager) GetManagedResources ¶
func (resourceManager AbstractResourceManager) GetManagedResources() map[string]model.IResource
func (AbstractResourceManager) LockQuery ¶
func (resourceManager AbstractResourceManager) LockQuery(ctx *context.RootContext, branchType meta.BranchType, resourceID string, xid string, lockKeys string) (bool, error)
func (AbstractResourceManager) RegisterResource ¶
func (resourceManager AbstractResourceManager) RegisterResource(resource model.IResource)
func (AbstractResourceManager) UnregisterResource ¶
func (resourceManager AbstractResourceManager) UnregisterResource(resource model.IResource)
type ResourceManager ¶
type ResourceManager interface { ResourceManagerInbound ResourceManagerOutbound // Register a Resource to be managed by Resource Manager. RegisterResource(resource model.IResource) // Unregister a Resource from the Resource Manager. UnregisterResource(resource model.IResource) // Get all resources managed by this manager. GetManagedResources() map[string]model.IResource // Get the BranchType. GetBranchType() meta.BranchType }
type ResourceManagerInbound ¶
type ResourceManagerInbound interface { // Commit a branch transaction. BranchCommit(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error) // Rollback a branch transaction. BranchRollback(branchType meta.BranchType, xid string, branchID int64, resourceID string, applicationData []byte) (meta.BranchStatus, error) }
type ResourceManagerOutbound ¶
type ResourceManagerOutbound interface { // Branch register long. BranchRegister(branchType meta.BranchType, resourceID string, clientID string, xid string, applicationData []byte, lockKeys string) (int64, error) // Branch report. BranchReport(branchType meta.BranchType, xid string, branchID int64, status meta.BranchStatus, applicationData []byte) error // Lock query boolean. LockQuery(branchType meta.BranchType, resourceID string, xid string, lockKeys string) (bool, error) }
Click to show internal directories.
Click to hide internal directories.