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

Function WithDefaultServiceConfig

dialoptions.go:672–676  ·  view source on GitHub ↗

WithDefaultServiceConfig returns a DialOption that configures the default service config, which will be used in cases where: 1. WithDisableServiceConfig is also used, or 2. The name resolver does not provide a service config or provides an invalid service config. The parameter s is the JSON repre

(s string)

Source from the content-addressed store, hash-verified

670// For a simple example of usage, see:
671// examples/features/load_balancing/client/main.go
672func WithDefaultServiceConfig(s string) DialOption {
673 return newFuncDialOption(func(o *dialOptions) {
674 o.defaultServiceConfigRawJSON = &s
675 })
676}
677
678// WithDisableRetry returns a DialOption that disables retries, even if the
679// service config enables them. This does not impact transparent retries, which

Calls 1

newFuncDialOptionFunction · 0.85