config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetClientConfig

func SetClientConfig(config *DistributedTransaction)

Types

type ATConfig

type ATConfig struct {
	DSN                 string        `yaml:"dsn" json:"dsn,omitempty"`
	ReportRetryCount    int           `default:"5" yaml:"reportRetryCount" json:"reportRetryCount,omitempty"`
	ReportSuccessEnable bool          `default:"false" yaml:"reportSuccessEnable" json:"reportSuccessEnable,omitempty"`
	LockRetryInterval   time.Duration `default:"10ms" yaml:"lockRetryInterval" json:"lockRetryInterval,omitempty"`
	LockRetryTimes      int           `default:"30" yaml:"lockRetryTimes" json:"lockRetryTimes,omitempty"`
}

func GetATConfig

func GetATConfig() ATConfig

GetATConfig return ATConfig

type DistributedTransaction

type DistributedTransaction struct {
	ApplicationID                    string `yaml:"appid" json:"appid"`
	RetryDeadThreshold               int64  `yaml:"retry_dead_threshold" json:"retry_dead_threshold"`
	RollbackRetryTimeoutUnlockEnable bool   `yaml:"rollback_retry_timeout_unlock_enable" json:"rollback_retry_timeout_unlock_enable"`

	EtcdConfig clientv3.Config `yaml:"etcd_config" json:"etcd_config"`

	ATConfig ATConfig `yaml:"at" json:"at,omitempty"`
	TMConfig TMConfig `yaml:"tm" json:"tm,omitempty"`
}

func InitDistributedTransaction

func InitDistributedTransaction(configurationPath string) *DistributedTransaction

InitDistributedTransaction init configuration from a file path

type TMConfig

type TMConfig struct {
	CommitRetryCount   int32 `default:"5" yaml:"commitRetryCount" json:"commitRetryCount,omitempty"`
	RollbackRetryCount int32 `default:"5" yaml:"rollbackRetryCount" json:"rollbackRetryCount,omitempty"`
}

func GetTMConfig

func GetTMConfig() TMConfig

GetTMConfig return TMConfig

Jump to

Keyboard shortcuts

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