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

global_transaction.go 1.0 kB

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package api
  2. import (
  3. "github.com/seata/seata-go/pkg/model"
  4. )
  5. type GlobalTransactionRole int8
  6. const (
  7. LAUNCHER GlobalTransactionRole = 0
  8. PARTICIPANT GlobalTransactionRole = 1
  9. )
  10. type GlobalTransaction interface {
  11. // Begin a new global transaction with given timeout and given name.
  12. begin(timeout int64, name string) error
  13. // Commit the global transaction.
  14. commit() error
  15. // Rollback the global transaction.
  16. rollback() error
  17. // Suspend the global transaction.
  18. suspend() (SuspendedResourcesHolder, error)
  19. // Resume the global transaction.
  20. resume(suspendedResourcesHolder SuspendedResourcesHolder) error
  21. // Ask TC for current status of the corresponding global transaction.
  22. getStatus() (model.GlobalStatus, error)
  23. // Get XID.
  24. getXid() string
  25. // report the global transaction status.
  26. globalReport(globalStatus model.GlobalStatus) error
  27. // local status of the global transaction.
  28. getLocalStatus() model.GlobalStatus
  29. // get global transaction role.
  30. getGlobalTransactionRole() GlobalTransactionRole
  31. }

Go Implementation For Seata