config

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientParameters

func GetClientParameters() keepalive.ClientParameters

GetClientParameters used to config grpc connection keep alive

func GetEnforcementPolicy

func GetEnforcementPolicy() keepalive.EnforcementPolicy

GetEnforcementPolicy used to config grpc connection keep alive

func GetServerParameters

func GetServerParameters() keepalive.ServerParameters

GetServerParameters used to config grpc connection keep alive

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"`
}

ATConfig

func GetATConfig

func GetATConfig() ATConfig

GetATConfig return ATConfig

type Configuration

type Configuration struct {
	Port             int32  `yaml:"port" json:"port"`
	Addressing       string `yaml:"addressing" json:"addressing"`
	ServerAddressing string `yaml:"serverAddressing" json:"serverAddressing"`

	TMConfig TMConfig `yaml:"tm" json:"tm,omitempty"`

	ATConfig ATConfig `yaml:"at" json:"at,omitempty"`

	EnforcementPolicy struct {
		MinTime             time.Duration `yaml:"minTime"`
		PermitWithoutStream bool          `yaml:"permitWithoutStream"`
	} `yaml:"enforcementPolicy"`

	ServerParameters struct {
		MaxConnectionIdle     time.Duration `yaml:"maxConnectionIdle"`
		MaxConnectionAge      time.Duration `yaml:"maxConnectionAge"`
		MaxConnectionAgeGrace time.Duration `yaml:"maxConnectionAgeGrace"`
		Time                  time.Duration `yaml:"time"`
		Timeout               time.Duration `yaml:"timeout"`
	} `yaml:"serverParameters"`

	ClientParameters struct {
		Time                time.Duration `yaml:"time"`
		Timeout             time.Duration `yaml:"timeout"`
		PermitWithoutStream bool          `yaml:"permitWithoutStream"`
	} `yaml:"clientParameters"`

	Log struct {
		LogPath  string       `yaml:"logPath"`
		LogLevel log.LogLevel `yaml:"logLevel"`
	} `yaml:"log"`
}

Configuration client configuration

func InitConfiguration

func InitConfiguration(configurationPath string) *Configuration

InitConfiguration init configuration from a file path

func (*Configuration) GetClientParameters

func (configuration *Configuration) GetClientParameters() keepalive.ClientParameters

GetClientParameters used to config grpc connection keep alive

func (*Configuration) GetEnforcementPolicy

func (configuration *Configuration) GetEnforcementPolicy() keepalive.EnforcementPolicy

GetEnforcementPolicy used to config grpc connection keep alive

func (*Configuration) GetServerParameters

func (configuration *Configuration) GetServerParameters() keepalive.ServerParameters

GetServerParameters used to config grpc connection keep alive

type TMConfig

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

TMConfig

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