tcc

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 16 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTCC

func InitTCC()

Types

type Config

type Config struct {
	FenceConfig fence.Config `yaml:"fence" json:"fence" koanf:"fence"`
}

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix for Config.

type TCCResource

type TCCResource struct {
	ResourceGroupId string `default:"DEFAULT"`
	AppName         string
	*rm.TwoPhaseAction
}

func ParseTCCResource

func ParseTCCResource(v interface{}) (*TCCResource, error)

func (*TCCResource) GetBranchType

func (t *TCCResource) GetBranchType() branch.BranchType

func (*TCCResource) GetResourceGroupId

func (t *TCCResource) GetResourceGroupId() string

func (*TCCResource) GetResourceId

func (t *TCCResource) GetResourceId() string

type TCCResourceManager

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

func GetTCCResourceManagerInstance

func GetTCCResourceManagerInstance() *TCCResourceManager

func (*TCCResourceManager) BranchCommit

func (t *TCCResourceManager) BranchCommit(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)

Commit a branch transaction

func (*TCCResourceManager) BranchRegister

func (t *TCCResourceManager) BranchRegister(ctx context.Context, param rm.BranchRegisterParam) (int64, error)

BranchRegister register transaction branch

func (*TCCResourceManager) BranchReport

func (t *TCCResourceManager) BranchReport(ctx context.Context, param rm.BranchReportParam) error

BranchReport report status of transaction branch

func (*TCCResourceManager) BranchRollback

func (t *TCCResourceManager) BranchRollback(ctx context.Context, branchResource rm.BranchResource) (branch.BranchStatus, error)

Rollback a branch transaction

func (*TCCResourceManager) GetBranchType

func (t *TCCResourceManager) GetBranchType() branch.BranchType

func (*TCCResourceManager) GetCachedResources

func (t *TCCResourceManager) GetCachedResources() *sync.Map

func (*TCCResourceManager) LockQuery

func (t *TCCResourceManager) LockQuery(ctx context.Context, param rm.LockQueryParam) (bool, error)

LockQuery query lock status of transaction branch

func (*TCCResourceManager) RegisterResource

func (t *TCCResourceManager) RegisterResource(resource rm.Resource) error

func (*TCCResourceManager) UnregisterResource

func (t *TCCResourceManager) UnregisterResource(resource rm.Resource) error

type TCCServiceProxy

type TCCServiceProxy struct {
	*TCCResource
	// contains filtered or unexported fields
}

func NewTCCServiceProxy

func NewTCCServiceProxy(service interface{}) (*TCCServiceProxy, error)

func (*TCCServiceProxy) GetTransactionInfo

func (t *TCCServiceProxy) GetTransactionInfo() tm.GtxConfig

func (*TCCServiceProxy) Prepare

func (t *TCCServiceProxy) Prepare(ctx context.Context, params interface{}) (interface{}, error)

func (*TCCServiceProxy) Reference

func (t *TCCServiceProxy) Reference() string

func (*TCCServiceProxy) RegisterResource

func (t *TCCServiceProxy) RegisterResource() error

func (*TCCServiceProxy) SetReferenceName

func (t *TCCServiceProxy) SetReferenceName(referenceName string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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