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

Function wrrLocality

test/xds/xds_client_custom_lb_test.go:58–70  ·  view source on GitHub ↗

wrrLocality is a helper that takes a proto message and returns a WrrLocalityProto with the proto message marshaled into a proto.Any as a child.

(t *testing.T, m proto.Message)

Source from the content-addressed store, hash-verified

56// WrrLocalityProto with the proto message marshaled into a proto.Any as a
57// child.
58func wrrLocality(t *testing.T, m proto.Message) *v3wrrlocalitypb.WrrLocality {
59 return &v3wrrlocalitypb.WrrLocality{
60 EndpointPickingPolicy: &v3clusterpb.LoadBalancingPolicy{
61 Policies: []*v3clusterpb.LoadBalancingPolicy_Policy{
62 {
63 TypedExtensionConfig: &v3corepb.TypedExtensionConfig{
64 TypedConfig: testutils.MarshalAny(t, m),
65 },
66 },
67 },
68 },
69 }
70}
71
72// clusterWithLBConfiguration returns a cluster resource with the proto message
73// passed Marshaled to an any and specified through the load_balancing_policy

Callers 1

TestWrrLocalityMethod · 0.70

Calls 1

MarshalAnyFunction · 0.92

Tested by

no test coverage detected