Documentation ¶
Index ¶
- Constants
- type MysqlXAConn
- func (c *MysqlXAConn) Commit(ctx context.Context, xid string, onePhase bool) error
- func (c *MysqlXAConn) End(ctx context.Context, xid string, flags int) error
- func (c *MysqlXAConn) Forget(ctx context.Context, xid string) error
- func (c *MysqlXAConn) GetTransactionTimeout() time.Duration
- func (c *MysqlXAConn) IsSameRM(ctx context.Context, xares XAResource) bool
- func (c *MysqlXAConn) Recover(ctx context.Context, flag int) (xids []string, err error)
- func (c *MysqlXAConn) Rollback(ctx context.Context, xid string) error
- func (c *MysqlXAConn) SetTransactionTimeout(duration time.Duration) bool
- func (c *MysqlXAConn) Start(ctx context.Context, xid string, flags int) error
- func (c *MysqlXAConn) XAPrepare(ctx context.Context, xid string) error
- type OracleXAConn
- func (c *OracleXAConn) Commit(xid string, onePhase bool) error
- func (c *OracleXAConn) End(xid string, flags int) error
- func (c *OracleXAConn) Forget(xid string) error
- func (c *OracleXAConn) GetTransactionTimeout() time.Duration
- func (c *OracleXAConn) IsSameRM(resource XAResource) bool
- func (c *OracleXAConn) Recover(flag int) []string
- func (c *OracleXAConn) Rollback(xid string) error
- func (c *OracleXAConn) SetTransactionTimeout(duration time.Duration) bool
- func (c *OracleXAConn) Start(xid string, flags int) error
- func (c *OracleXAConn) XAPrepare(xid string) (int, error)
- type XAResource
Constants ¶
View Source
const ( // TMEndRScan ends a recovery scan. TMEndRScan = 0x00800000 // TMFail disassociates the caller and marks the transaction branch // rollback-only. TMFail = 0x20000000 // TMJoin joining existing transaction branch. TMJoin = 0x00200000 // TMNoFlags indicate no flags value is selected. TMNoFlags = 0x00000000 // TMOnePhase using one-phase optimization. TMOnePhase = 0x40000000 // TMResume is resuming association with a suspended transaction branch. TMResume = 0x08000000 // TMStartRScan starts a recovery scan. TMStartRScan = 0x01000000 // TMSuccess disassociates caller from a transaction branch. TMSuccess = 0x04000000 // TMSuspend is suspending (not ending) its association with a transaction branch. TMSuspend = 0x02000000 // XAReadOnly the transaction branch has been read-only and has been committed. XAReadOnly = 0x00000003 // XAOk The transaction work has been prepared normally. XAOk = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MysqlXAConn ¶ added in v1.2.0
func NewMysqlXaConn ¶ added in v1.2.0
func NewMysqlXaConn(conn driver.Conn) *MysqlXAConn
func (*MysqlXAConn) Forget ¶ added in v1.2.0
func (c *MysqlXAConn) Forget(ctx context.Context, xid string) error
func (*MysqlXAConn) GetTransactionTimeout ¶ added in v1.2.0
func (c *MysqlXAConn) GetTransactionTimeout() time.Duration
func (*MysqlXAConn) IsSameRM ¶ added in v1.2.0
func (c *MysqlXAConn) IsSameRM(ctx context.Context, xares XAResource) bool
IsSameRM is called to determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares.
func (*MysqlXAConn) Recover ¶ added in v1.2.0
Recover Obtains a list of prepared transaction branches from a resource manager. The transaction manager calls this method during recovery to obtain the list of transaction branches that are currently in prepared or heuristically completed states.
func (*MysqlXAConn) Rollback ¶ added in v1.2.0
func (c *MysqlXAConn) Rollback(ctx context.Context, xid string) error
func (*MysqlXAConn) SetTransactionTimeout ¶ added in v1.2.0
func (c *MysqlXAConn) SetTransactionTimeout(duration time.Duration) bool
type OracleXAConn ¶ added in v1.2.0
func (*OracleXAConn) Commit ¶ added in v1.2.0
func (c *OracleXAConn) Commit(xid string, onePhase bool) error
func (*OracleXAConn) Forget ¶ added in v1.2.0
func (c *OracleXAConn) Forget(xid string) error
func (*OracleXAConn) GetTransactionTimeout ¶ added in v1.2.0
func (c *OracleXAConn) GetTransactionTimeout() time.Duration
func (*OracleXAConn) IsSameRM ¶ added in v1.2.0
func (c *OracleXAConn) IsSameRM(resource XAResource) bool
func (*OracleXAConn) Recover ¶ added in v1.2.0
func (c *OracleXAConn) Recover(flag int) []string
func (*OracleXAConn) Rollback ¶ added in v1.2.0
func (c *OracleXAConn) Rollback(xid string) error
func (*OracleXAConn) SetTransactionTimeout ¶ added in v1.2.0
func (c *OracleXAConn) SetTransactionTimeout(duration time.Duration) bool
type XAResource ¶ added in v1.2.0
type XAResource interface { Commit(ctx context.Context, xid string, onePhase bool) error End(ctx context.Context, xid string, flags int) error Forget(ctx context.Context, xid string) error GetTransactionTimeout() time.Duration IsSameRM(ctx context.Context, resource XAResource) bool XAPrepare(ctx context.Context, xid string) error Recover(ctx context.Context, flag int) ([]string, error) Rollback(ctx context.Context, xid string) error SetTransactionTimeout(duration time.Duration) bool Start(ctx context.Context, xid string, flags int) error }
func CreateXAResource ¶ added in v1.2.0
CreateXAResource create a connection for xa with the different db type. Such as mysql, oracle, MARIADB, POSTGRESQL
Click to show internal directories.
Click to hide internal directories.