From 2080600a5db96f5f040671f4f98f04b965287d33 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 19 Oct 2021 15:45:52 -0700 Subject: [PATCH 1/2] grpc: stabilize WithDefaultServiceConfig and improve godoc --- dialoptions.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dialoptions.go b/dialoptions.go index 5f7b7a164ce..c410cc1551d 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -518,14 +518,13 @@ func WithDisableServiceConfig() DialOption { // WithDefaultServiceConfig returns a DialOption that configures the default // service config, which will be used in cases where: // -// 1. WithDisableServiceConfig is also used. -// 2. Resolver does not return a service config or if the resolver returns an -// invalid service config. +// 1. WithDisableServiceConfig is also used, or // -// Experimental +// 2. The name resolver does not provide a service config or provides an +// invalid service config. // -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. +// For more information about service configs, see +// https://github.com/grpc/grpc/blob/master/doc/service_config.md func WithDefaultServiceConfig(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.defaultServiceConfigRawJSON = &s From 1a2c0737aeba1b99b498e67036030066f0347ba2 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 19 Oct 2021 15:56:41 -0700 Subject: [PATCH 2/2] moar --- dialoptions.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dialoptions.go b/dialoptions.go index c410cc1551d..2af1b6c2f14 100644 --- a/dialoptions.go +++ b/dialoptions.go @@ -523,8 +523,11 @@ func WithDisableServiceConfig() DialOption { // 2. The name resolver does not provide a service config or provides an // invalid service config. // -// For more information about service configs, see +// The parameter s is the JSON representation of the default service config. +// For more information about service configs, see: // https://github.com/grpc/grpc/blob/master/doc/service_config.md +// For a simple example of usage, see: +// examples/features/load_balancing/client/main.go func WithDefaultServiceConfig(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { o.defaultServiceConfigRawJSON = &s