m_trans.go 320 B

12345678910111213
  1. package model
  2. import "context"
  3. // ITrans 事务管理接口
  4. type ITrans interface {
  5. // Begin 开始事务
  6. Begin(ctx context.Context) (interface{}, error)
  7. // Commit 提交事务
  8. Commit(ctx context.Context, trans interface{}) error
  9. // Rollback 回滚事务
  10. Rollback(ctx context.Context, trans interface{}) error
  11. }