Documentation ¶
Index ¶
- Variables
- func AtreusCliConfigInit()
- func AtreusSvcConfigInit()
- func Init(file, suffix string)
- func InitConfigAbsolutePath(dir, file, suffix string)
- func Keys(c *Config) []string
- func Register(f OnConfigChange)
- func Set(key string, value interface{})
- func SetDefaultConfDir(dir string)
- type AclConfig
- type AtreusCliConfig
- type AtreusSvcConfig
- type AuthConfig
- type BreakerConfig
- type CliConfig
- type ClientRetryConfig
- type Config
- func (c *Config) MustBool(key string, defaultValue bool) bool
- func (c *Config) MustDuration(key string, defaultValue time.Duration) time.Duration
- func (c *Config) MustFloat64(key string, defaultValue float64) float64
- func (c *Config) MustInt(key string, defaultValue int) int
- func (c *Config) MustInt64(key string, defaultValue int64) int64
- func (c *Config) MustString(key string, defaultValue string) string
- func (c *Config) MustStringMap(key string, defaultValue map[string]interface{}) map[string]interface{}
- func (c *Config) MustStringMapString(key string, defaultValue map[string]string) map[string]string
- func (c *Config) MustStringSlice(key string, defaultValue []string) []string
- func (c *Config) MustUint64(key string, defaultValue uint64) uint64
- func (c *Config) NeedUse(key string) *Config
- func (c *Config) Use(key string) *Config
- type EtcdConfig
- type LimiterConfig
- type LogConfig
- type OnConfigChange
- type RegistryConfig
- type SrvConfig
- type SrvDnsConfig
- type SysCollectorConfig
- type TlsConfig
- type TracingConfig
- type WeightConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_DIR = "./conf/"
View Source
var NotifyFunc []OnConfigChange
Functions ¶
func AtreusCliConfigInit ¶
func AtreusCliConfigInit()
func AtreusSvcConfigInit ¶
func AtreusSvcConfigInit()
func Register ¶
func Register(f OnConfigChange)
func SetDefaultConfDir ¶
func SetDefaultConfDir(dir string)
Types ¶
type AtreusCliConfig ¶
type AtreusCliConfig struct { //Cli config CliConf *CliConfig //Dial SrvDnsConf *SrvDnsConfig //TLS config TlsConf *TlsConfig //Service Register RegistryConf *RegistryConfig //Log LogConf *LogConfig //Auth AuthConf *AuthConfig //Breaker BreakerConf *BreakerConfig //retry RetryConf *ClientRetryConfig //tracer TracingConf *TracingConfig }
func GetAtreusCliConfig ¶
func GetAtreusCliConfig() *AtreusCliConfig
type AtreusSvcConfig ¶
type AtreusSvcConfig struct { //Server config SrvConf *SrvConfig `json:"srv_conf"` //TLS config TlsConf *TlsConfig `json:"tls_conf"` //Service Register RegistryConf *RegistryConfig `json:"registry_conf"` //Limiter LimiterConf *LimiterConfig `json:"limiter_conf"` //Etcd EtcdConf *EtcdConfig `json:"etcd_conf"` //Weight WeightConf *WeightConfig `json:"weight_conf"` //Log LogConf *LogConfig `json:"log_conf"` //Auth AuthConf *AuthConfig `json:"auth_conf"` //ACL AclConf *AclConfig `json:"acl_conf"` //tracer TracingConf *TracingConfig `json:"tracing"` //system collector SysCollectorConf *SysCollectorConfig `json:"collector"` }
func GetAtreusSvcConfig ¶
func GetAtreusSvcConfig() *AtreusSvcConfig
type AuthConfig ¶
type AuthConfig struct {
On bool `json:"on-off"`
}
type BreakerConfig ¶
type BreakerConfig struct { On bool `json:"on-off"` BreakerType string `json:"type"` //熔断器类型 MaxRequestsForHalfOpen int `json:"max_request"` Interval time.Duration `json:"interval"` TimeoutForOpen time.Duration `json:"timeout"` ReadyToTripForTotalrequets int `json:"r2t_total_request"` //ReadyToTrip中统计的总请求次数 ReadyToTripForFailratio float64 `json:"r2t_fail_ratio"` //ReadyToTrip中统计的出错比率 }
type ClientRetryConfig ¶
type Config ¶
func (*Config) MustDuration ¶
func (*Config) MustStringMap ¶
func (*Config) MustStringMapString ¶
func (*Config) MustStringSlice ¶
type EtcdConfig ¶
type EtcdConfig struct { Endpoints []string `json:"endpoints"` ConnectTimeout time.Duration `json:"timeout"` Secure bool `json:"secure"` TTL int `json:"ttl"` //Etcd DialKeepAliveTime time.Duration `json:"dialkeepalivetime"` DialKeepAliveTimeout time.Duration `json:"dialkeepalivetimeout"` //ETCD 认证参数 CertFilePath string `json:"certfilepath"` KeyFilePath string `json:"keyfilepath"` CaCertPath string `json:"cacertpath"` BasicAuth bool `json:"basicauth"` UserName string `json:"username"` Password string `json:"passwd"` }
type LimiterConfig ¶
type OnConfigChange ¶
type RegistryConfig ¶
type RegistryConfig struct { RegOn bool `json:"on-off"` RegisterType string `json:"reg_type"` RegisterEndpoints string `json:"reg_endpoint"` RegisterTTL time.Duration `json:"reg_ttl"` RegisterAPIOn bool `json:"reg_api_on"` RegisterRootPath string `json:"reg_root_path"` RegisterService string `json:"reg_service_name"` RegisterServiceVer string `json:"reg_service_version"` RegisterServiceAddr string `json:"reg_service_addr"` }
type SrvConfig ¶
type SrvConfig struct { Addr string `json:"address"` Keepalive bool `json:"keepalive"` Timeout time.Duration `json:"timeout"` IdleTimeout time.Duration `json:"idle_timeout"` MaxLifeTime time.Duration `json:"max_life"` ForceCloseWait time.Duration `json:"close_wait"` KeepAliveInterval time.Duration `json:"keepalive_interval"` KeepAliveTimeout time.Duration `json:"keepalive_timeout"` MaxRetry int `json:"max_retry"` }
type SrvDnsConfig ¶
type SysCollectorConfig ¶
type TracingConfig ¶
type WeightConfig ¶
type WeightConfig struct {
Weight string `json:"init_weight"`
}
Click to show internal directories.
Click to hide internal directories.