Documentation ¶
Index ¶
- Variables
- type Coordinator
- func (c *Coordinator) Begin(ctx context.Context) (string, error)
- func (c *Coordinator) Close(ctx context.Context) error
- func (c *Coordinator) Commit(ctx context.Context, global *entity.Global) error
- func (c *Coordinator) GetBranchList(ctx context.Context, gid string) (list []*entity.Branch, err error)
- func (c *Coordinator) GetGlobal(ctx context.Context, gid string) (entity.Global, error)
- func (c *Coordinator) Phase1(ctx context.Context, global *entity.Global) (err error)
- func (c *Coordinator) Phase2(ctx context.Context, global *entity.Global) (err error)
- func (c *Coordinator) Register(ctx context.Context, branches entity.BranchList) error
- func (c *Coordinator) Rollback(ctx context.Context, global *entity.Global) error
- func (c *Coordinator) Start(ctx context.Context, global *entity.Global) error
- func (c *Coordinator) UpdateGlobalState(ctx context.Context, gid string, state consts.GlobalState) error
- type Executor
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrAutomatic = fmt.Errorf("transaction phase2 has been processed automatically")
)
Functions ¶
This section is empty.
Types ¶
type Coordinator ¶
type Coordinator struct {
// contains filtered or unexported fields
}
func NewCoordinator ¶
func NewCoordinator(dao dao.TransactionDao, execute Executor, automaticExecution2 bool) *Coordinator
func (*Coordinator) GetBranchList ¶
func (*Coordinator) Register ¶
func (c *Coordinator) Register(ctx context.Context, branches entity.BranchList) error
func (*Coordinator) UpdateGlobalState ¶
func (c *Coordinator) UpdateGlobalState(ctx context.Context, gid string, state consts.GlobalState) error
Click to show internal directories.
Click to hide internal directories.