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.

response_message.go 3.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. import (
  19. model2 "github.com/seata/seata-go/pkg/protocol/branch"
  20. "github.com/seata/seata-go/pkg/util/errors"
  21. )
  22. type AbstractTransactionResponse struct {
  23. AbstractResultMessage
  24. TransactionErrorCode errors.TransactionErrorCode
  25. }
  26. type AbstractBranchEndResponse struct {
  27. AbstractTransactionResponse
  28. Xid string
  29. BranchId int64
  30. BranchStatus model2.BranchStatus
  31. }
  32. type AbstractGlobalEndResponse struct {
  33. AbstractTransactionResponse
  34. GlobalStatus GlobalStatus
  35. }
  36. type BranchRegisterResponse struct {
  37. AbstractTransactionResponse
  38. BranchId int64
  39. }
  40. func (resp BranchRegisterResponse) GetTypeCode() MessageType {
  41. return MessageTypeBranchRegisterResult
  42. }
  43. type RegisterTMResponse struct {
  44. AbstractIdentifyResponse
  45. }
  46. func (resp RegisterTMResponse) GetTypeCode() MessageType {
  47. return MessageTypeRegCltResult
  48. }
  49. type BranchReportResponse struct {
  50. AbstractTransactionResponse
  51. }
  52. func (resp BranchReportResponse) GetTypeCode() MessageType {
  53. return MessageTypeBranchStatusReportResult
  54. }
  55. type BranchCommitResponse struct {
  56. AbstractBranchEndResponse
  57. }
  58. func (resp BranchCommitResponse) GetTypeCode() MessageType {
  59. return MessageTypeBranchCommitResult
  60. }
  61. type BranchRollbackResponse struct {
  62. AbstractBranchEndResponse
  63. }
  64. func (resp BranchRollbackResponse) GetTypeCode() MessageType {
  65. return MessageTypeBranchRollbackResult
  66. }
  67. type GlobalBeginResponse struct {
  68. AbstractTransactionResponse
  69. Xid string
  70. ExtraData []byte
  71. }
  72. func (resp GlobalBeginResponse) GetTypeCode() MessageType {
  73. return MessageTypeGlobalBeginResult
  74. }
  75. type GlobalStatusResponse struct {
  76. AbstractGlobalEndResponse
  77. }
  78. func (resp GlobalStatusResponse) GetTypeCode() MessageType {
  79. return MessageTypeGlobalStatusResult
  80. }
  81. type GlobalLockQueryResponse struct {
  82. AbstractTransactionResponse
  83. Lockable bool
  84. }
  85. func (resp GlobalLockQueryResponse) GetTypeCode() MessageType {
  86. return MessageTypeGlobalLockQueryResult
  87. }
  88. type GlobalReportResponse struct {
  89. AbstractGlobalEndResponse
  90. }
  91. func (resp GlobalReportResponse) GetTypeCode() MessageType {
  92. return MessageTypeGlobalReportResult
  93. }
  94. type GlobalCommitResponse struct {
  95. AbstractGlobalEndResponse
  96. }
  97. func (resp GlobalCommitResponse) GetTypeCode() MessageType {
  98. return MessageTypeGlobalCommitResult
  99. }
  100. type GlobalRollbackResponse struct {
  101. AbstractGlobalEndResponse
  102. }
  103. func (resp GlobalRollbackResponse) GetTypeCode() MessageType {
  104. return MessageTypeGlobalRollbackResult
  105. }
  106. type RegisterRMResponse struct {
  107. AbstractIdentifyResponse
  108. }
  109. func (resp RegisterRMResponse) GetTypeCode() MessageType {
  110. return MessageTypeRegRmResult
  111. }