control

package
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

View Source
const (
	//ScopeAPI is config const
	ScopeAPI = "api"

	//ScopeInstance is config const
	ScopeInstance = "instance"

	//ScopeInstanceAPI is config const
	ScopeInstanceAPI = "instance-api"
)

Variables

This section is empty.

Functions

func Init

func Init(opts Options) error

Init initialize DefaultPanel

func InstallPlugin

func InstallPlugin(name string, f func(options Options) Panel)

InstallPlugin install implementation

func NewCircuitName added in v1.0.1

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 added in v1.1.1

type EgressConfig struct {
	Hosts []string
	Ports []*EgressPort
}

EgressConfig is a standardized model

type EgressPort added in v1.1.1

type EgressPort struct {
	Port     int32
	Protocol string
}

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 Options

type Options struct {
	Address string
	Infra   string
}

Options is for initiating control panel

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

type RateLimitingConfig struct {
	Key     string
	Enabled bool
	Rate    int
}

RateLimitingConfig is a standardized model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL