package e2e
import "google.golang.org/grpc/balancer/rls/internal/test/e2e"
Package e2e contains utilities for end-to-end RouteLookupService tests.
Index ¶
- Constants
- Variables
- func RegisterRLSChildPolicy(name string, bf *BalancerFuncs)
- type BalancerFuncs
- type RLSChildPolicyConfig
- type RLSConfig
Constants ¶
const ( // RLSChildPolicyTargetNameField is a top-level field name to add to the child // policy's config, whose value is set to the target for the child policy. RLSChildPolicyTargetNameField = "Backend" // RLSChildPolicyBadTarget is a value which is considered a bad target by the // child policy. This is useful to test bad child policy configuration. RLSChildPolicyBadTarget = "bad-target" )
Variables ¶
ErrParseConfigBadTarget is the error returned from ParseConfig when the backend field is set to RLSChildPolicyBadTarget.
Functions ¶
func RegisterRLSChildPolicy ¶
func RegisterRLSChildPolicy(name string, bf *BalancerFuncs)
RegisterRLSChildPolicy registers a balancer builder with the given name, to be used as a child policy for the RLS LB policy.
The child policy uses a pickfirst balancer under the hood to send all traffic to the single backend specified by the `RLSChildPolicyTargetNameField` field in its configuration which looks like: {"Backend": "Backend-address"}.
Types ¶
type BalancerFuncs ¶
type BalancerFuncs struct { UpdateClientConnState func(cfg *RLSChildPolicyConfig) error Close func() }
BalancerFuncs is a set of callbacks which get invoked when the corresponding method on the child policy is invoked.
type RLSChildPolicyConfig ¶
type RLSChildPolicyConfig struct { serviceconfig.LoadBalancingConfig Backend string // The target for which this child policy was created. Random string // A random field to test child policy config changes. }
RLSChildPolicyConfig is the LB config for the test child policy.
type RLSConfig ¶
type RLSConfig struct { RouteLookupConfig *rlspb.RouteLookupConfig RouteLookupChannelServiceConfig string ChildPolicy *internalserviceconfig.BalancerConfig ChildPolicyConfigTargetFieldName string }
RLSConfig is a utility type to build service config for the RLS LB policy.
func (*RLSConfig) LoadBalancingConfig ¶
func (c *RLSConfig) LoadBalancingConfig() (serviceconfig.LoadBalancingConfig, error)
LoadBalancingConfig generates load balancing config which can used as part of a ClientConnState update to the RLS LB policy.
func (*RLSConfig) ServiceConfigJSON ¶
ServiceConfigJSON generates service config with a load balancing config corresponding to the RLS LB policy.
Source Files ¶
e2e.go rls_child_policy.go rls_lb_config.go
- Version
- v1.70.0 (latest)
- Published
- Jan 23, 2025
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 19 hours ago –
Tools for package owners.