Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLocalize ¶
Types ¶
type Fuse ¶
type Fuse struct {
// contains filtered or unexported fields
}
Fuse @Plugin 熔断
func (*Fuse) InitModule ¶
func (this *Fuse) InitModule()
type FuseConfig ¶
type FuseConfig struct {
FuseOpt FuseOpt `mapstructure:"fuse"`
}
func (*FuseConfig) InitDefaultConfig ¶
func (this *FuseConfig) InitDefaultConfig(vp *viper.Viper)
type FuseOpt ¶
type FuseOpt struct { Enable bool Rules map[string]*FuseRuleOpt `mapstructure:"fuseRules"` }
type FuseRuleOpt ¶
type FuseRuleOpt struct { // 定义执行command的超时时间(ms) Timeout int `mapstructure:"timeout"` // 定义command的最大并发量 MaxConcurrentRequests int `mapstructure:"maxConcurrentRequests"` // 在熔断器被打开后,根据SleepWindow设置的时间控制多久后尝试服务是否可用 SleepWindow int `mapstructure:"sleepWindow"` // 判断熔断开关的条件之一,统计10s内请求数量,达到这个请求数量后再根据错误率判断是否要开启熔断 RequestVolumeThreshold int `mapstructure:"requestVolumeThreshold"` // 判断熔断开关的条件之一,错误率到达这个百分比后就会启动熔断 ErrorPercentThreshold int `mapstructure:"errorPercentThreshold"` }
FuseRuleOpt 熔断器配置
type I18n ¶
type I18n struct { Localize map[string]*i18n.Localizer Bundle *i18n.Bundle // contains filtered or unexported fields }
I18n @Plugin 国际化
func (*I18n) InitModule ¶
func (this *I18n) InitModule()
type I18nConfig ¶
type I18nConfig struct {
I18nOpt I18nOpt `mapstructure:"i18n"`
}
I18nConfig 限流规则map
func (*I18nConfig) InitDefaultConfig ¶
func (this *I18nConfig) InitDefaultConfig(vp *viper.Viper)
Click to show internal directories.
Click to hide internal directories.