protocal

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION                    = 1
	MAX_FRAME_LENGTH           = 8 * 1024 * 1024
	V1_HEAD_LENGTH             = 16
	MSGTYPE_RESQUEST           = 0
	MSGTYPE_RESPONSE           = 1
	MSGTYPE_RESQUEST_ONEWAY    = 2
	MSGTYPE_HEARTBEAT_REQUEST  = 3
	MSGTYPE_HEARTBEAT_RESPONSE = 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.
	 */
	TypeSeataMerge int16 = 59
	/**
	 * The constant TYPE_SEATA_MERGE_RESULT.
	 */
	TypeSeataMergeResult 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}
View Source
var HeartBeatMessagePong = HeartBeatMessage{false}
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
}

type AbstractIdentifyResponse

type AbstractIdentifyResponse struct {
	AbstractResultMessage

	Version string

	ExtraData []byte

	Identified bool
}

type AbstractResultMessage

type AbstractResultMessage struct {
	ResultCode ResultCode
	Msg        string
}

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
}

func (HeartBeatMessage) ToString

func (msg HeartBeatMessage) ToString() string

type MergeResultMessage

type MergeResultMessage struct {
	Msgs []MessageTypeAware
}

func (MergeResultMessage) GetTypeCode

func (resp MergeResultMessage) GetTypeCode() int16

type MergedWarpMessage

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

func (MergedWarpMessage) GetTypeCode

func (req MergedWarpMessage) GetTypeCode() int16

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
}

func (RegisterTMRequest) GetTypeCode

func (req RegisterTMRequest) GetTypeCode() int16

type RegisterTMResponse

type RegisterTMResponse struct {
	AbstractIdentifyResponse
}

func (RegisterTMResponse) GetTypeCode

func (resp RegisterTMResponse) GetTypeCode() int16

type ResultCode

type ResultCode byte
const (

	/**
	 * ResultCodeFailed result code.
	 */
	// ResultCodeFailed
	ResultCodeFailed ResultCode = iota

	/**
	 * Success result code.
	 */
	// Success
	ResultCodeSuccess
)

type RpcMessage

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

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