Documentation ¶
Index ¶
- Constants
- Variables
- type APMStruct
- type Abort
- type BackoffStrategy
- type ChainStruct
- type CircuitBreakPropertyStruct
- type CircuitBreakerSpec
- type CircuitWrapper
- type Config
- type ConfigAPIVersionStruct
- type ConfigClient
- type ContractDiscoveryStruct
- type ControlPanel
- type CredentialStruct
- type CseStruct
- type DataCenterInfo
- type Delay
- type FallbackPolicyPropertyStruct
- type FallbackPolicySpec
- type FallbackPolicyWrapper
- type FallbackPropertyStruct
- type FallbackSpec
- type FallbackWrapper
- type Fault
- type FaultProtocolStruct
- type FlowControl
- type GlobalCfg
- type HandlerStruct
- type HystrixConfig
- type HystrixConfigWrapper
- type IsolationPropertyStruct
- type IsolationSpec
- type IsolationWrapper
- type LBWrapper
- type LoadBalancing
- type LoadBalancingConfig
- type LoadBalancingSpec
- type MetricsStruct
- type MicServiceStruct
- type MicroserviceCfg
- type MonitorAPIVersionStruct
- type MonitorCfg
- type MonitorClientStruct
- type MonitorStruct
- type Protocol
- type QPS
- type QPSProps
- type ReferencesStruct
- type RegistratorStruct
- type RegistryAPIVersionStruct
- type RegistryStruct
- type ServiceCombStruct
- type ServiceDiscoveryStruct
- type ServicePathStruct
- type ServiceStruct
- type SessionStickinessRule
- type TracingStruct
- type Transport
Constants ¶
const ( ConsumerType = "Consumer" ProviderType = "Provider" )
constant for consumer and provider
Variables ¶
var ( //default config fo hystric. DefaultIsolation = IsolationPropertyStruct{ TimeoutInMilliseconds: 1000, MaxConcurrentRequests: 4000, } DefaultCircuit = CircuitBreakPropertyStruct{ Enabled: true, ForceOpen: false, ForceClose: false, SleepWindowInMilliseconds: 5000, RequestVolumeThreshold: 20, ErrorThresholdPercentage: 50, } DefaultFallback = FallbackPropertyStruct{ Enabled: true, MaxConcurrentRequests: 4000, } )
variables of isolation, circuit, fallback
Functions ¶
This section is empty.
Types ¶
type APMStruct ¶ added in v1.8.0
type APMStruct struct {
Tracing TracingStruct `yaml:"tracing"`
}
APMStruct is for Application Performance Management
type BackoffStrategy ¶
type BackoffStrategy struct { Kind string `yaml:"kind"` MinMs int `yaml:"minMs"` MaxMs int `yaml:"maxMs"` }
BackoffStrategy back off strategy
type ChainStruct ¶
type ChainStruct struct { Consumer map[string]string `yaml:"Consumer"` Provider map[string]string `yaml:"Provider"` }
ChainStruct 调用链信息
type CircuitBreakPropertyStruct ¶
type CircuitBreakPropertyStruct struct { Enabled bool `yaml:"enabled"` ForceOpen bool `yaml:"forceOpen"` ForceClose bool `yaml:"forceClosed"` SleepWindowInMilliseconds int `yaml:"sleepWindowInMilliseconds"` RequestVolumeThreshold int `yaml:"requestVolumeThreshold"` ErrorThresholdPercentage int `yaml:"errorThresholdPercentage"` }
CircuitBreakPropertyStruct circuitBreaker 属性集合
type CircuitBreakerSpec ¶
type CircuitBreakerSpec struct { Enabled bool `yaml:"enabled"` ForceOpen bool `yaml:"forceOpen"` ForceClose bool `yaml:"forceClosed"` SleepWindowInMilliseconds int `yaml:"sleepWindowInMilliseconds"` RequestVolumeThreshold int `yaml:"requestVolumeThreshold"` ErrorThresholdPercentage int `yaml:"errorThresholdPercentage"` AnyService map[string]CircuitBreakPropertyStruct `yaml:",inline"` }
CircuitBreakerSpec circuit breaker specifications
type CircuitWrapper ¶
type CircuitWrapper struct { Scope string `yaml:"scope"` Consumer *CircuitBreakerSpec `yaml:"Consumer"` Provider *CircuitBreakerSpec `yaml:"Provider"` }
CircuitWrapper circuit wrapper structure
type Config ¶ added in v1.3.0
type Config struct {
Client ConfigClient `yaml:"client"`
}
Config represent config center configurations
type ConfigAPIVersionStruct ¶
type ConfigAPIVersionStruct struct {
Version string `yaml:"version"`
}
ConfigAPIVersionStruct is the structure for configuration API version
type ConfigClient ¶ added in v1.3.0
type ConfigClient struct { Type string `yaml:"type"` ServerURI string `yaml:"serverUri"` TenantName string `yaml:"tenantName"` RefreshMode int `yaml:"refreshMode"` RefreshInterval int `yaml:"refreshInterval"` RefreshPort string `yaml:"refreshPort"` Autodiscovery bool `yaml:"autodiscovery"` APIVersion ConfigAPIVersionStruct `yaml:"api"` Enabled bool `yaml:"enabled"` Dimension map[string]string `yaml:"dimension"` }
ConfigClient client structure
type ContractDiscoveryStruct ¶
type ContractDiscoveryStruct struct { Disable bool `yaml:"disabled"` Type string `yaml:"type"` Address string `yaml:"address"` RefreshInterval string `yaml:"refreshInterval"` Tenant string `yaml:"tenant"` APIVersion RegistryAPIVersionStruct `yaml:"api"` }
ContractDiscoveryStruct contract discovery config struct
type ControlPanel ¶ added in v0.7.1
type ControlPanel struct { Infra string `yaml:"infra"` Settings map[string]string `yaml:"settings"` }
ControlPanel define control panel config
type CredentialStruct ¶
type CredentialStruct struct { AccessKey string `yaml:"accessKey"` SecretKey string `yaml:"secretKey"` AkskCustomCipher string `yaml:"akskCustomCipher"` Project string `yaml:"project"` }
CredentialStruct aksk信息
type CseStruct ¶
type CseStruct struct { Config Config `yaml:"config"` Service ServiceStruct `yaml:"service"` Protocols map[string]Protocol `yaml:"protocols"` Handler HandlerStruct `yaml:"handler"` References map[string]ReferencesStruct `yaml:"references"` //Deprecated FlowControl FlowControl `yaml:"flowcontrol"` Monitor MonitorStruct `yaml:"monitor"` Metrics MetricsStruct `yaml:"metrics"` Credentials CredentialStruct `yaml:"credentials"` Transport Transport `yaml:"transport"` NoRefreshSchema bool `yaml:"noRefreshSchema"` }
CseStruct 设置注册中心SC的地址,要开哪些传输协议, 调用链信息等
type DataCenterInfo ¶
type DataCenterInfo struct { Name string `yaml:"name"` Region string `yaml:"region"` AvailableZone string `yaml:"availableZone"` }
DataCenterInfo gives data center information
type FallbackPolicyPropertyStruct ¶
type FallbackPolicyPropertyStruct struct {
Policy string `yaml:"policy"`
}
FallbackPolicyPropertyStruct fallback policy property structure
type FallbackPolicySpec ¶
type FallbackPolicySpec struct { Policy string `yaml:"policy"` AnyService map[string]FallbackPolicyPropertyStruct `yaml:",inline"` }
FallbackPolicySpec fallback policy specifications
type FallbackPolicyWrapper ¶
type FallbackPolicyWrapper struct { Consumer *FallbackPolicySpec `yaml:"Consumer"` Provider *FallbackPolicySpec `yaml:"Provider"` }
FallbackPolicyWrapper fallback policy wrapper
type FallbackPropertyStruct ¶
type FallbackPropertyStruct struct { Enabled bool `yaml:"enabled"` Force bool `yaml:"force"` MaxConcurrentRequests int `yaml:"maxConcurrentRequests"` }
FallbackPropertyStruct fallback property structure
type FallbackSpec ¶
type FallbackSpec struct { Enabled bool `yaml:"enabled"` Force bool `yaml:"force"` MaxConcurrentRequests int `yaml:"maxConcurrentRequests"` AnyService map[string]FallbackPropertyStruct `yaml:",inline"` }
FallbackSpec fallback specifications
type FallbackWrapper ¶
type FallbackWrapper struct { Consumer *FallbackSpec `yaml:"Consumer"` Provider *FallbackSpec `yaml:"Provider"` }
FallbackWrapper fallback wrapper structure
type FaultProtocolStruct ¶
FaultProtocolStruct fault protocol struct
type FlowControl ¶ added in v0.7.1
FlowControl used to define rate limiting
type GlobalCfg ¶
type GlobalCfg struct { AppID string `yaml:"APPLICATION_ID"` //Deprecated Cse CseStruct `yaml:"cse"` Panel ControlPanel `yaml:"control"` Ssl map[string]string `yaml:"ssl"` Tracing TracingStruct `yaml:"tracing"` DataCenter *DataCenterInfo `yaml:"region"` }
GlobalCfg chassis.yaml 配置项
type HandlerStruct ¶
type HandlerStruct struct {
Chain ChainStruct `yaml:"chain"`
}
HandlerStruct 调用链信息
type HystrixConfig ¶
type HystrixConfig struct { IsolationProperties *IsolationWrapper `yaml:"isolation"` CircuitBreakerProperties *CircuitWrapper `yaml:"circuitBreaker"` FallbackProperties *FallbackWrapper `yaml:"fallback"` FallbackPolicyProperties *FallbackPolicyWrapper `yaml:"fallbackpolicy"` }
HystrixConfig is hystrix configuration structure
type HystrixConfigWrapper ¶
type HystrixConfigWrapper struct {
HystrixConfig *HystrixConfig `yaml:"cse"`
}
HystrixConfigWrapper hystrix configuration wrapper structure
func (*HystrixConfigWrapper) String ¶
func (hc *HystrixConfigWrapper) String() ([]byte, error)
String returns marshalling data of hystrix config wrapper
type IsolationPropertyStruct ¶
type IsolationPropertyStruct struct { TimeoutInMilliseconds int `yaml:"timeoutInMilliseconds"` MaxConcurrentRequests int `yaml:"maxConcurrentRequests"` }
IsolationPropertyStruct isolation 属性集合
type IsolationSpec ¶
type IsolationSpec struct { TimeoutInMilliseconds int `yaml:"timeoutInMilliseconds"` MaxConcurrentRequests int `yaml:"maxConcurrentRequests"` AnyService map[string]IsolationSpec `yaml:",inline"` }
IsolationSpec isolation speciafications
type IsolationWrapper ¶
type IsolationWrapper struct { Consumer *IsolationSpec `yaml:"Consumer"` Provider *IsolationSpec `yaml:"Provider"` }
IsolationWrapper isolation wrapper structure
type LBWrapper ¶
type LBWrapper struct {
Prefix *LoadBalancingConfig `yaml:"cse"`
}
LBWrapper loadbalancing structure
type LoadBalancing ¶
type LoadBalancing struct { Strategy map[string]string `yaml:"strategy"` RetryEnabled bool `yaml:"retryEnabled"` RetryOnNext int `yaml:"retryOnNext"` RetryOnSame int `yaml:"retryOnSame"` Filters string `yaml:"serverListFilters"` Backoff BackoffStrategy `yaml:"backoff"` SessionStickinessRule SessionStickinessRule `yaml:"SessionStickinessRule"` AnyService map[string]LoadBalancingSpec `yaml:",inline"` }
LoadBalancing loadbalancing structure
type LoadBalancingConfig ¶
type LoadBalancingConfig struct {
LBConfig *LoadBalancing `yaml:"loadbalance"`
}
LoadBalancingConfig loadbalancing structure
type LoadBalancingSpec ¶
type LoadBalancingSpec struct { Strategy map[string]string `yaml:"strategy"` SessionStickinessRule SessionStickinessRule `yaml:"SessionStickinessRule"` RetryEnabled bool `yaml:"retryEnabled"` RetryOnNext int `yaml:"retryOnNext"` RetryOnSame int `yaml:"retryOnSame"` Backoff BackoffStrategy `yaml:"backoff"` }
LoadBalancingSpec loadbalancing structure
type MetricsStruct ¶
type MetricsStruct struct { APIPath string `yaml:"apiPath"` FlushInterval string `yaml:"flushInterval"` Enable bool `yaml:"enable"` EnableGoRuntimeMetrics bool `yaml:"enableGoRuntimeMetrics"` EnableCircuitMetrics bool `yaml:"enableCircuitMetrics"` CircuitMetricsConsumerNum int `yaml:"circuitMetricsConsumerNum"` }
MetricsStruct metrics struct
type MicServiceStruct ¶
type MicServiceStruct struct { Name string `yaml:"name"` Hostname string `yaml:"hostname"` Version string `yaml:"version"` Environment string `yaml:"environment"` Level string `yaml:"level"` Properties map[string]string `yaml:"properties"` InstanceProperties map[string]string `yaml:"instance_properties"` ServicePaths []ServicePathStruct `yaml:"paths"` ServicesStatus string `yaml:"status"` }
MicServiceStruct 设置微服务的私有属性
type MicroserviceCfg ¶
type MicroserviceCfg struct { AppID string `yaml:"APPLICATION_ID"` Provider string `yaml:"Provider"` ServiceDescription MicServiceStruct `yaml:"service_description"` }
MicroserviceCfg microservice.yaml 配置项
type MonitorAPIVersionStruct ¶
type MonitorAPIVersionStruct struct {
Version string `yaml:"version"`
}
MonitorAPIVersionStruct monitor API version struct
type MonitorCfg ¶ added in v1.8.0
type MonitorCfg struct {
ServiceComb ServiceCombStruct `yaml:"servicecomb"`
}
MonitorCfg monitoring.yaml 配置项
type MonitorClientStruct ¶
type MonitorClientStruct struct { ServerURI string `yaml:"serverUri"` Enable bool `yaml:"enable"` UserName string `yaml:"userName"` DomainName string `yaml:"domainName"` APIVersion MonitorAPIVersionStruct `yaml:"api"` }
MonitorClientStruct monitor client struct
type MonitorStruct ¶
type MonitorStruct struct {
Client MonitorClientStruct `yaml:"client"`
}
MonitorStruct is the struct for monitoring parameters
type Protocol ¶
type Protocol struct { Listen string `yaml:"listenAddress"` Advertise string `yaml:"advertiseAddress"` WorkerNumber int `yaml:"workerNumber"` Transport string `yaml:"transport"` }
Protocol protocol structure
type QPS ¶ added in v0.7.1
type QPS struct {
QPS QPSProps `yaml:"qps"`
}
QPS is the struct to define QPS
type QPSProps ¶ added in v0.7.1
type QPSProps struct { Enabled bool `yaml:"enabled"` Global map[string]int `yaml:"global"` Limit map[string]string `yaml:"limit"` }
QPSProps define rate limiting settings
type ReferencesStruct ¶
type ReferencesStruct struct { Version string `yaml:"version"` Transport string `yaml:"transport"` }
ReferencesStruct references structure
type RegistratorStruct ¶
type RegistratorStruct struct { Disable bool `yaml:"disabled"` Type string `yaml:"type"` Scope string `yaml:"scope"` Address string `yaml:"address"` RefreshInterval string `yaml:"refreshInterval"` Tenant string `yaml:"tenant"` AutoRegister string `yaml:"register"` APIVersion RegistryAPIVersionStruct `yaml:"api"` }
RegistratorStruct service registry config struct
type RegistryAPIVersionStruct ¶
type RegistryAPIVersionStruct struct {
Version string `yaml:"version"`
}
RegistryAPIVersionStruct registry api version structure
type RegistryStruct ¶
type RegistryStruct struct { // NOTE: this part of struct would be deperacated later // please use registrator instead Disable bool `yaml:"disabled"` Type string `yaml:"type"` Scope string `yaml:"scope"` AutoDiscovery bool `yaml:"autodiscovery"` AutoIPIndex bool `yaml:"autoIPIndex"` Address string `yaml:"address"` RefreshInterval string `yaml:"refreshInterval"` Watch bool `yaml:"watch"` Tenant string `yaml:"tenant"` AutoRegister string `yaml:"register"` APIVersion RegistryAPIVersionStruct `yaml:"api"` // Use Registrator ServiceDiscovery and ContractDiscovery // to define information about service registry Registrator RegistratorStruct `yaml:"registrator"` ServiceDiscovery ServiceDiscoveryStruct `yaml:"serviceDiscovery"` ContractDiscovery ContractDiscoveryStruct `yaml:"contractDiscovery"` HealthCheck bool `yaml:"healthCheck"` CacheIndex bool `yaml:"cacheIndex"` }
RegistryStruct SC information
type ServiceCombStruct ¶ added in v1.8.0
type ServiceCombStruct struct {
APM APMStruct `yaml:"apm"`
}
ServiceCombStruct structure is for config of servicecomb
type ServiceDiscoveryStruct ¶
type ServiceDiscoveryStruct struct { Disable bool `yaml:"disabled"` Type string `yaml:"type"` AutoDiscovery bool `yaml:"autodiscovery"` AutoIPIndex bool `yaml:"autoIPIndex"` Address string `yaml:"address"` RefreshInterval string `yaml:"refreshInterval"` Watch bool `yaml:"watch"` Tenant string `yaml:"tenant"` ConfigPath string `yaml:"configPath"` APIVersion RegistryAPIVersionStruct `yaml:"api"` HealthCheck bool `yaml:"healthCheck"` }
ServiceDiscoveryStruct service discovery config struct
type ServicePathStruct ¶ added in v1.1.1
type ServicePathStruct struct { Path string `yaml:"path"` Property map[string]string `yaml:"property"` }
ServicePathStruct having info about service path and property
type ServiceStruct ¶
type ServiceStruct struct {
Registry RegistryStruct `yaml:"registry"`
}
ServiceStruct SC information
type SessionStickinessRule ¶
type SessionStickinessRule struct { SessionTimeoutInSeconds int `yaml:"sessionTimeoutInSeconds"` SuccessiveFailedTimes int `yaml:"successiveFailedTimes"` }
SessionStickinessRule loadbalancing structure
type TracingStruct ¶
type TracingStruct struct { Tracer string `yaml:"tracer"` Settings map[string]string `yaml:"settings"` }
TracingStruct tracing structure