Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace the underline naming in the code with the hump naming method #235

Merged
merged 21 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ac6e8a9
add dubbo transtation filter test (#204)
jasondeng1997 Aug 14, 2022
55b69a6
add dubbo transtation filter test (#204)
jasondeng1997 Aug 14, 2022
4f18c38
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
3220555
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
105d606
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
6c289d9
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
49764e5
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
c5d46b9
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
1c7fbba
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
e4600a8
add dubbo transtation filter test (#204)
jasondeng1997 Aug 15, 2022
b020c56
Merge branch 'seata:master' into master
jasondeng1997 Aug 18, 2022
1961872
Merge branch 'seata:master' into master
jasondeng1997 Aug 18, 2022
02259b5
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
7563b71
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
e201742
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
4693fb5
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
31a7a9a
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
2b55500
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 19, 2022
844daed
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 20, 2022
019f260
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 20, 2022
c490791
Merge remote-tracking branch 'origin/master'
jasondeng1997 Aug 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_commit_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ func (g *BranchCommitRequestCodec) Encode(in interface{}) []byte {
}

func (g *BranchCommitRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchCommit
return message.MessageTypeBranchCommit
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_commit_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ func (g *BranchCommitResponseCodec) Encode(in interface{}) []byte {
}

func (g *BranchCommitResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchCommitResult
return message.MessageTypeBranchCommitResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_register_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ func (c *BranchRegisterRequestCodec) Encode(in interface{}) []byte {
}

func (g *BranchRegisterRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchRegister
return message.MessageTypeBranchRegister
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_register_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ func (c *BranchRegisterResponseCodec) Encode(in interface{}) []byte {
}

func (g *BranchRegisterResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchRegisterResult
return message.MessageTypeBranchRegisterResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_rollback_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ func (g *BranchRollbackRequestCodec) Encode(in interface{}) []byte {
}

func (g *BranchRollbackRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchRollback
return message.MessageTypeBranchRollback
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/branch_rollback_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ func (g *BranchRollbackResponseCodec) Encode(in interface{}) []byte {
}

func (g *BranchRollbackResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_BranchRollbackResult
return message.MessageTypeBranchRollbackResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_begin_request_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ func (g *GlobalBeginRequestCodec) Decode(in []byte) interface{} {
}

func (g *GlobalBeginRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalBegin
return message.MessageTypeGlobalBegin
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_begin_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ func (g *GlobalBeginResponseCodec) Decode(in []byte) interface{} {
}

func (g *GlobalBeginResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalBeginResult
return message.MessageTypeGlobalBeginResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_commit_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalCommitRequestCodec) Encode(in interface{}) []byte {
}

func (g *GlobalCommitRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalCommit
return message.MessageTypeGlobalCommit
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_commit_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalCommitResponseCodec) Encode(in interface{}) []byte {
}

func (g *GlobalCommitResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalCommitResult
return message.MessageTypeGlobalCommitResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_report_request_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ func (g *GlobalReportRequestCodec) Encode(in interface{}) []byte {

// GetMessageType get global report request's message type
func (g *GlobalReportRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalReportResult
return message.MessageTypeGlobalReportResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_report_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalReportResponseCodec) Encode(in interface{}) []byte {
}

func (g *GlobalReportResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalReportResult
return message.MessageTypeGlobalReportResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_rollback_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalRollbackRequestCodec) Encode(in interface{}) []byte {
}

func (g *GlobalRollbackRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalRollback
return message.MessageTypeGlobalRollback
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_rollback_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalRollbackResponseCodec) Encode(in interface{}) []byte {
}

func (g *GlobalRollbackResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalRollbackResult
return message.MessageTypeGlobalRollbackResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_status_req_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalStatusRequestCodec) Encode(in interface{}) []byte {
}

func (g *GlobalStatusRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalStatus
return message.MessageTypeGlobalStatus
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/global_status_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (g *GlobalStatusResponseCodec) Encode(in interface{}) []byte {
}

func (g *GlobalStatusResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_GlobalStatusResult
return message.MessageTypeGlobalStatusResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/register_rm_request_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ func (c *RegisterRMRequestCodec) Encode(in interface{}) []byte {
}

func (g *RegisterRMRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_RegRm
return message.MessageTypeRegRm
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/register_rm_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (c *RegisterRMResponseCodec) Encode(in interface{}) []byte {
}

func (g *RegisterRMResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_RegRmResult
return message.MessageTypeRegRmResult
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/register_tm_request_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (c *RegisterTMRequestCodec) Encode(in interface{}) []byte {
}

func (g *RegisterTMRequestCodec) GetMessageType() message.MessageType {
return message.MessageType_RegClt
return message.MessageTypeRegClt
}
2 changes: 1 addition & 1 deletion pkg/protocol/codec/register_tm_response_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func (c *RegisterTMResponseCodec) Encode(in interface{}) []byte {
}

func (g *RegisterTMResponseCodec) GetMessageType() message.MessageType {
return message.MessageType_RegCltResult
return message.MessageTypeRegCltResult
}
130 changes: 66 additions & 64 deletions pkg/protocol/message/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package message

var MAGIC_CODE_BYTES = [2]byte{0xda, 0xda}
var MagicCodeBytes = [2]byte{0xda, 0xda}

type (
MessageType int
Expand All @@ -27,125 +27,127 @@ type (

const (
/**
* The constant TYPE_GLOBAL_BEGIN.
* The constant TypeGlobalBegin.
*/
MessageType_GlobalBegin MessageType = 1
MessageTypeGlobalBegin MessageType = 1
/**
* The constant TYPE_GLOBAL_BEGIN_RESULT.
* The constant TypeGlobalBeginResult.
*/
MessageType_GlobalBeginResult MessageType = 2
MessageTypeGlobalBeginResult MessageType = 2
/**
* The constant TYPE_GLOBAL_COMMIT.
* The constant TypeGlobalCommit.
*/
MessageType_GlobalCommit MessageType = 7
MessageTypeGlobalCommit MessageType = 7
/**
* The constant TYPE_GLOBAL_COMMIT_RESULT.
* The constant TypeGlobalCommitResult.
*/
MessageType_GlobalCommitResult MessageType = 8
MessageTypeGlobalCommitResult MessageType = 8
/**
* The constant TYPE_GLOBAL_ROLLBACK.
* The constant TypeGlobalRollback.
*/
MessageType_GlobalRollback MessageType = 9
MessageTypeGlobalRollback MessageType = 9
/**
* The constant TYPE_GLOBAL_ROLLBACK_RESULT.
* The constant TypeGlobalRollbackResult.
*/
MessageType_GlobalRollbackResult MessageType = 10
MessageTypeGlobalRollbackResult MessageType = 10
/**
* The constant TYPE_GLOBAL_STATUS.
* The constant TypeGlobalStatus.
*/
MessageType_GlobalStatus MessageType = 15
MessageTypeGlobalStatus MessageType = 15
/**
* The constant TYPE_GLOBAL_STATUS_RESULT.
* The constant TypeGlobalStatusResult.
*/
MessageType_GlobalStatusResult MessageType = 16
MessageTypeGlobalStatusResult MessageType = 16
/**
* The constant TYPE_GLOBAL_REPORT.
* The constant TypeGlobalReport.
*/
MessageType_GlobalReport MessageType = 17
MessageTypeGlobalReport MessageType = 17
/**
* The constant TYPE_GLOBAL_REPORT_RESULT.
* The constant TypeGlobalReportResult.
*/
MessageType_GlobalReportResult MessageType = 18
MessageTypeGlobalReportResult MessageType = 18
/**
* The constant TYPE_GLOBAL_LOCK_QUERY.
* The constant TypeGlobalLockQuery.
*/
MessageType_GlobalLockQuery MessageType = 21
MessageTypeGlobalLockQuery MessageType = 21
/**
* The constant TYPE_GLOBAL_LOCK_QUERY_RESULT.
* The constant TypeGlobalLockQueryResult.
*/
MessageType_GlobalLockQueryResult MessageType = 22
MessageTypeGlobalLockQueryResult MessageType = 22

/**
* The constant TYPE_BRANCH_COMMIT.
* The constant TypeBranchCommit.
*/
MessageType_BranchCommit MessageType = 3
MessageTypeBranchCommit MessageType = 3
/**
* The constant TYPE_BRANCH_COMMIT_RESULT.
* The constant TypeBranchCommitResult.
*/
MessageType_BranchCommitResult MessageType = 4
MessageTypeBranchCommitResult MessageType = 4
/**
* The constant TYPE_BRANCH_ROLLBACK.
* The constant TypeBranchRollback.
*/
MessageType_BranchRollback MessageType = 5
MessageTypeBranchRollback MessageType = 5
/**
* The constant TYPE_BRANCH_ROLLBACK_RESULT.
* The constant TypeBranchRollbackResult.
*/
MessageType_BranchRollbackResult MessageType = 6
MessageTypeBranchRollbackResult MessageType = 6
/**
* The constant TYPE_BRANCH_REGISTER.
* The constant TypeBranchRegister.
*/
MessageType_BranchRegister MessageType = 11
MessageTypeBranchRegister MessageType = 11
/**
* The constant TYPE_BRANCH_REGISTER_RESULT.
* The constant TypeBranchRegisterResult.
*/
MessageType_BranchRegisterResult MessageType = 12
MessageTypeBranchRegisterResult MessageType = 12
/**
* The constant TYPE_BRANCH_STATUS_REPORT.
* The constant TypeBranchStatusReport.
*/
MessageType_BranchStatusReport MessageType = 13
MessageTypeBranchStatusReport MessageType = 13
/**
* The constant TYPE_BRANCH_STATUS_REPORT_RESULT.
* The constant TypeBranchStatusReportResult.
*/
MessageType_BranchStatusReportResult MessageType = 14
MessageTypeBranchStatusReportResult MessageType = 14

/**
* The constant TYPE_SEATA_MERGE.
* The constant TypeSeataMerge.
*/
MessageType_SeataMerge MessageType = 59
MessageTypeSeataMerge MessageType = 59
/**
* The constant TYPE_SEATA_MERGE_RESULT.
* The constant TypeSeataMergeResult.
*/
MessageType_SeataMergeResult MessageType = 60
MessageTypeSeataMergeResult MessageType = 60

/**
* The constant TYPE_REG_CLT.
* The constant TypeRegClt.
*/
MessageType_RegClt MessageType = 101
MessageTypeRegClt MessageType = 101
/**
* The constant TYPE_REG_CLT_RESULT.
* The constant TypeRegCltResult.
*/
MessageType_RegCltResult MessageType = 102
MessageTypeRegCltResult MessageType = 102
/**
* The constant TYPE_REG_RM.
* The constant TypeRegRm.
*/
MessageType_RegRm MessageType = 103
MessageTypeRegRm MessageType = 103
/**
* The constant TYPE_REG_RM_RESULT.
* The constant TypeRegRmResult.
*/
MessageType_RegRmResult MessageType = 104

MessageTypeRegRmResult MessageType = 104
/**
* The constant TYPE_RM_DELETE_UNDOLOG.
* The constant TypeRmDeleteUndolog.
*/
MessageType_RmDeleteUndolog MessageType = 111
MessageTypeRmDeleteUndolog MessageType = 111
/**
* the constant TYPE_HEARTBEAT_MSG
* the constant TypeHeartbeatMsg
*/
MessageType_HeartbeatMsg MessageType = 120
MessageTypeHeartbeatMsg MessageType = 120

/**
* the constant MessageType_BatchResultMsg
* the constant MessageTypeBatchResultMsg
*/
MessageType_BatchResultMsg MessageType = 121

MessageTypeBatchResultMsg MessageType = 121
)

const (
Expand All @@ -158,19 +160,19 @@ const (
V1HeadLength = 16

// Request message type
GettyRequestType_RequestSync GettyRequestType = 0
GettyRequestTypeRequestSync GettyRequestType = 0

// Response message type
GettyRequestType_Response GettyRequestType = 1
GettyRequestTypeResponse GettyRequestType = 1

// Request which no need response
GettyRequestType_RequestOneway GettyRequestType = 2
GettyRequestTypeRequestOneway GettyRequestType = 2

// Heartbeat Request
GettyRequestType_HeartbeatRequest GettyRequestType = 3
GettyRequestTypeHeartbeatRequest GettyRequestType = 3

// Heartbeat Response
GettyRequestType_HeartbeatResponse GettyRequestType = 4
GettyRequestTypeHeartbeatResponse GettyRequestType = 4
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/protocol/message/message_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ type MergedWarpMessage struct {
}

func (req MergedWarpMessage) GetTypeCode() MessageType {
return MessageType_SeataMerge
return MessageTypeSeataMerge
}

type MergeResultMessage struct {
Msgs []MessageTypeAware
}

func (resp MergeResultMessage) GetTypeCode() MessageType {
return MessageType_SeataMergeResult
return MessageTypeSeataMergeResult
}

type ResultCode byte
Expand Down
4 changes: 2 additions & 2 deletions pkg/protocol/message/message_apis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
)

func TestMergedWarpMessage_GetTypeCode(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit test function name can not change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没改,挪了一下位置

assert.Equal(t, MessageType_SeataMerge, MergedWarpMessage{}.GetTypeCode())
assert.Equal(t, MessageTypeSeataMerge, MergedWarpMessage{}.GetTypeCode())
}

func TestMergedResultMessage_GetTYpeCode(t *testing.T) {
assert.Equal(t, MessageType_SeataMergeResult, MergeResultMessage{}.GetTypeCode())
assert.Equal(t, MessageTypeSeataMergeResult, MergeResultMessage{}.GetTypeCode())
}
2 changes: 1 addition & 1 deletion pkg/protocol/message/other_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ func (msg HeartBeatMessage) ToString() string {
}

func (resp HeartBeatMessage) GetTypeCode() MessageType {
return MessageType_HeartbeatMsg
return MessageTypeHeartbeatMsg
}
Loading