Documentation ¶
Index ¶
- type BranchSession
- type BranchSessionOption
- func WithBsApplicationData(applicationData []byte) BranchSessionOption
- func WithBsBranchId(branchId int64) BranchSessionOption
- func WithBsBranchType(branchType meta.BranchType) BranchSessionOption
- func WithBsClientId(clientId string) BranchSessionOption
- func WithBsLockKey(lockKey string) BranchSessionOption
- func WithBsResourceGroupId(resourceGroupId string) BranchSessionOption
- func WithBsResourceId(resourceId string) BranchSessionOption
- func WithBsStatus(status meta.BranchStatus) BranchSessionOption
- func WithBsTransactionId(transactionId int64) BranchSessionOption
- func WithBsXid(xid string) BranchSessionOption
- type BranchSessionSlice
- type GlobalSession
- func (gs *GlobalSession) Add(branchSession *BranchSession)
- func (gs *GlobalSession) Begin()
- func (gs *GlobalSession) CanBeCommittedAsync() bool
- func (gs *GlobalSession) Decode(b []byte)
- func (gs *GlobalSession) Encode() ([]byte, error)
- func (gs *GlobalSession) GetBranch(branchId int64) *BranchSession
- func (gs *GlobalSession) GetReverseSortedBranches() []*BranchSession
- func (gs *GlobalSession) GetSortedBranches() []*BranchSession
- func (gs *GlobalSession) HasBranch() bool
- func (gs *GlobalSession) IsRollbackingDead() bool
- func (gs *GlobalSession) IsSaga() bool
- func (gs *GlobalSession) IsTimeout() bool
- func (gs *GlobalSession) Remove(branchSession *BranchSession)
- type GlobalSessionOption
- func WithGsActive(active bool) GlobalSessionOption
- func WithGsApplicationData(applicationData []byte) GlobalSessionOption
- func WithGsApplicationId(applicationId string) GlobalSessionOption
- func WithGsBeginTime(beginTime int64) GlobalSessionOption
- func WithGsStatus(status meta.GlobalStatus) GlobalSessionOption
- func WithGsTimeout(timeout int32) GlobalSessionOption
- func WithGsTransactionId(transactionId int64) GlobalSessionOption
- func WithGsTransactionName(transactionName string) GlobalSessionOption
- func WithGsTransactionServiceGroup(transactionServiceGroup string) GlobalSessionOption
- func WithGsXid(xid string) GlobalSessionOption
- type SessionStorable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchSession ¶
type BranchSession struct { Xid string TransactionId int64 BranchId int64 ResourceGroupId string ResourceId string LockKey string BranchType meta.BranchType Status meta.BranchStatus ClientId string ApplicationData []byte }
func NewBranchSession ¶
func NewBranchSession(opts ...BranchSessionOption) *BranchSession
func NewBranchSessionByGlobal ¶
func NewBranchSessionByGlobal(gs GlobalSession, opts ...BranchSessionOption) *BranchSession
func (*BranchSession) CompareTo ¶
func (bs *BranchSession) CompareTo(session *BranchSession) int
func (*BranchSession) Decode ¶
func (bs *BranchSession) Decode(b []byte)
func (*BranchSession) Encode ¶
func (bs *BranchSession) Encode() ([]byte, error)
type BranchSessionOption ¶
type BranchSessionOption func(session *BranchSession)
func WithBsApplicationData ¶
func WithBsApplicationData(applicationData []byte) BranchSessionOption
func WithBsBranchId ¶
func WithBsBranchId(branchId int64) BranchSessionOption
func WithBsBranchType ¶
func WithBsBranchType(branchType meta.BranchType) BranchSessionOption
func WithBsClientId ¶
func WithBsClientId(clientId string) BranchSessionOption
func WithBsLockKey ¶
func WithBsLockKey(lockKey string) BranchSessionOption
func WithBsResourceGroupId ¶
func WithBsResourceGroupId(resourceGroupId string) BranchSessionOption
func WithBsResourceId ¶
func WithBsResourceId(resourceId string) BranchSessionOption
func WithBsStatus ¶
func WithBsStatus(status meta.BranchStatus) BranchSessionOption
func WithBsTransactionId ¶
func WithBsTransactionId(transactionId int64) BranchSessionOption
func WithBsXid ¶
func WithBsXid(xid string) BranchSessionOption
type BranchSessionSlice ¶
type BranchSessionSlice []*BranchSession
func (BranchSessionSlice) Len ¶
func (p BranchSessionSlice) Len() int
func (BranchSessionSlice) Less ¶
func (p BranchSessionSlice) Less(i, j int) bool
func (BranchSessionSlice) Swap ¶
func (p BranchSessionSlice) Swap(i, j int)
type GlobalSession ¶
type GlobalSession struct { sync.Mutex Xid string TransactionId int64 Status meta.GlobalStatus ApplicationId string TransactionServiceGroup string TransactionName string Timeout int32 BeginTime int64 ApplicationData []byte Active bool BranchSessions map[*BranchSession]bool }
func NewGlobalSession ¶
func NewGlobalSession(opts ...GlobalSessionOption) *GlobalSession
func (*GlobalSession) Add ¶
func (gs *GlobalSession) Add(branchSession *BranchSession)
func (*GlobalSession) Begin ¶
func (gs *GlobalSession) Begin()
func (*GlobalSession) CanBeCommittedAsync ¶
func (gs *GlobalSession) CanBeCommittedAsync() bool
func (*GlobalSession) Decode ¶
func (gs *GlobalSession) Decode(b []byte)
func (*GlobalSession) Encode ¶
func (gs *GlobalSession) Encode() ([]byte, error)
func (*GlobalSession) GetBranch ¶
func (gs *GlobalSession) GetBranch(branchId int64) *BranchSession
func (*GlobalSession) GetReverseSortedBranches ¶
func (gs *GlobalSession) GetReverseSortedBranches() []*BranchSession
func (*GlobalSession) GetSortedBranches ¶
func (gs *GlobalSession) GetSortedBranches() []*BranchSession
func (*GlobalSession) HasBranch ¶
func (gs *GlobalSession) HasBranch() bool
func (*GlobalSession) IsRollbackingDead ¶
func (gs *GlobalSession) IsRollbackingDead() bool
func (*GlobalSession) IsSaga ¶
func (gs *GlobalSession) IsSaga() bool
func (*GlobalSession) IsTimeout ¶
func (gs *GlobalSession) IsTimeout() bool
func (*GlobalSession) Remove ¶
func (gs *GlobalSession) Remove(branchSession *BranchSession)
type GlobalSessionOption ¶
type GlobalSessionOption func(session *GlobalSession)
func WithGsActive ¶
func WithGsActive(active bool) GlobalSessionOption
func WithGsApplicationData ¶
func WithGsApplicationData(applicationData []byte) GlobalSessionOption
func WithGsApplicationId ¶
func WithGsApplicationId(applicationId string) GlobalSessionOption
func WithGsBeginTime ¶
func WithGsBeginTime(beginTime int64) GlobalSessionOption
func WithGsStatus ¶
func WithGsStatus(status meta.GlobalStatus) GlobalSessionOption
func WithGsTimeout ¶
func WithGsTimeout(timeout int32) GlobalSessionOption
func WithGsTransactionId ¶
func WithGsTransactionId(transactionId int64) GlobalSessionOption
func WithGsTransactionName ¶
func WithGsTransactionName(transactionName string) GlobalSessionOption
func WithGsTransactionServiceGroup ¶
func WithGsTransactionServiceGroup(transactionServiceGroup string) GlobalSessionOption
func WithGsXid ¶
func WithGsXid(xid string) GlobalSessionOption
type SessionStorable ¶
Click to show internal directories.
Click to hide internal directories.