protocal

package
v0.0.0-...-1fef4f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2022 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// version
	VERSION = 1

	// MaxFrameLength max frame length
	MaxFrameLength = 8 * 1024 * 1024

	// V1HeadLength v1 head length
	V1HeadLength = 16

	// MSGTypeRequest request message type
	MSGTypeRequest = 0

	// MSGTypeResponse response message type
	MSGTypeResponse = 1

	// MSGTypeRequestOneway request one way
	MSGTypeRequestOneway = 2

	// MSGTypeHeartbeatRequest heart beat request
	MSGTypeHeartbeatRequest = 3

	// MSGTypeHeartbeatResponse heart beat response
	MSGTypeHeartbeatResponse = 4
)
View Source
const (
	// The constant TYPE_GLOBAL_BEGIN.
	TypeGlobalBegin int16 = 1

	// The constant TYPE_GLOBAL_BEGIN_RESULT.
	TypeGlobalBeginResult int16 = 2

	// The constant TYPE_GLOBAL_COMMIT.
	TypeGlobalCommit int16 = 7

	// The constant TYPE_GLOBAL_COMMIT_RESULT.
	TypeGlobalCommitResult int16 = 8

	// The constant TYPE_GLOBAL_ROLLBACK.
	TypeGlobalRollback int16 = 9

	// The constant TYPE_GLOBAL_ROLLBACK_RESULT.
	TypeGlobalRollbackResult int16 = 10

	// The constant TYPE_GLOBAL_STATUS.
	TypeGlobalStatus int16 = 15

	// The constant TYPE_GLOBAL_STATUS_RESULT.
	TypeGlobalStatusResult int16 = 16

	// The constant TYPE_GLOBAL_REPORT.
	TypeGlobalReport int16 = 17

	// The constant TYPE_GLOBAL_REPORT_RESULT.
	TypeGlobalReportResult int16 = 18

	// The constant TYPE_GLOBAL_LOCK_QUERY.
	TypeGlobalLockQuery int16 = 21

	// The constant TYPE_GLOBAL_LOCK_QUERY_RESULT.
	TypeGlobalLockQueryResult int16 = 22

	// The constant TYPE_BRANCH_COMMIT.
	TypeBranchCommit int16 = 3

	// The constant TYPE_BRANCH_COMMIT_RESULT.
	TypeBranchCommitResult int16 = 4

	// The constant TYPE_BRANCH_ROLLBACK.
	TypeBranchRollback int16 = 5

	// The constant TYPE_BRANCH_ROLLBACK_RESULT.
	TypeBranchRollbackResult int16 = 6

	// The constant TYPE_BRANCH_REGISTER.
	TypeBranchRegister int16 = 11

	// The constant TYPE_BRANCH_REGISTER_RESULT.
	TypeBranchRegisterResult int16 = 12

	// The constant TYPE_BRANCH_STATUS_REPORT.
	TypeBranchStatusReport int16 = 13

	// The constant TYPE_BRANCH_STATUS_REPORT_RESULT.
	TypeBranchStatusReportResult int16 = 14

	// The constant TYPE_SEATA_MERGE.
	TypeStarfishMerge int16 = 59

	// The constant TYPE_SEATA_MERGE_RESULT.
	TypeStarfishMergeResult int16 = 60

	// The constant TYPE_REG_CLT.
	TypeRegClt int16 = 101

	// The constant TYPE_REG_CLT_RESULT.
	TypeRegCltResult int16 = 102

	// The constant TYPE_REG_RM.
	TypeRegRm int16 = 103

	// The constant TYPE_REG_RM_RESULT.
	TypeRegRmResult int16 = 104

	// The constant TYPE_RM_DELETE_UNDOLOG.
	TypeRmDeleteUndolog int16 = 111
)

Variables

View Source
var HeartBeatMessagePing = HeartBeatMessage{true}

HeartBeatMessagePing

View Source
var HeartBeatMessagePong = HeartBeatMessage{false}

HeartBeatMessagePong

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

Functions

This section is empty.

Types

type AbstractBranchEndRequest

type AbstractBranchEndRequest struct {
	XID             string
	BranchID        int64
	BranchType      meta.BranchType
	ResourceID      string
	ApplicationData []byte
}

type AbstractBranchEndResponse

