Documentation ¶
Index ¶
- Constants
- type BusinessActionContext
- type RootContext
- func (c *RootContext) Bind(xid string)
- func (c *RootContext) BindGlobalLockFlag()
- func (c *RootContext) BindInterceptorType(xidType string)
- func (c *RootContext) BindInterceptorTypeWithBranchType(xid string, branchType apis.BranchSession_BranchType)
- func (c *RootContext) Get(key string) (value interface{}, exists bool)
- func (c *RootContext) GetXID() string
- func (c *RootContext) GetXIDInterceptorType() string
- func (c *RootContext) InGlobalTransaction() bool
- func (c *RootContext) RequireGlobalLock() bool
- func (c *RootContext) Set(key string, value interface{})
- func (c *RootContext) Unbind() string
- func (c *RootContext) UnbindGlobalLockFlag()
- func (c *RootContext) UnbindInterceptorType() string
Constants ¶
const ( KeyXID = "TX_XID" KeyXIDInterceptorType = "tx-xid-interceptor-type" KeyGlobalLockFlag = "TX_LOCK" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BusinessActionContext ¶
type BusinessActionContext struct { *RootContext XID string BranchID string ActionName string ActionContext map[string]interface{} }
BusinessActionContext store the tcc branch transaction context
type RootContext ¶
RootContext store the global transaction context
func NewRootContext ¶
func NewRootContext(ctx context.Context) *RootContext
NewRootContext return a pointer to RootContext
func (*RootContext) BindGlobalLockFlag ¶
func (c *RootContext) BindGlobalLockFlag()
BindGlobalLockFlag bind global lock flag with RootContext
func (*RootContext) BindInterceptorType ¶
func (c *RootContext) BindInterceptorType(xidType string)
BindInterceptorType bind interceptor type with RootContext
func (*RootContext) BindInterceptorTypeWithBranchType ¶
func (c *RootContext) BindInterceptorTypeWithBranchType(xid string, branchType apis.BranchSession_BranchType)
BindInterceptorTypeWithBranchType bind interceptor type and branch type with RootContext
func (*RootContext) Get ¶
func (c *RootContext) Get(key string) (value interface{}, exists bool)
Get get a value by given key from RootContext
func (*RootContext) GetXIDInterceptorType ¶
func (c *RootContext) GetXIDInterceptorType() string
GetXIDInterceptorType from RootContext get xid interceptor type
func (*RootContext) InGlobalTransaction ¶
func (c *RootContext) InGlobalTransaction() bool
InGlobalTransaction determine whether the context is in global transaction
func (*RootContext) RequireGlobalLock ¶
func (c *RootContext) RequireGlobalLock() bool
RequireGlobalLock return global lock flag
func (*RootContext) Set ¶
func (c *RootContext) Set(key string, value interface{})
Set store key value to RootContext
func (*RootContext) Unbind ¶
func (c *RootContext) Unbind() string
Unbind unbind xid with RootContext
func (*RootContext) UnbindGlobalLockFlag ¶
func (c *RootContext) UnbindGlobalLockFlag()
UnbindGlobalLockFlag unbind global lock flag with RootContext
func (*RootContext) UnbindInterceptorType ¶
func (c *RootContext) UnbindInterceptorType() string
UnbindInterceptorType unbind interceptor type with RootContext