forked from dtm-labs/dtm
/
consts.go
65 lines (57 loc) · 1.79 KB
/
consts.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (c) 2021 yedf. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
package dtmimp
const (
// ResultFailure for result of a trans/trans branch
// Same as HTTP status 409 and GRPC code 10
ResultFailure = "FAILURE"
// ResultSuccess for result of a trans/trans branch
// Same as HTTP status 200 and GRPC code 0
ResultSuccess = "SUCCESS"
// ResultOngoing for result of a trans/trans branch
// Same as HTTP status 425 and GRPC code 9
ResultOngoing = "ONGOING"
// OpTry branch type for TCC
OpTry = "try"
// OpConfirm branch type for TCC
OpConfirm = "confirm"
// OpCancel branch type for TCC
OpCancel = "cancel"
// OpAction branch type for message, SAGA, XA
OpAction = "action"
// OpCompensate branch type for SAGA
OpCompensate = "compensate"
// OpCommit branch type for XA
OpCommit = "commit"
// OpRollback branch type for XA
OpRollback = "rollback"
// DBTypeMysql const for driver mysql
DBTypeMysql = "mysql"
// DBTypePostgres const for driver postgres
DBTypePostgres = "postgres"
// DBTypeRedis const for driver redis
DBTypeRedis = "redis"
// Jrpc const for json-rpc
Jrpc = "json-rpc"
// JrpcCodeFailure const for json-rpc failure
JrpcCodeFailure = -32901
// JrpcCodeOngoing const for json-rpc ongoing
JrpcCodeOngoing = -32902
// MsgDoBranch0 const for DoAndSubmit barrier branch
MsgDoBranch0 = "00"
// MsgDoBarrier1 const for DoAndSubmit barrier barrierID
MsgDoBarrier1 = "01"
// MsgDoOp const for DoAndSubmit barrier op
MsgDoOp = "msg"
//MsgTopicPrefix const for Add topic msg
MsgTopicPrefix = "topic://"
// XaBarrier1 const for xa barrier id
XaBarrier1 = "01"
// ProtocolGRPC const for protocol grpc
ProtocolGRPC = "grpc"
// ProtocolHTTP const for protocol http
ProtocolHTTP = "http"
)