type AbstractBranchEndResponse struct {
	AbstractTransactionResponse

	XID          string
	BranchID     int64
	BranchStatus meta.BranchStatus
}

type AbstractGlobalEndRequest

type AbstractGlobalEndRequest struct {
	XID       string
	ExtraData []byte
}

type AbstractGlobalEndResponse

type AbstractGlobalEndResponse struct {
	AbstractTransactionResponse

	GlobalStatus meta.GlobalStatus
}

type AbstractIdentifyRequest

type AbstractIdentifyRequest struct {
	Version string

	ApplicationID string

	TransactionServiceGroup string

	ExtraData []byte
}

AbstractIdentifyRequest

type AbstractIdentifyResponse

type AbstractIdentifyResponse struct {
	AbstractResultMessage

	Version string

	ExtraData []byte

	Identified bool
}

AbstractIdentifyResponse

type AbstractResultMessage

type AbstractResultMessage struct {
	ResultCode ResultCode
	Msg        string
}

AbstractResultMessage

type AbstractTransactionResponse

type AbstractTransactionResponse struct {
	AbstractResultMessage
	TransactionExceptionCode meta.TransactionExceptionCode
}

func (AbstractTransactionResponse) GetError

func (resp AbstractTransactionResponse) GetError() error

type BranchCommitRequest

type BranchCommitRequest struct {
	AbstractBranchEndRequest
}

func (BranchCommitRequest) GetTypeCode

func (req BranchCommitRequest) GetTypeCode() int16

type BranchCommitResponse

type BranchCommitResponse struct {
	AbstractBranchEndResponse
}

func (BranchCommitResponse) GetTypeCode

func (resp BranchCommitResponse) GetTypeCode() int16

type BranchRegisterRequest

type BranchRegisterRequest struct {
	XID             string
	BranchType      meta.BranchType
	ResourceID      string
	LockKey         string
	ApplicationData []byte
}

func (BranchRegisterRequest) GetTypeCode

func (req BranchRegisterRequest) GetTypeCode() int16

type BranchRegisterResponse

type BranchRegisterResponse struct {
	AbstractTransactionResponse

	BranchID int64
}

func (BranchRegisterResponse) GetTypeCode

func (resp BranchRegisterResponse) GetTypeCode() int16

type BranchReportRequest

type BranchReportRequest struct {
	XID             string
	BranchID        int64
	ResourceID      string
	Status          meta.BranchStatus
	ApplicationData []byte
	BranchType      meta.BranchType
}

func (BranchReportRequest) GetTypeCode

func (req BranchReportRequest) GetTypeCode() int16

type BranchReportResponse

type BranchReportResponse struct {
	AbstractTransactionResponse
}

func (BranchReportResponse) GetTypeCode

func (resp BranchReportResponse) GetTypeCode() int16

type BranchRollbackRequest

type BranchRollbackRequest struct {
	AbstractBranchEndRequest
}

func (BranchRollbackRequest) GetTypeCode

func (req BranchRollbackRequest) GetTypeCode() int16

type BranchRollbackResponse

type BranchRollbackResponse struct {
	AbstractBranchEndResponse
}

func (BranchRollbackResponse) GetTypeCode

func (resp BranchRollbackResponse) GetTypeCode() int16

type GlobalBeginRequest

type GlobalBeginRequest struct {
	Timeout         int32
	TransactionName string
}

func (GlobalBeginRequest) GetTypeCode

func (req GlobalBeginRequest) GetTypeCode() int16

type GlobalBeginResponse

type GlobalBeginResponse struct {
	AbstractTransactionResponse

	Xid       string
	ExtraData []byte
}

func (GlobalBeginResponse) GetTypeCode

func (resp GlobalBeginResponse) GetTypeCode() int16

type GlobalCommitRequest

type GlobalCommitRequest struct {
	AbstractGlobalEndRequest
}

func (GlobalCommitRequest) GetTypeCode

func (req GlobalCommitRequest) GetTypeCode() int16

type GlobalCommitResponse

type GlobalCommitResponse struct {
	AbstractGlobalEndResponse
}

func (GlobalCommitResponse) GetTypeCode

func (resp GlobalCommitResponse) GetTypeCode() int16

type GlobalLockQueryRequest

type GlobalLockQueryRequest struct {
	BranchRegisterRequest
}

func (GlobalLockQueryRequest) GetTypeCode

