You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
456 B

3 years ago
  1. package container
  2. import "github.com/go-xorm/xorm"
  3. // 事务句柄
  4. type TransactionHandler interface {
  5. // 关闭会话
  6. Close()
  7. // 开启事务
  8. // 返回值
  9. // 1.错误
  10. Begin() error
  11. // 提交事务
  12. // 返回值
  13. // 1.错误
  14. Commit() error
  15. // xorm.Session
  16. // 返回值
  17. // 1.xorm.Session
  18. Session() *xorm.Session
  19. }
  20. func NewTransactionHandler(session *xorm.Session) (TransactionHandler, error) {
  21. return NewDefaultTransactionHandler(session)
  22. }