define

package
v0.0.0-...-daf8b82 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxnTypeSaga = "saga"
	TxnTypeTcc  = "tcc"

	BranchTypeCommit       = "commit"
	BranchTypeCompensation = "compensation"
	BranchTypeConfirm      = "confirm"
	BranchTypeCancel       = "cancel"

	//
	TxnStatePrepared     = "prepared"
	TxnStateCommitting   = "committing"
	TxnStatePreCommitted = "precommitted" // notifying
	TxnStateCommitted    = "committed"
	TxnStateRolling      = "rolling"
	TxnStatePreAborted   = "preaborted" // notifying
	TxnStateAborted      = "aborted"

	TxnCallTypeSync  = "sync"
	TxnCallTypeAsync = "async"

	RmProtocolGrpc     = "grpc"
	RmProtocolSeparate = ";"

	PayloadCodecJson  = "json"
	PayloadCodecProto = "proto"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RetryStrategyConstant

type RetryStrategyConstant struct {
	Duration time.Duration
}

type SagaBranch

type SagaBranch struct {
	BranchId     int
	Commit       SagaBranchCommit
	Compensation SagaBranchCompensation
}

type SagaBranchCommit

type SagaBranchCommit struct {
	Action  string
	Payload []byte
	Timeout time.Duration
	Retry   SagaRetry
}

type SagaBranchCompensation

type SagaBranchCompensation struct {
	Action  string
	Payload []byte
	Timeout time.Duration
	// @todo retry strategy
	Retry time.Duration
}

type SagaBranchResponse

type SagaBranchResponse struct {
	BranchId int
	State    string
	Payload  []byte
}

type SagaNotify

type SagaNotify struct {
	Action  string
	Timeout time.Duration
	Retry   time.Duration
}

type SagaRequest

type SagaRequest struct {
	NodeId            int `json:"-"`
	DcId              int `json:"-"`
	Gtid              string
	Business          string
	Notify            *SagaNotify
	ExpireTime        time.Time
	SagaCallType      string // sync or async
	Branches          []SagaBranch
	ParallelExecution bool
	Lessee            string `json:"-"`
}

type SagaResponse

type SagaResponse struct {
	Gtid     string
	State    string
	Branches []SagaBranchResponse
	Msg      string
}

type SagaRetry

type SagaRetry struct {
	MaxRetry int
	Constant *RetryStrategyConstant
}

type TccBranch

type TccBranch struct {
	BranchId      int
	ActionConfirm string
	ActionCancel  string
	Payload       []byte
	Timeout       time.Duration
	Retry         time.Duration
}

type TccBranchResponse

type TccBranchResponse struct {
	BranchId int
	State    string
}

type TccRequest

type TccRequest struct {
	NodeId     int `json:"-"`
	DcId       int `json:"-"`
	Gtid       string
	Business   string
	ExpireTime time.Time
	Branches   []TccBranch
	Lessee     string `json:"-"`
}

type TccResponse

type TccResponse struct {
	Gtid     string
	State    string
	Branches []TccBranchResponse
	Msg      string
}

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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