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.

constant.go 4.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package message
  18. var MAGIC_CODE_BYTES = [2]byte{0xda, 0xda}
  19. type (
  20. MessageType int
  21. GettyRequestType byte
  22. )
  23. const (
  24. /**
  25. * The constant TYPE_GLOBAL_BEGIN.
  26. */
  27. MessageType_GlobalBegin MessageType = 1
  28. /**
  29. * The constant TYPE_GLOBAL_BEGIN_RESULT.
  30. */
  31. MessageType_GlobalBeginResult MessageType = 2
  32. /**
  33. * The constant TYPE_GLOBAL_COMMIT.
  34. */
  35. MessageType_GlobalCommit MessageType = 7
  36. /**
  37. * The constant TYPE_GLOBAL_COMMIT_RESULT.
  38. */
  39. MessageType_GlobalCommitResult MessageType = 8
  40. /**
  41. * The constant TYPE_GLOBAL_ROLLBACK.
  42. */
  43. MessageType_GlobalRollback MessageType = 9
  44. /**
  45. * The constant TYPE_GLOBAL_ROLLBACK_RESULT.
  46. */
  47. MessageType_GlobalRollbackResult MessageType = 10
  48. /**
  49. * The constant TYPE_GLOBAL_STATUS.
  50. */
  51. MessageType_GlobalStatus MessageType = 15
  52. /**
  53. * The constant TYPE_GLOBAL_STATUS_RESULT.
  54. */
  55. MessageType_GlobalStatusResult MessageType = 16
  56. /**
  57. * The constant TYPE_GLOBAL_REPORT.
  58. */
  59. MessageType_GlobalReport MessageType = 17
  60. /**
  61. * The constant TYPE_GLOBAL_REPORT_RESULT.
  62. */
  63. MessageType_GlobalReportResult MessageType = 18
  64. /**
  65. * The constant TYPE_GLOBAL_LOCK_QUERY.
  66. */
  67. MessageType_GlobalLockQuery MessageType = 21
  68. /**
  69. * The constant TYPE_GLOBAL_LOCK_QUERY_RESULT.
  70. */
  71. MessageType_GlobalLockQueryResult MessageType = 22
  72. /**
  73. * The constant TYPE_BRANCH_COMMIT.
  74. */
  75. MessageType_BranchCommit MessageType = 3
  76. /**
  77. * The constant TYPE_BRANCH_COMMIT_RESULT.
  78. */
  79. MessageType_BranchCommitResult MessageType = 4
  80. /**
  81. * The constant TYPE_BRANCH_ROLLBACK.
  82. */
  83. MessageType_BranchRollback MessageType = 5
  84. /**
  85. * The constant TYPE_BRANCH_ROLLBACK_RESULT.
  86. */
  87. MessageType_BranchRollbackResult MessageType = 6
  88. /**
  89. * The constant TYPE_BRANCH_REGISTER.
  90. */
  91. MessageType_BranchRegister MessageType = 11
  92. /**
  93. * The constant TYPE_BRANCH_REGISTER_RESULT.
  94. */
  95. MessageType_BranchRegisterResult MessageType = 12
  96. /**
  97. * The constant TYPE_BRANCH_STATUS_REPORT.
  98. */
  99. MessageType_BranchStatusReport MessageType = 13
  100. /**
  101. * The constant TYPE_BRANCH_STATUS_REPORT_RESULT.
  102. */
  103. MessageType_BranchStatusReportResult MessageType = 14
  104. /**
  105. * The constant TYPE_SEATA_MERGE.
  106. */
  107. MessageType_SeataMerge MessageType = 59
  108. /**
  109. * The constant TYPE_SEATA_MERGE_RESULT.
  110. */
  111. MessageType_SeataMergeResult MessageType = 60
  112. /**
  113. * The constant TYPE_REG_CLT.
  114. */
  115. MessageType_RegClt MessageType = 101
  116. /**
  117. * The constant TYPE_REG_CLT_RESULT.
  118. */
  119. MessageType_RegCltResult MessageType = 102
  120. /**
  121. * The constant TYPE_REG_RM.
  122. */
  123. MessageType_RegRm MessageType = 103
  124. /**
  125. * The constant TYPE_REG_RM_RESULT.
  126. */
  127. MessageType_RegRmResult MessageType = 104
  128. /**
  129. * The constant TYPE_RM_DELETE_UNDOLOG.
  130. */
  131. MessageType_RmDeleteUndolog MessageType = 111
  132. /**
  133. * the constant TYPE_HEARTBEAT_MSG
  134. */
  135. MessageType_HeartbeatMsg MessageType = 120
  136. )
  137. const (
  138. VERSION = 1
  139. // MaxFrameLength max frame length
  140. MaxFrameLength = 8 * 1024 * 1024
  141. // V1HeadLength v1 head length
  142. V1HeadLength = 16
  143. // Request message type
  144. GettyRequestType_RequestSync GettyRequestType = 0
  145. // Response message type
  146. GettyRequestType_Response GettyRequestType = 1
  147. // Request which no need response
  148. GettyRequestType_RequestOneway GettyRequestType = 2
  149. // Heartbeat Request
  150. GettyRequestType_HeartbeatRequest GettyRequestType = 3
  151. // Heartbeat Response
  152. GettyRequestType_HeartbeatResponse GettyRequestType = 4
  153. )

Go Implementation For Seata