Documentation
¶
Index ¶
- Constants
- func Implement(v GlobalTransactionProxyService)
- func InitTransactionManager(addressing string, client apis.TransactionManagerServiceClient)
- type DefaultGlobalTransaction
- func (gtx *DefaultGlobalTransaction) Begin(ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) BeginWithTimeout(timeout int32, ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) BeginWithTimeoutAndName(timeout int32, name string, ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) Commit(ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) GetLocalStatus() apis.GlobalSession_GlobalStatus
- func (gtx *DefaultGlobalTransaction) GetStatus(ctx *ctx.RootContext) (apis.GlobalSession_GlobalStatus, error)
- func (gtx *DefaultGlobalTransaction) GetXid(ctx *ctx.RootContext) string
- func (gtx *DefaultGlobalTransaction) GlobalReport(globalStatus apis.GlobalSession_GlobalStatus, ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) Rollback(ctx *ctx.RootContext) error
- func (gtx *DefaultGlobalTransaction) Suspend(unbindXid bool, ctx *ctx.RootContext) (*SuspendedResourcesHolder, error)
- type GlobalTransaction
- type GlobalTransactionProxyService
- type GlobalTransactionRole
- type SuspendedResourcesHolder
- type TransactionManager
- func (manager *TransactionManager) Begin(ctx context.Context, name string, timeout int32) (string, error)
- func (manager *TransactionManager) Commit(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
- func (manager *TransactionManager) GetStatus(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
- func (manager *TransactionManager) GlobalReport(ctx context.Context, xid string, globalStatus apis.GlobalSession_GlobalStatus) (apis.GlobalSession_GlobalStatus, error)
- func (manager *TransactionManager) Rollback(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
- type TransactionManagerInterface
Constants ¶
View Source
const ( DefaultGlobalTxTimeout = 60000 DefaultGlobalTxName = "default" )
Variables ¶
This section is empty.
Functions ¶
func Implement ¶
func Implement(v GlobalTransactionProxyService)
func InitTransactionManager ¶
func InitTransactionManager(addressing string, client apis.TransactionManagerServiceClient)
Types ¶
type DefaultGlobalTransaction ¶
type DefaultGlobalTransaction struct { XID string Status apis.GlobalSession_GlobalStatus Role GlobalTransactionRole // contains filtered or unexported fields }
func CreateNew ¶
func CreateNew() *DefaultGlobalTransaction
func GetCurrent ¶
func GetCurrent(ctx *ctx.RootContext) *DefaultGlobalTransaction
func GetCurrentOrCreate ¶
func GetCurrentOrCreate(ctx *ctx.RootContext) *DefaultGlobalTransaction
func (*DefaultGlobalTransaction) Begin ¶
func (gtx *DefaultGlobalTransaction) Begin(ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) BeginWithTimeout ¶
func (gtx *DefaultGlobalTransaction) BeginWithTimeout(timeout int32, ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) BeginWithTimeoutAndName ¶
func (gtx *DefaultGlobalTransaction) BeginWithTimeoutAndName(timeout int32, name string, ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) Commit ¶
func (gtx *DefaultGlobalTransaction) Commit(ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) GetLocalStatus ¶
func (gtx *DefaultGlobalTransaction) GetLocalStatus() apis.GlobalSession_GlobalStatus
func (*DefaultGlobalTransaction) GetStatus ¶
func (gtx *DefaultGlobalTransaction) GetStatus(ctx *ctx.RootContext) (apis.GlobalSession_GlobalStatus, error)
func (*DefaultGlobalTransaction) GetXid ¶
func (gtx *DefaultGlobalTransaction) GetXid(ctx *ctx.RootContext) string
func (*DefaultGlobalTransaction) GlobalReport ¶
func (gtx *DefaultGlobalTransaction) GlobalReport(globalStatus apis.GlobalSession_GlobalStatus, ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) Resume ¶
func (gtx *DefaultGlobalTransaction) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) Rollback ¶
func (gtx *DefaultGlobalTransaction) Rollback(ctx *ctx.RootContext) error
func (*DefaultGlobalTransaction) Suspend ¶
func (gtx *DefaultGlobalTransaction) Suspend(unbindXid bool, ctx *ctx.RootContext) (*SuspendedResourcesHolder, error)
type GlobalTransaction ¶
type GlobalTransaction interface { Begin(ctx *ctx.RootContext) error BeginWithTimeout(timeout int32, ctx *ctx.RootContext) error BeginWithTimeoutAndName(timeout int32, name string, ctx *ctx.RootContext) error Commit(ctx *ctx.RootContext) error Rollback(ctx *ctx.RootContext) error Suspend(unbindXid bool, ctx *ctx.RootContext) (*SuspendedResourcesHolder, error) Resume(suspendedResourcesHolder *SuspendedResourcesHolder, ctx *ctx.RootContext) error GetStatus(ctx *ctx.RootContext) (apis.GlobalSession_GlobalStatus, error) GetXid(ctx *ctx.RootContext) string GlobalReport(globalStatus apis.GlobalSession_GlobalStatus, ctx *ctx.RootContext) error GetLocalStatus() apis.GlobalSession_GlobalStatus }
type GlobalTransactionProxyService ¶
type GlobalTransactionProxyService interface { GetProxyService() interface{} GetMethodTransactionInfo(methodName string) *model.TransactionInfo }
type GlobalTransactionRole ¶
type GlobalTransactionRole byte
const ( // The Launcher. The one begins the current global transaction. Launcher GlobalTransactionRole = iota // The Participant. The one just joins into a existing global transaction. Participant )
func (GlobalTransactionRole) String ¶
func (role GlobalTransactionRole) String() string
type SuspendedResourcesHolder ¶
type SuspendedResourcesHolder struct {
Xid string
}
type TransactionManager ¶
type TransactionManager struct {
// contains filtered or unexported fields
}
func GetTransactionManager ¶
func GetTransactionManager() *TransactionManager
func (*TransactionManager) Commit ¶
func (manager *TransactionManager) Commit(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
func (*TransactionManager) GetStatus ¶
func (manager *TransactionManager) GetStatus(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
func (*TransactionManager) GlobalReport ¶
func (manager *TransactionManager) GlobalReport(ctx context.Context, xid string, globalStatus apis.GlobalSession_GlobalStatus) (apis.GlobalSession_GlobalStatus, error)
func (*TransactionManager) Rollback ¶
func (manager *TransactionManager) Rollback(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error)
type TransactionManagerInterface ¶
type TransactionManagerInterface interface { // GlobalStatus_Begin a new global transaction. Begin(ctx context.Context, name string, timeout int32) (string, error) // Global commit. Commit(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error) // Global rollback. Rollback(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error) // Get current status of the give transaction. GetStatus(ctx context.Context, xid string) (apis.GlobalSession_GlobalStatus, error) // Global report. GlobalReport(ctx context.Context, xid string, globalStatus apis.GlobalSession_GlobalStatus) (apis.GlobalSession_GlobalStatus, error) }
Click to show internal directories.
Click to hide internal directories.