forked from apache/incubator-seata-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global_transaction_event.go
43 lines (33 loc) · 1.03 KB
/
global_transaction_event.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package event
import (
"github.com/carlzhao/seata-golang/v2/pkg/apis"
)
const (
RoleTC = "tc"
RoleTM = "client"
RoleRM = "rm"
)
type GlobalTransactionEvent struct {
id int64
role string
name string
beginTime int64
endTime int64
status apis.GlobalSession_GlobalStatus
}
func NewGlobalTransactionEvent(id int64, role string, name string, beginTime int64, endTime int64, status apis.GlobalSession_GlobalStatus) GlobalTransactionEvent {
return GlobalTransactionEvent{
id,
role,
name,
beginTime,
endTime,
status,
}
}
func (event GlobalTransactionEvent) GetID() int64 { return event.id }
func (event GlobalTransactionEvent) GetRole() string { return event.role }
func (event GlobalTransactionEvent) GetName() string { return event.name }
func (event GlobalTransactionEvent) GetBeginTime() int64 { return event.beginTime }
func (event GlobalTransactionEvent) GetEndTime() int64 { return event.endTime }
func (event GlobalTransactionEvent) GetStatus() apis.GlobalSession_GlobalStatus { return event.status }