MCPcopy
hub / github.com/grpc/grpc-go / buildBasicRLSConfigWithChildPolicy

Function buildBasicRLSConfigWithChildPolicy

balancer/rls/helpers_test.go:147–163  ·  view source on GitHub ↗

buildBasicRLSConfigWithChildPolicy constructs a very basic service config for the RLS LB policy. It also registers a test LB policy which is capable of being a child of the RLS LB policy.

(t *testing.T, childPolicyName, rlsServerAddress string)

Source from the content-addressed store, hash-verified

145// the RLS LB policy. It also registers a test LB policy which is capable of
146// being a child of the RLS LB policy.
147func buildBasicRLSConfigWithChildPolicy(t *testing.T, childPolicyName, rlsServerAddress string) *e2e.RLSConfig {
148 childPolicyName = "test-child-policy" + childPolicyName
149 e2e.RegisterRLSChildPolicy(childPolicyName, nil)
150 t.Logf("Registered child policy with name %q", childPolicyName)
151
152 return &e2e.RLSConfig{
153 RouteLookupConfig: &rlspb.RouteLookupConfig{
154 GrpcKeybuilders: []*rlspb.GrpcKeyBuilder{{Names: []*rlspb.GrpcKeyBuilder_Name{{Service: "grpc.testing.TestService"}}}},
155 LookupService: rlsServerAddress,
156 LookupServiceTimeout: durationpb.New(defaultTestTimeout),
157 CacheSizeBytes: 1024,
158 },
159 RouteLookupChannelServiceConfig: `{"loadBalancingConfig": [{"pick_first": {}}]}`,
160 ChildPolicy: &internalserviceconfig.BalancerConfig{Name: childPolicyName},
161 ChildPolicyConfigTargetFieldName: e2e.RLSChildPolicyTargetNameField,
162 }
163}
164
165// startBackend starts a backend implementing the TestService on a local port.
166// It returns a channel for tests to get notified whenever an RPC is invoked on

Calls 2

RegisterRLSChildPolicyFunction · 0.92
LogfMethod · 0.65

Tested by

no test coverage detected