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.

register_tm_response_codec.go 827 B

123456789101112131415161718192021222324252627282930
  1. package codec
  2. import (
  3. "github.com/seata/seata-go/pkg/protocol/message"
  4. )
  5. func init() {
  6. GetCodecManager().RegisterCodec(CodeTypeSeata, &RegisterTMResponseCodec{})
  7. }
  8. type RegisterTMResponseCodec struct {
  9. AbstractIdentifyResponseCodec
  10. }
  11. func (g *RegisterTMResponseCodec) Decode(in []byte) interface{} {
  12. req := g.AbstractIdentifyResponseCodec.Decode(in)
  13. abstractIdentifyResponse := req.(message.AbstractIdentifyResponse)
  14. return message.RegisterTMResponse{
  15. AbstractIdentifyResponse: abstractIdentifyResponse,
  16. }
  17. }
  18. func (c *RegisterTMResponseCodec) Encode(in interface{}) []byte {
  19. resp := in.(message.RegisterTMResponse)
  20. return c.AbstractIdentifyResponseCodec.Encode(resp.AbstractIdentifyResponse)
  21. }
  22. func (g *RegisterTMResponseCodec) GetMessageType() message.MessageType {
  23. return message.MessageType_RegCltResult
  24. }

Go Implementation For Seata