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.