context

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyXID                = "TX_XID"
	KeyXIDInterceptorType = "tx-xid-interceptor-type"
	KeyGlobalLockFlag     = "TX_LOCK"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BusinessActionContext

type BusinessActionContext struct {
	*RootContext
	XID           string
	BranchID      string
	ActionName    string
	ActionContext map[string]interface{}
}

BusinessActionContext store the tcc branch transaction context

type RootContext

type RootContext struct {
	context.Context
	// contains filtered or unexported fields
}

RootContext store the global transaction context

func NewRootContext

func NewRootContext(ctx context.Context) *RootContext

NewRootContext return a pointer to RootContext

func (*RootContext) Bind

func (c *RootContext) Bind(xid string)

Bind bind xid with RootContext

func (*RootContext) BindGlobalLockFlag

func (c *RootContext) BindGlobalLockFlag()

BindGlobalLockFlag bind global lock flag with RootContext

func (*RootContext) BindInterceptorType

func (c *RootContext) BindInterceptorType(xidType string)

BindInterceptorType bind interceptor type with RootContext

func (*RootContext) BindInterceptorTypeWithBranchType

func (c *RootContext) BindInterceptorTypeWithBranchType(xid string, branchType apis.BranchSession_BranchType)

BindInterceptorTypeWithBranchType bind interceptor type and branch type with RootContext

func (*RootContext) Get

func (c *RootContext) Get(key string) (value interface{}, exists bool)

Get get a value by given key from RootContext

func (*RootContext) GetXID

func (c *RootContext) GetXID() string

GetXID from RootContext get xid

func (*RootContext) GetXIDInterceptorType

func (c *RootContext) GetXIDInterceptorType() string

GetXIDInterceptorType from RootContext get xid interceptor type

func (*RootContext) InGlobalTransaction

func (c *RootContext) InGlobalTransaction() bool

InGlobalTransaction determine whether the context is in global transaction

func (*RootContext) RequireGlobalLock

func (c *RootContext) RequireGlobalLock() bool

RequireGlobalLock return global lock flag

func (*RootContext) Set

func (c *RootContext) Set(key string, value interface{})

Set store key value to RootContext

func (*RootContext) Unbind

func (c *RootContext) Unbind() string

Unbind unbind xid with RootContext

func (*RootContext) UnbindGlobalLockFlag

func (c *RootContext) UnbindGlobalLockFlag()

UnbindGlobalLockFlag unbind global lock flag with RootContext

func (*RootContext) UnbindInterceptorType

func (c *RootContext) UnbindInterceptorType() string

UnbindInterceptorType unbind interceptor type with RootContext

Jump to

Keyboard shortcuts

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