Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTransactionHandler ¶
func RegisterTransactionHandler(key string, handleFunc TransactionHandler)
Types ¶
type Model ¶
type Model struct {
sqlc.CachedConn
}
func (*Model) Transactions ¶
func (m *Model) Transactions(inserters []TableTransactionFunc) error
Transaction 事务方式插入多个表的数据
type TableTransactionFunc ¶
type TransactionHandler ¶
type TransactionHandler interface { InsertTransactions(ctx context.Context, session sqlx.Session, info string) error DeleteTransactions(ctx context.Context, session sqlx.Session, info string) error }
func GetTransactionHandler ¶
func GetTransactionHandler(key string) TransactionHandler
type TransactionManager ¶
type TransactionManager struct {
TransactionHandlers map[string]TransactionHandler
}
Click to show internal directories.
Click to hide internal directories.