config

package
v0.1.10-0...-9bf53c4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitApolloConf

func InitApolloConf(serverAddr string, appId string, nameSpace string) error

func InitCommonConf

func InitCommonConf(confStream []byte) error

func InitConf

func InitConf(confFile string) error

func InitConfWithDefault

func InitConfWithDefault(applicationId string)

func SetClientConfig

func SetClientConfig(c ClientConfig)

Types

type ATConfig

type ATConfig struct {
	DSN                 string `yaml:"dsn" json:"dsn,omitempty"`
	ReportRetryCount    int    `default:"5" yaml:"report_retry_count" json:"report_retry_count,omitempty"`
	ReportSuccessEnable bool   `default:"false" yaml:"report_success_enable" json:"report_success_enable,omitempty"`
	LockRetryItv        string `default:"10ms" yaml:"lock_retry_interval" json:"lock_retry_interval,omitempty"`
	LockRetryInterval   time.Duration
	LockRetryTimes      int `default:"30" yaml:"lock_retry_times" json:"lock_retry_times,omitempty"`
}

func GetATConfig

func GetATConfig() ATConfig

func (*ATConfig) CheckValidity

func (c *ATConfig) CheckValidity() error

type ClientConfig

type ClientConfig struct {
	ApplicationId                string      `yaml:"application_id" json:"application_id,omitempty"`
	TransactionServiceGroup      string      `yaml:"transaction_service_group" json:"transaction_service_group,omitempty"`
	EnableClientBatchSendRequest bool        `yaml:"enable-rpc_client-batch-send-request" json:"enable-rpc_client-batch-send-request,omitempty"`
	SeataVersion                 string      `yaml:"seata_version" json:"seata_version,omitempty"`
	GettyConfig                  GettyConfig `yaml:"getty" json:"getty,omitempty"`
	TMConfig                     TMConfig    `yaml:"tm" json:"tm,omitempty"`
	ATConfig                     ATConfig    `yaml:"at" json:"at,omitempty"`
}

func GetClientConfig

func GetClientConfig() ClientConfig

func GetDefaultClientConfig

func GetDefaultClientConfig(applicationId string) ClientConfig

type GettyConfig

type GettyConfig struct {
	ReconnectInterval int `default:"0" yaml:"reconnect_interval" json:"reconnect_interval,omitempty"`
	// getty_session pool
	ConnectionNum int `default:"16" yaml:"connection_number" json:"connection_number,omitempty"`

	// heartbeat
	HeartbeatPrd    string `default:"15s" yaml:"heartbeat_period" json:"heartbeat_period,omitempty"`
	HeartbeatPeriod time.Duration

	// getty_session tcp parameters
	GettySessionParam config.GettySessionParam `required:"true" yaml:"getty_session_param" json:"getty_session_param,omitempty"`
}

GettyConfig Config holds supported types by the multiconfig package

func GetDefaultGettyConfig

func GetDefaultGettyConfig() GettyConfig

GetDefaultGettyConfig ...

func (*GettyConfig) CheckValidity

func (c *GettyConfig) CheckValidity() error

CheckValidity ...

type TMConfig

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

func GetDefaultTmConfig

func GetDefaultTmConfig() TMConfig

func GetTMConfig

func GetTMConfig() TMConfig

Jump to

Keyboard shortcuts

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