servicecomb

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConsumerIsolationKey is a variable of type string
	ConsumerIsolationKey      = "cse.isolation"
	ConsumerCircuitBreakerKey = "cse.circuitBreaker"
	ConsumerFallbackKey       = "cse.fallback"
	ConsumerFallbackPolicyKey = "cse.fallbackpolicy"
)

constants for consumer isolation, circuit breaker, fallback keys

View Source
const (
	//LagerLevelKey is a variable of type string
	LagerLevelKey = "logLevel"
)
View Source
const (
	//LoadBalanceKey is variable of type string that matches load balancing events
	LoadBalanceKey = "^cse\\.loadbalance\\."
)

constants for loadbalancer strategy name, and timeout

View Source
const Prefix = "cse.flowcontrol"

Prefix is const

Variables

View Source
var (
	//key is service name
	LBConfigCache = cache.New(0, 0)
	//key is [Provider|Consumer]:service_name or [Consumer|Provider]
	CBConfigCache     = cache.New(0, 0)
	RLConfigCache     = cache.New(0, 0)
	EgressConfigCache = cache.New(0, 0)
	FIConfigCache     = cache.New(0, 0)
)

save configs

Default values

Functions

func FlushCircuitByKey added in v2.0.3

func FlushCircuitByKey(key string)

FlushCircuitByKey is a function used to flush for a particular key

func GetCBCacheKey

func GetCBCacheKey(serviceName, serviceType string) string

GetCBCacheKey generate cache key

func GetCircuitName added in v2.0.3

func GetCircuitName(sourceName, serviceName string) string

GetCircuitName is a function used to get circuit names

func GetNames added in v2.0.3

func GetNames(key string) (string, string)

GetNames is function

func GetQPSRate

func GetQPSRate(rateConfig string) (int, bool)

GetQPSRate get qps rate

func GetQPSRateWithPriority

func GetQPSRateWithPriority(cmd ...string) (int, string)

GetQPSRateWithPriority get qps rate with priority

func Init added in v2.0.3

func Init()

Init is a function

func RegisterKeys added in v2.0.3

func RegisterKeys(eventListener event.Listener, keys ...string)

RegisterKeys registers a config key to the archaius

func SaveToCBCache

func SaveToCBCache(raw *model.HystrixConfig)

SaveToCBCache save configs

func SaveToLBCache

func SaveToLBCache(raw *model.LoadBalancing)

SaveToLBCache save configs

Types

type CircuitBreakerEventListener added in v2.0.3

type CircuitBreakerEventListener struct {
	Key string
}

CircuitBreakerEventListener is a struct with one string variable

func (*CircuitBreakerEventListener) Event added in v2.0.3

func (el *CircuitBreakerEventListener) Event(e *event.Event)

Event is a method which triggers flush circuit

type ConsumerKeys

type ConsumerKeys struct {
	MicroServiceName       string
	SchemaQualifiedName    string
	OperationQualifiedName string
}

ConsumerKeys contain consumer keys

func GetConsumerKey

func GetConsumerKey(sourceName, serviceName, schemaID, OperationID string) *ConsumerKeys

GetConsumerKey get specific key for consumer

func (*ConsumerKeys) GetMicroServiceName

func (op *ConsumerKeys) GetMicroServiceName() string

GetMicroServiceName get micro-service name

func (*ConsumerKeys) GetMicroServiceSchemaOpQualifiedName

func (op *ConsumerKeys) GetMicroServiceSchemaOpQualifiedName() string

GetMicroServiceSchemaOpQualifiedName get micro-service schema operation qualified name

func (*ConsumerKeys) GetSchemaQualifiedName

func (op *ConsumerKeys) GetSchemaQualifiedName() string

GetSchemaQualifiedName get schema qualified name

type LagerEventListener added in v2.0.3

type LagerEventListener struct {
	//Key []string
	Key string
}

LagerEventListener is a struct used for Event listener

func (*LagerEventListener) Event added in v2.0.3

func (el *LagerEventListener) Event(e *event.Event)

Event is a method for Lager event listening

type LoadBalancingEventListener added in v2.0.3

type LoadBalancingEventListener struct {
	Key string
}

LoadBalancingEventListener is a struct

func (*LoadBalancingEventListener) Event added in v2.0.3

func (e *LoadBalancingEventListener) Event(evt *event.Event)

Event is a method used to handle a load balancing event

type Panel

type Panel struct {
}

Panel pull configs from archaius

func (*Panel) GetCircuitBreaker

func (p *Panel) GetCircuitBreaker(inv invocation.Invocation, serviceType string) (string, hystrix.CommandConfig)

GetCircuitBreaker return command , and circuit breaker settings

func (*Panel) GetEgressRule

func (p *Panel) GetEgressRule() []control.EgressConfig

GetEgressRule get egress config

func (*Panel) GetFaultInjection

func (p *Panel) GetFaultInjection(inv invocation.Invocation) model.Fault

GetFaultInjection get Fault injection config

func (*Panel) GetLoadBalancing

func (p *Panel) GetLoadBalancing(inv invocation.Invocation) control.LoadBalancingConfig

GetLoadBalancing get load balancing config

func (*Panel) GetRateLimiting

func (p *Panel) GetRateLimiting(inv invocation.Invocation, serviceType string) control.RateLimitingConfig

GetRateLimiting get rate limiting config

type ProviderKeys

type ProviderKeys struct {
	Global          string
	ServiceOriented string
}

ProviderKeys contain provider keys

func GetProviderKey

func GetProviderKey(sourceServiceName string) *ProviderKeys

GetProviderKey get specific key for provider

type QPSEventListener added in v2.0.3

type QPSEventListener struct {
	//Key []string
	Key string
}

QPSEventListener is a struct used for Event listener

func (*QPSEventListener) Event added in v2.0.3

func (el *QPSEventListener) Event(e *event.Event)

Event is a method for QPS event listening

Jump to

Keyboard shortcuts

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