func (req GlobalLockQueryRequest) GetTypeCode() int16

type GlobalLockQueryResponse

type GlobalLockQueryResponse struct {
	AbstractTransactionResponse

	Lockable bool
}

func (GlobalLockQueryResponse) GetTypeCode

func (resp GlobalLockQueryResponse) GetTypeCode() int16

type GlobalReportRequest

type GlobalReportRequest struct {
	AbstractGlobalEndRequest

	GlobalStatus meta.GlobalStatus
}

func (GlobalReportRequest) GetTypeCode

func (req GlobalReportRequest) GetTypeCode() int16

type GlobalReportResponse

type GlobalReportResponse struct {
	AbstractGlobalEndResponse
}

func (GlobalReportResponse) GetTypeCode

func (resp GlobalReportResponse) GetTypeCode() int16

type GlobalRollbackRequest

type GlobalRollbackRequest struct {
	AbstractGlobalEndRequest
}

func (GlobalRollbackRequest) GetTypeCode

func (req GlobalRollbackRequest) GetTypeCode() int16

type GlobalRollbackResponse

type GlobalRollbackResponse struct {
	AbstractGlobalEndResponse
}

func (GlobalRollbackResponse) GetTypeCode

func (resp GlobalRollbackResponse) GetTypeCode() int16

type GlobalStatusRequest

type GlobalStatusRequest struct {
	AbstractGlobalEndRequest
}

func (GlobalStatusRequest) GetTypeCode

func (req GlobalStatusRequest) GetTypeCode() int16

type GlobalStatusResponse

type GlobalStatusResponse struct {
	AbstractGlobalEndResponse
}

func (GlobalStatusResponse) GetTypeCode

func (resp GlobalStatusResponse) GetTypeCode() int16

type HeartBeatMessage

type HeartBeatMessage struct {
	Ping bool
}

HeartBeatMessage

func (HeartBeatMessage) ToString

func (msg HeartBeatMessage) ToString() string

ToString

type MergeResultMessage

type MergeResultMessage struct {
	Msgs []MessageTypeAware
}

MergeResultMessage

func (MergeResultMessage) GetTypeCode

func (resp MergeResultMessage) GetTypeCode() int16

GetTypeCode

type MergedWarpMessage

type MergedWarpMessage struct {
	Msgs   []MessageTypeAware
	MsgIDs []int32
}

MergedWarpMessage

func (MergedWarpMessage) GetTypeCode

func (req MergedWarpMessage) GetTypeCode() int16

GetTypeCode

type MessageTypeAware

type MessageTypeAware interface {
	GetTypeCode() int16
}

type RegisterRMRequest

type RegisterRMRequest struct {
	AbstractIdentifyRequest
	ResourceIDs string
}

func (RegisterRMRequest) GetTypeCode

func (req RegisterRMRequest) GetTypeCode() int16

type RegisterRMResponse

type RegisterRMResponse struct {
	AbstractIdentifyResponse
}

func (RegisterRMResponse) GetTypeCode

func (resp RegisterRMResponse) GetTypeCode() int16

type RegisterTMRequest

type RegisterTMRequest struct {
	AbstractIdentifyRequest
}

RegisterTMRequest

func (RegisterTMRequest) GetTypeCode

func (req RegisterTMRequest) GetTypeCode() int16

GetTypeCode

type RegisterTMResponse

type RegisterTMResponse struct {
	AbstractIdentifyResponse
}

RegisterTMResponse

func (RegisterTMResponse) GetTypeCode

func (resp RegisterTMResponse) GetTypeCode() int16

GetTypeCode

type ResultCode

type ResultCode byte
const (

	// ResultCodeFailed failed
	ResultCodeFailed ResultCode = iota

	// ResultCodeSuccess success
	ResultCodeSuccess
)

type RpcMessage

type RpcMessage struct {
	ID          int32
	MessageType byte
	Codec       byte
	Compressor  byte
	HeadMap     map[string]string
	Body        interface{}
}

RpcMessage

type UndoLogDeleteRequest

type UndoLogDeleteRequest struct {
	ResourceID string
	SaveDays   int16
	BranchType meta.BranchType
}

func (UndoLogDeleteRequest) GetTypeCode

func (req UndoLogDeleteRequest) GetTypeCode() int16

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL