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.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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/protocol/transaction"
  21. )
  22. type AbstractTransactionResponse struct {
  23. AbstractResultMessage
  24. TransactionExceptionCode transaction.TransactionExceptionCode
  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 transaction.GlobalStatus
  35. }
  36. type BranchRegisterResponse struct {
  37. AbstractTransactionResponse
  38. BranchId int64
  39. }
  40. func (resp BranchRegisterResponse) GetTypeCode() MessageType {
  41. return MessageType_BranchRegisterResult
  42. }
  43. type BranchReportResponse struct {
  44. AbstractTransactionResponse
  45. }
  46. func (resp BranchReportResponse) GetTypeCode() MessageType {
  47. return MessageType_BranchStatusReportResult
  48. }
  49. type BranchCommitResponse struct {
  50. AbstractBranchEndResponse
  51. }
  52. func (resp BranchCommitResponse) GetTypeCode() MessageType {
  53. return MessageType_BranchCommitResult
  54. }
  55. type BranchRollbackResponse struct {
  56. AbstractBranchEndResponse
  57. }
  58. func (resp BranchRollbackResponse) GetTypeCode() MessageType {
  59. return MessageType_GlobalRollbackResult
  60. }
  61. type GlobalBeginResponse struct {
  62. AbstractTransactionResponse
  63. Xid string
  64. ExtraData []byte
  65. }
  66. func (resp GlobalBeginResponse) GetTypeCode() MessageType {
  67. return MessageType_GlobalBeginResult
  68. }
  69. type GlobalStatusResponse struct {
  70. AbstractGlobalEndResponse
  71. }
  72. func (resp GlobalStatusResponse) GetTypeCode() MessageType {
  73. return MessageType_GlobalStatusResult
  74. }
  75. type GlobalLockQueryResponse struct {
  76. AbstractTransactionResponse
  77. Lockable bool
  78. }
  79. func (resp GlobalLockQueryResponse) GetTypeCode() MessageType {
  80. return MessageType_GlobalLockQueryResult
  81. }
  82. type GlobalReportResponse struct {
  83. AbstractGlobalEndResponse
  84. }
  85. func (resp GlobalReportResponse) GetTypeCode() MessageType {
  86. return MessageType_GlobalStatusResult
  87. }
  88. type GlobalCommitResponse struct {
  89. AbstractGlobalEndResponse
  90. }
  91. func (resp GlobalCommitResponse) GetTypeCode() MessageType {
  92. return MessageType_GlobalCommitResult
  93. }
  94. type GlobalRollbackResponse struct {
  95. AbstractGlobalEndResponse
  96. }
  97. func (resp GlobalRollbackResponse) GetTypeCode() MessageType {
  98. return MessageType_GlobalRollbackResult
  99. }

Go Implementation For Seata