Documentation ¶
Index ¶
- Constants
- Variables
- func Init(opts Options) error
- func InstallPlugin(name string, f func(options Options) Panel)
- func NewCircuitName(serviceType, scope string, inv invocation.Invocation) string
- type EgressConfig
- type EgressPort
- type LoadBalancingConfig
- type Options
- type Panel
- type RateLimitingConfig
Constants ¶
const ( //ScopeAPI is config const ScopeAPI = "api" //ScopeInstance is config const ScopeInstance = "instance" //ScopeInstanceAPI is config const ScopeInstanceAPI = "instance-api" )
Variables ¶
var (
DefaultBurst = 10
)
Functions ¶
func InstallPlugin ¶
InstallPlugin install implementation
func NewCircuitName ¶
func NewCircuitName(serviceType, scope string, inv invocation.Invocation) string
NewCircuitName create circuit command string scope means has two choices, service and api if you set it to api, a api level command string will be created. like "Consumer.mall.rest./test" set to service, a service level command will be created, like "Consumer.mall"
Types ¶
type EgressConfig ¶
type EgressConfig struct { Hosts []string Ports []*EgressPort }
EgressConfig is a standardized model
type EgressPort ¶
EgressPort protocol and the corresponding port
type LoadBalancingConfig ¶
type LoadBalancingConfig struct { Strategy string Filters []string RetryEnabled bool RetryOnSame int RetryOnNext int BackOffKind string BackOffMin int BackOffMax int SessionTimeoutInSeconds int SuccessiveFailedTimes int }
LoadBalancingConfig is a standardized model
type Panel ¶
type Panel interface { GetCircuitBreaker(inv invocation.Invocation, serviceType string) (string, hystrix.CommandConfig) GetLoadBalancing(inv invocation.Invocation) LoadBalancingConfig GetRateLimiting(inv invocation.Invocation, serviceType string) RateLimitingConfig GetFaultInjection(inv invocation.Invocation) model.Fault GetEgressRule() []EgressConfig }
Panel is a abstraction of pulling configurations from various of systems, and transfer different configuration into standardized model you can use different panel implementation to pull different of configs from Istio or Archaius TODO able to set configs
var DefaultPanel Panel
DefaultPanel get fetch config
type RateLimitingConfig ¶
RateLimitingConfig is a standardized model