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

Function buildServerConfigs

internal/xds/xdsclient/clientimpl.go:179–203  ·  view source on GitHub ↗
(bootstrapSC []*bootstrap.ServerConfig, grpcTransportConfigs map[string]grpctransport.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig)

Source from the content-addressed store, hash-verified

177}
178
179func buildServerConfigs(bootstrapSC []*bootstrap.ServerConfig, grpcTransportConfigs map[string]grpctransport.Config, gServerCfgMap map[xdsclient.ServerConfig]*bootstrap.ServerConfig) ([]xdsclient.ServerConfig, error) {
180 var gServerCfg []xdsclient.ServerConfig
181 for _, sc := range bootstrapSC {
182 if err := populateGRPCTransportConfigsFromServerConfig(sc, grpcTransportConfigs); err != nil {
183 return nil, err
184 }
185 var serverFeatures xdsclient.ServerFeature
186 if sc.ServerFeaturesIgnoreResourceDeletion() {
187 serverFeatures = serverFeatures | xdsclient.ServerFeatureIgnoreResourceDeletion
188 }
189 if sc.ServerFeaturesTrustedXDSServer() {
190 serverFeatures = serverFeatures | xdsclient.ServerFeatureTrustedXDSServer
191 }
192 gsc := xdsclient.ServerConfig{
193 ServerIdentifier: clients.ServerIdentifier{
194 ServerURI: sc.ServerURI(),
195 Extensions: grpctransport.ServerIdentifierExtension{ConfigName: sc.SelectedChannelCreds().Type},
196 },
197 ServerFeature: serverFeatures,
198 }
199 gServerCfg = append(gServerCfg, gsc)
200 gServerCfgMap[gsc] = sc
201 }
202 return gServerCfg, nil
203}
204
205// BuildXDSClientConfig builds the xdsclient.Config from the bootstrap.Config.
206//

Callers 1

BuildXDSClientConfigFunction · 0.85

Tested by

no test coverage detected