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

Function svcConfig

balancer/weightedroundrobin/balancer_test.go:160–169  ·  view source on GitHub ↗
(t *testing.T, wrrCfg iwrr.LBConfig)

Source from the content-addressed store, hash-verified

158}
159
160func svcConfig(t *testing.T, wrrCfg iwrr.LBConfig) string {
161 t.Helper()
162 m, err := json.Marshal(wrrCfg)
163 if err != nil {
164 t.Fatalf("Error marshaling JSON %v: %v", wrrCfg, err)
165 }
166 sc := fmt.Sprintf(`{"loadBalancingConfig": [ {%q:%v} ] }`, wrr.Name, string(m))
167 t.Logf("Marshaled service config: %v", sc)
168 return sc
169}
170
171// Tests basic functionality with one address. With only one address, load
172// reporting doesn't affect routing at all.

Calls 3

MarshalMethod · 0.65
FatalfMethod · 0.65
LogfMethod · 0.65

Tested by

no test coverage detected