Documentation ¶
Index ¶
- Constants
- func CheckWeightSum(clusters []*route.WeightedCluster_ClusterWeight, weight uint32) uint32
- func ConverTimeDuration(second int64) *types.Duration
- func ConversionUInt32(value uint32) *types.UInt32Value
- func CreatOutlierDetection(options RainbondPluginOptions) *cluster.OutlierDetection
- func CreateCircuitBreaker(options RainbondPluginOptions) *cluster.CircuitBreakers
- func CreateCluster(name, serviceName string, clusterType apiv2.Cluster_DiscoveryType, ...) *apiv2.Cluster
- func CreateEDSClusterConfig(serviceName string) *apiv2.Cluster_EdsClusterConfig
- func CreateHTTPListener(name, address, statPrefix string, port uint32, routes ...route.VirtualHost) *apiv2.Listener
- func CreateHeaderMatcher(header v1.Header) *route.HeaderMatcher
- func CreateRoute(clusterName, prefix string, headers []*route.HeaderMatcher, weight uint32) *route.Route
- func CreateRouteVirtualHost(name string, domains []string, routes ...route.Route) *route.VirtualHost
- func CreateSocketAddress(protocol, address string, port uint32) core.Address
- func CreateTCPListener(name, clusterName, address, statPrefix string, port uint32) *apiv2.Listener
- func MessageToStruct(msg proto.Message) *types.Struct
- func ParseClustersResource(resources []types.Any) []v2.Cluster
- func ParseListenerResource(resources []types.Any) []v2.Listener
- func ParseLocalityLbEndpointsResource(resources []types.Any) []v2.ClusterLoadAssignment
- func ParseRouteConfigurationsResource(resources []types.Any) []v2.RouteConfiguration
- type RainbondPluginOptions
Constants ¶
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" )
Variables ¶
This section is empty.
Functions ¶
func CheckWeightSum ¶
func CheckWeightSum(clusters []*route.WeightedCluster_ClusterWeight, weight uint32) uint32
CheckWeightSum check all cluster weight sum
func ConverTimeDuration ¶
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 ¶
CreateSocketAddress create socket address
func CreateTCPListener ¶
CreateTCPListener listener builder
func MessageToStruct ¶
MessageToStruct converts from proto message to proto Struct
func ParseClustersResource ¶
ParseClustersResource parse envoy xds server response ParseClustersResource
func ParseListenerResource ¶
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
Types ¶
type RainbondPluginOptions ¶
type RainbondPluginOptions struct { Prefix string MaxConnections int MaxRequests int MaxPendingRequests int MaxActiveRetries int Headers v1.Headers Domains []string Weight uint32 //second 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