Documentation ¶
Index ¶
- Constants
- func AddDI(dimensionInfo string) (map[string]string, error)
- func AddFile(file string) error
- func AddKeyValue(key string, value interface{}) error
- func Exist(key string) bool
- func Get(key string) interface{}
- func GetAbortPercent(protocol, microServiceName, schema, operation string) int
- func GetAbortStatus(protocol, microServiceName, schema, operation string) int
- func GetBool(key string, defaultValue bool) bool
- func GetCircuitBreakerEnabled(command, t string) bool
- func GetCircuitBreakerEnabledKey(command string) string
- func GetConfigs() map[string]interface{}
- func GetConfigsByDI(dimensionInfo string) map[string]interface{}
- func GetDefaultCircuitBreakerEnabledKey(t string) string
- func GetDefaultErrorPercentThreshold(t string) string
- func GetDefaultFallbackPolicyKey(t string) string
- func GetDefaultForceCloseKey(t string) string
- func GetDefaultForceFallbackKey(t string) string
- func GetDefaultForceOpenKey(t string) string
- func GetDefaultGetFallbackEnabledKey(t string) string
- func GetDefaultMaxConcurrentKey(t string) string
- func GetDefaultRequestVolumeThresholdKey(t string) string
- func GetDefaultSleepWindowKey(t string) string
- func GetDefaultTimeEnabledKey(t string) string
- func GetDefaultTimeoutKey(t string) string
- func GetDelayPercent(protocol, microServiceName, schema, operation string) int
- func GetErrorPercentThreshold(command, t string) int
- func GetErrorPercentThresholdKey(command string) string
- func GetFallbackEnabled(command, t string) bool
- func GetFallbackEnabledKey(command string) string
- func GetFallbackPolicyKey(command string) string
- func GetFaultAbortHTTPStatusKey(key, protocol string) string
- func GetFaultAbortPercentKey(key, protocol string) string
- func GetFaultDelayPercentKey(key, protocol string) string
- func GetFaultFixedDelayKey(key, protocol string) string
- func GetFaultInjectionGlobalKey() string
- func GetFaultInjectionOperationKey(microServiceName, schema, operation string) string
- func GetFaultInjectionSchemaKey(microServiceName, schema string) string
- func GetFaultInjectionServiceKey(microServiceName string) string
- func GetFilterNamesKey() string
- func GetFixedDelay(protocol, microServiceName, schema, operation string) time.Duration
- func GetFloat64(key string, defaultValue float64) float64
- func GetForceClose(command, t string) bool
- func GetForceCloseKey(command string) string
- func GetForceFallback(command, t string) bool
- func GetForceFallbackKey(command string) string
- func GetForceOpen(command, t string) bool
- func GetForceOpenKey(command string) string
- func GetHystrixSpecificKey(namespace, cmd, property string) string
- func GetInt(key string, defaultValue int) int
- func GetMaxConcurrentKey(command string) string
- func GetMaxConcurrentRequests(command, t string) int
- func GetPolicy(command, t string) string
- func GetRequestVolumeThreshold(command, t string) int
- func GetRequestVolumeThresholdKey(command string) string
- func GetServerListFilters() []string
- func GetSleepWindow(command, t string) int
- func GetSleepWindowKey(command string) string
- func GetString(key string, defaultValue string) string
- func GetStringByDI(dimensionInfo, key string, defaultValue string) string
- func GetTimeEnabledKey(command string) string
- func GetTimeout(command, t string) int
- func GetTimeoutEnabled(command, t string) bool
- func GetTimeoutKey(command string) string
- func Init() error
- func PathExist(_path string) bool
- func RegisterListener(listenerObj core.EventListener, key ...string) error
- func UnRegisterListener(listenerObj core.EventListener, key ...string) error
- func UnmarshalConfig(obj interface{}) error
- type Config
- type ConfigListener
- type EventListener
Constants ¶
const ( DefaultForceFallback = false DefaultTimeoutEnabled = false DefaultCircuitBreakerEnabled = true DefaultCircuitBreakerForceOpen = false DefaultCircuitBreakerForceClosed = false DefaultFallbackEnable = true DefaultMaxConcurrent = 1000 DefaultSleepWindow = 15000 DefaultTimeout = 30000 DefaultErrorPercentThreshold = 50 DefaultRequestVolumeThreshold = 20 PolicyNull = "returnnull" PolicyThrowException = "throwexception" )
constant for hystrix parameters
const ( DefaultAbortPercent = 0 DefaultAbortStatus = 0 DefaultDelayPercent = 0 )
constant for default values of abort and delay
const ( FixedPrefix = "cse" NamespaceIsolation = "isolation" NamespaceCircuitBreaker = "circuitBreaker" NamespaceFallback = "fallback" //降级 NamespaceFallbackpolicy = "fallbackpolicy" PropertyTimeoutInMilliseconds = "timeoutInMilliseconds" PropertyTimeoutEnabled = "timeout.enabled" PropertyMaxConcurrentRequests = "maxConcurrentRequests" PropertyErrorThresholdPercentage = "errorThresholdPercentage" //失败率 PropertyRequestVolumeThreshold = "requestVolumeThreshold" //窗口请求数 PropertySleepWindowInMilliseconds = "sleepWindowInMilliseconds" //熔断时间窗 PropertyEnabled = "enabled" PropertyForce = "force" PropertyPolicy = "policy" PropertyForceClosed = "forceClosed" PropertyForceOpen = "forceOpen" PropertyFault = "fault" PropertyGlobal = "_global" PropertyGovernance = "governance" PropertyConsumer = "Consumer" PropertySchema = "schemas" PropertyOperations = "operations" PropertyProtocol = "protocols" PropertyAbort = "abort" PropertyPercent = "percent" PropertyFixedDelay = "fixedDelay" PropertyDelay = "delay" PropertyHTTPStatus = "httpStatus" LoadBalance = "loadbalance" )
constant for hystrix keys
Variables ¶
This section is empty.
Functions ¶
func AddKeyValue ¶
AddKeyValue is for to add the configuration key, value pairs into the configfactory at run time
func GetAbortPercent ¶
GetAbortPercent get abort percentage
func GetAbortStatus ¶
GetAbortStatus get abort status
func GetCircuitBreakerEnabled ¶
GetCircuitBreakerEnabled get circuit breaker enabled
func GetCircuitBreakerEnabledKey ¶
GetCircuitBreakerEnabledKey get circuit breaker enabled key
func GetConfigs ¶
func GetConfigs() map[string]interface{}
GetConfigs gives the information about all configurations
func GetConfigsByDI ¶
GetConfigsByDI is for to get the all configurations received dimensionInfo
func GetDefaultCircuitBreakerEnabledKey ¶
GetDefaultCircuitBreakerEnabledKey get default circuit breaker enabled key
func GetDefaultErrorPercentThreshold ¶
GetDefaultErrorPercentThreshold get default error percentage threshold value
func GetDefaultFallbackPolicyKey ¶
GetDefaultFallbackPolicyKey get default fallback policy key
func GetDefaultForceCloseKey ¶
GetDefaultForceCloseKey get default force close key
func GetDefaultForceFallbackKey ¶
GetDefaultForceFallbackKey get default force fallback key
func GetDefaultForceOpenKey ¶
GetDefaultForceOpenKey get default force open key
func GetDefaultGetFallbackEnabledKey ¶
GetDefaultGetFallbackEnabledKey get default fallback enabled key
func GetDefaultMaxConcurrentKey ¶
GetDefaultMaxConcurrentKey get default maximum concurrent key
func GetDefaultRequestVolumeThresholdKey ¶
GetDefaultRequestVolumeThresholdKey get default request volume threshold key
func GetDefaultSleepWindowKey ¶
GetDefaultSleepWindowKey get default sleep window key
func GetDefaultTimeEnabledKey ¶
GetDefaultTimeEnabledKey get default time enabled key
func GetDefaultTimeoutKey ¶
GetDefaultTimeoutKey get default timeout key
func GetDelayPercent ¶
GetDelayPercent get delay percentage
func GetErrorPercentThreshold ¶
GetErrorPercentThreshold is to get error percentage threshold
func GetErrorPercentThresholdKey ¶
GetErrorPercentThresholdKey get error percentage threshold key
func GetFallbackEnabled ¶
GetFallbackEnabled get fallback enabled
func GetFallbackEnabledKey ¶
GetFallbackEnabledKey get fallback enabled key
func GetFallbackPolicyKey ¶
GetFallbackPolicyKey get fallback policy key
func GetFaultAbortHTTPStatusKey ¶
GetFaultAbortHTTPStatusKey get fault abort http status key
func GetFaultAbortPercentKey ¶
GetFaultAbortPercentKey get fault abort percentage key
func GetFaultDelayPercentKey ¶
GetFaultDelayPercentKey get fault daley percentage key
func GetFaultFixedDelayKey ¶
GetFaultFixedDelayKey get fault fixed delay key
func GetFaultInjectionGlobalKey ¶
func GetFaultInjectionGlobalKey() string
GetFaultInjectionGlobalKey get fault injection global key
func GetFaultInjectionOperationKey ¶
GetFaultInjectionOperationKey get fault injection operation key
func GetFaultInjectionSchemaKey ¶
GetFaultInjectionSchemaKey get fault injection schema key
func GetFaultInjectionServiceKey ¶
GetFaultInjectionServiceKey get fault injection service key
func GetFixedDelay ¶
GetFixedDelay get fixed delay
func GetFloat64 ¶
GetFloat64 gives the key value in the form of float64
func GetForceCloseKey ¶
GetForceCloseKey get force close key
func GetForceFallback ¶
GetForceFallback get force fallback
func GetForceFallbackKey ¶
GetForceFallbackKey get force fallback key
func GetForceOpenKey ¶
GetForceOpenKey get force open key
func GetHystrixSpecificKey ¶
GetHystrixSpecificKey get hystrix specific key
func GetMaxConcurrentKey ¶
GetMaxConcurrentKey get maximum concurrent key
func GetMaxConcurrentRequests ¶
GetMaxConcurrentRequests is to get maximum concurrent requests
func GetRequestVolumeThreshold ¶
GetRequestVolumeThreshold is to get request volume threshold
func GetRequestVolumeThresholdKey ¶
GetRequestVolumeThresholdKey get request volume threshold key
func GetServerListFilters ¶
func GetServerListFilters() []string
GetServerListFilters get server list filters
func GetSleepWindowKey ¶
GetSleepWindowKey get sleep window key
func GetStringByDI ¶
GetStringByDI is for to get the value of configuration key based on dimension info
func GetTimeEnabledKey ¶
GetTimeEnabledKey get time enabled key
func GetTimeoutEnabled ¶
GetTimeoutEnabled get timeout enabled
func RegisterListener ¶
func RegisterListener(listenerObj core.EventListener, key ...string) error
RegisterListener to Register all listener for different key changes, each key could be a regular expression
func UnRegisterListener ¶
func UnRegisterListener(listenerObj core.EventListener, key ...string) error
UnRegisterListener is to remove the listener
func UnmarshalConfig ¶
func UnmarshalConfig(obj interface{}) error
UnmarshalConfig is for unmarshalling the configuraions of receiving object
Types ¶
type Config ¶
type Config struct { ConfigFiles []string ConfigFactory goarchaius.ConfigurationFactory }
Config is the struct of configuration files, and configuration factory
var DefaultConf *Config
DefaultConf is the variable having information about configuration files, and configuration factory
type ConfigListener ¶
type ConfigListener struct{}
ConfigListener is provides the object to listen the events
func (*ConfigListener) Event ¶
func (cl *ConfigListener) Event(e *core.Event)
Event is for to receive the events based on registered key and object pairs
type EventListener ¶
type EventListener struct { Name string Factory goarchaius.ConfigurationFactory }
EventListener is a struct having information about registering key and object
func (EventListener) Event ¶
func (e EventListener) Event(event *core.Event)
Event is invoked while generating events at run time