xa

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BranchIdPrefix     = "-"
	SeataXaXidFormatId = 9752
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*XABranchXid)

func WithBranchId

func WithBranchId(branchId int64) Option

func WithBranchQualifier

func WithBranchQualifier(branchQualifier []byte) Option

func WithGlobalTransactionId

func WithGlobalTransactionId(globalTransactionId []byte) Option

func WithXid

func WithXid(xid string) Option

type XABranchXid

type XABranchXid struct {
	// contains filtered or unexported fields
}

func Build

func Build(xid string, branchId int64) *XABranchXid

func BuildWithByte

func BuildWithByte(globalTransactionId []byte, branchQualifier []byte) *XABranchXid

func NewXABranchXid

func NewXABranchXid(opt ...Option) *XABranchXid

func (*XABranchXid) GetBranchId

func (x *XABranchXid) GetBranchId() int64

func (*XABranchXid) GetBranchQualifier

func (x *XABranchXid) GetBranchQualifier() []byte

func (*XABranchXid) GetFormatId

func (x *XABranchXid) GetFormatId() int

func (*XABranchXid) GetGlobalTransactionId

func (x *XABranchXid) GetGlobalTransactionId() []byte

func (*XABranchXid) GetGlobalXid

func (x *XABranchXid) GetGlobalXid() string

func (*XABranchXid) String

func (x *XABranchXid) String() string

type XAXid

type XAXid interface {
	Xid
	GetGlobalXid() string
	GetBranchId() int64
}

type Xid

type Xid interface {
	GetFormatId() int
	GetGlobalTransactionId() []byte
	GetBranchQualifier() []byte
}

Jump to

Keyboard shortcuts

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