config

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 8 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 InitConf

func InitConf(confFile string) error

func InitConfWithDefault

func InitConfWithDefault(applicationID string)

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