config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	PrefixURI string             `toml:"prefix-uri"`
	Version   string             `toml:"version"`
	Hystries  map[string]Hystrix `toml:"hystries"`
}

Adapter 适配器对象

type CommonConfig

type CommonConfig struct {
	ListenHost       string        `toml:"listen-host"`
	HTTPPort         string        `toml:"http-port"`
	HTTPCACert       string        `toml:"http-ca-cert"`
	HTTPCert         string        `toml:"http-cert"`
	HTTPKey          string        `toml:"http-key"`
	VerifyClientCert bool          `toml:"verify-client-cert"`
	SRDETCDServers   string        `toml:"srd-etcd-servers"`
	SRDETCDCaCert    string        `toml:"srd-etcd-ca-cert"`
	SRDETCDCert      string        `toml:"srd-etcd-cert"`
	SRDETCDKey       string        `toml:"srd-etcd-key"`
	SRDPrefix        string        `toml:"srd-prefix"`
	AdapterDir       string        `toml:"adapter-dir"`
	GracefulTimeout  time.Duration `toml:"graceful-timeout"`
}

CommonConfig 服务通用配置部分

type ConfigFile

type ConfigFile struct {
	Common   *CommonConfig      `toml:"common"`
	Adapters map[string]Adapter `toml:"adapters"`
}

ConfigFile 服务配置对象定义

func ParseConfigFile

func ParseConfigFile(filePath string, logger log.Logger) *ConfigFile

ParseConfigFile 解析配置文件方法

type Hystrix

type Hystrix struct {
	Timeout                int `toml:"timeout"`
	SleepWindow            int `toml:"sleep-window"`
	ErrorPercentThreshold  int `toml:"error-percent-threshold"`
	MaxConcurrentRequests  int `toml:"max-concurrent-requests"`
	RequestVolumeThreshold int `toml:"request-volume-threshold"`
}

Hystrix 熔断配置对象

Jump to

Keyboard shortcuts

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