v5.1.0-release+incompa... Latest Latest

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

Go to latest
Published: Mar 14, 2019 License: LGPL-3.0 Imports: 18 Imported by: 0




View Source
const (
	//KeyPrefix request path prefix
	KeyPrefix string = "Prefix"
	//KeyHeaders request http headers
	KeyHeaders string = "Headers"
	//KeyDomains request domains
	KeyDomains string = "Domains"
	//KeyMaxConnections The maximum number of connections that Envoy will make to the upstream cluster. If not specified, the default is 1024.
	KeyMaxConnections string = "MaxConnections"
	//KeyMaxPendingRequests The maximum number of pending requests that Envoy will allow to the upstream cluster. If not specified, the default is 1024
	KeyMaxPendingRequests string = "MaxPendingRequests"
	//KeyMaxRequests The maximum number of parallel requests that Envoy will make to the upstream cluster. If not specified, the default is 1024.
	KeyMaxRequests string = "MaxRequests"
	//KeyMaxActiveRetries  The maximum number of parallel retries that Envoy will allow to the upstream cluster. If not specified, the default is 3.
	KeyMaxActiveRetries string = "MaxActiveRetries"
	//KeyUpStream upStream
	KeyUpStream string = "upStream"
	//KeyDownStream downStream
	KeyDownStream string = "downStream"
	//KeyWeight WEIGHT
	KeyWeight string = "Weight"
	//KeyWeightModel MODEL_WEIGHT
	KeyWeightModel string = "weight_model"
	//KeyPrefixModel MODEL_PREFIX
	KeyPrefixModel string = "prefix_model"
	//KeyIntervalMS IntervalMS key
	KeyIntervalMS string = "IntervalMS"
	//KeyConsecutiveErrors ConsecutiveErrors key
	KeyConsecutiveErrors string = "ConsecutiveErrors"
	//KeyBaseEjectionTimeMS BaseEjectionTimeMS key
	KeyBaseEjectionTimeMS string = "BaseEjectionTimeMS"
	//KeyMaxEjectionPercent MaxEjectionPercent key
	KeyMaxEjectionPercent string = "MaxEjectionPercent"


This section is empty.


func CheckWeightSum

func CheckWeightSum(clusters []*route.WeightedCluster_ClusterWeight, weight uint32) uint32

CheckWeightSum check all cluster weight sum

func ConverTimeDuration

func ConverTimeDuration(second int64) *types.Duration

ConverTimeDuration second

func ConversionUInt32

func ConversionUInt32(value uint32) *types.UInt32Value

ConversionUInt32 conversion uint32 to proto uint32

func CreatOutlierDetection

func CreatOutlierDetection(options RainbondPluginOptions) *cluster.OutlierDetection

CreatOutlierDetection create up cluster OutlierDetection

func CreateCircuitBreaker

func CreateCircuitBreaker(options RainbondPluginOptions) *cluster.CircuitBreakers

CreateCircuitBreaker create down cluster circuitbreaker

func CreateCluster

func CreateCluster(name, serviceName string, clusterType apiv2.Cluster_DiscoveryType,
	outlierDetection *cluster.OutlierDetection,
	circuitBreakers *cluster.CircuitBreakers,
	hosts []*core.Address) *apiv2.Cluster

CreateCluster create cluster config

func CreateEDSClusterConfig

func CreateEDSClusterConfig(serviceName string) *apiv2.Cluster_EdsClusterConfig

CreateEDSClusterConfig create grpc eds cluster config

func CreateHTTPListener

func CreateHTTPListener(name, address, statPrefix string, port uint32, routes ...route.VirtualHost) *apiv2.Listener

CreateHTTPListener create http manager listener

func CreateHeaderMatcher

func CreateHeaderMatcher(header v1.Header) *route.HeaderMatcher

CreateHeaderMatcher create http route config header matcher

func CreateRoute

func CreateRoute(clusterName, prefix string, headers []*route.HeaderMatcher, weight uint32) *route.Route

CreateRoute create http route

func CreateRouteVirtualHost

func CreateRouteVirtualHost(name string, domains []string, routes ...route.Route) *route.VirtualHost

CreateRouteVirtualHost create route virtual host

func CreateSocketAddress

func CreateSocketAddress(protocol, address string, port uint32) core.Address

CreateSocketAddress create socket address

func CreateTCPListener

func CreateTCPListener(name, clusterName, address, statPrefix string, port uint32) *apiv2.Listener

CreateTCPListener listener builder

func MessageToStruct

func MessageToStruct(msg proto.Message) *types.Struct

MessageToStruct converts from proto message to proto Struct

func ParseClustersResource

func ParseClustersResource(resources []types.Any) []v2.Cluster

ParseClustersResource parse envoy xds server response ParseClustersResource

func ParseListenerResource

func ParseListenerResource(resources []types.Any) []v2.Listener

ParseListenerResource parse envoy xds server response ListenersResource

func ParseLocalityLbEndpointsResource

func ParseLocalityLbEndpointsResource(resources []types.Any) []v2.ClusterLoadAssignment

ParseLocalityLbEndpointsResource parse envoy xds server response ParseLocalityLbEndpointsResource

func ParseRouteConfigurationsResource

func ParseRouteConfigurationsResource(resources []types.Any) []v2.RouteConfiguration

ParseRouteConfigurationsResource parse envoy xds server response RouteConfigurationsResource


type RainbondPluginOptions

type RainbondPluginOptions struct {
	Prefix             string
	MaxConnections     int
	MaxRequests        int
	MaxPendingRequests int
	MaxActiveRetries   int
	Headers            v1.Headers
	Domains            []string
	Weight             uint32
	Interval           int64
	ConsecutiveErrors  int
	BaseEjectionTimeMS int64
	MaxEjectionPercent int

RainbondPluginOptions rainbond plugin config struct

func GetOptionValues

func GetOptionValues(sr map[string]interface{}) RainbondPluginOptions

GetOptionValues get value from options if not exist,return default value

func (RainbondPluginOptions) RouteBasicHash

func (r RainbondPluginOptions) RouteBasicHash() string

RouteBasicHash get basic hash for weight

Jump to

Keyboard shortcuts

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