From b3b211dc1cde244d2c6d7946a634d870f50504a1 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Sun, 22 Sep 2024 15:07:26 +0530 Subject: [PATCH 1/8] Improving comments for feature examples --- examples/features/authz/client/main.go | 3 ++- examples/features/authz/server/main.go | 3 ++- examples/features/cancellation/client/main.go | 3 ++- examples/features/cancellation/server/main.go | 3 ++- examples/features/compression/client/main.go | 3 ++- examples/features/compression/server/main.go | 3 ++- examples/features/deadline/client/main.go | 3 ++- examples/features/deadline/server/main.go | 3 ++- examples/features/debugging/client/main.go | 3 ++- examples/features/debugging/server/main.go | 3 ++- examples/features/encryption/ALTS/client/main.go | 3 ++- examples/features/encryption/ALTS/server/main.go | 3 ++- examples/features/encryption/TLS/client/main.go | 3 ++- examples/features/encryption/TLS/server/main.go | 2 +- examples/features/error_details/client/main.go | 2 +- examples/features/error_details/server/main.go | 2 +- examples/features/error_handling/client/main.go | 2 +- examples/features/error_handling/server/main.go | 3 ++- examples/features/flow_control/client/main.go | 3 ++- examples/features/flow_control/server/main.go | 3 ++- examples/features/health/client/main.go | 3 ++- examples/features/health/server/main.go | 3 ++- examples/features/interceptor/client/main.go | 3 ++- examples/features/interceptor/server/main.go | 3 ++- examples/features/keepalive/client/main.go | 3 ++- examples/features/keepalive/server/main.go | 3 ++- examples/features/load_balancing/client/main.go | 3 ++- examples/features/load_balancing/server/main.go | 3 ++- examples/features/metadata/client/main.go | 2 +- examples/features/metadata/server/main.go | 2 +- examples/features/metadata_interceptor/client/main.go | 3 ++- examples/features/metadata_interceptor/server/main.go | 2 +- examples/features/multiplex/client/main.go | 3 ++- examples/features/multiplex/server/main.go | 3 ++- examples/features/name_resolving/client/main.go | 3 ++- examples/features/name_resolving/server/main.go | 3 ++- examples/features/observability/client/main.go | 3 ++- examples/features/observability/server/main.go | 3 ++- examples/features/orca/client/main.go | 2 +- examples/features/orca/server/main.go | 3 ++- examples/features/reflection/server/main.go | 3 ++- examples/features/retry/client/main.go | 3 ++- examples/features/retry/server/main.go | 2 +- 43 files changed, 77 insertions(+), 43 deletions(-) diff --git a/examples/features/authz/client/main.go b/examples/features/authz/client/main.go index b4f5fca59641..8b67f620adc9 100644 --- a/examples/features/authz/client/main.go +++ b/examples/features/authz/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to include authorization credentials in the +// form of metadata for every RPC for server side validation. package main import ( diff --git a/examples/features/authz/server/main.go b/examples/features/authz/server/main.go index 55cf26a7e800..9e699ca5fd33 100644 --- a/examples/features/authz/server/main.go +++ b/examples/features/authz/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to validate authorization credential metadata +// for incoming RPCs. package main import ( diff --git a/examples/features/cancellation/client/main.go b/examples/features/cancellation/client/main.go index 8473416cc385..e5c1044e2e49 100644 --- a/examples/features/cancellation/client/main.go +++ b/examples/features/cancellation/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to cancel in-flight RPCs by canceling the +// context passed to the RPC call. package main import ( diff --git a/examples/features/cancellation/server/main.go b/examples/features/cancellation/server/main.go index 520286bf193e..53a3a6130641 100644 --- a/examples/features/cancellation/server/main.go +++ b/examples/features/cancellation/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to handle canceled contexts when a client +// cancels an in-flight RPC. package main import ( diff --git a/examples/features/compression/client/main.go b/examples/features/compression/client/main.go index 0ca447f07299..482acfedb2e6 100644 --- a/examples/features/compression/client/main.go +++ b/examples/features/compression/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to specify compression options when performing +// RPCs. package main import ( diff --git a/examples/features/compression/server/main.go b/examples/features/compression/server/main.go index 2dd50a72a96c..6e8148e2d43f 100644 --- a/examples/features/compression/server/main.go +++ b/examples/features/compression/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to install and support compressors for +// incoming RPCs. package main import ( diff --git a/examples/features/deadline/client/main.go b/examples/features/deadline/client/main.go index 8c13eb85377b..08de2e497cd7 100644 --- a/examples/features/deadline/client/main.go +++ b/examples/features/deadline/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to set deadlines for RPCs and handle +// deadline-exceeded errors. package main import ( diff --git a/examples/features/deadline/server/main.go b/examples/features/deadline/server/main.go index a6e7a9b49794..ffd221985513 100644 --- a/examples/features/deadline/server/main.go +++ b/examples/features/deadline/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to handle RPCs with deadlines and propagate +// deadlines in requests. package main import ( diff --git a/examples/features/debugging/client/main.go b/examples/features/debugging/client/main.go index 37b120f4339d..f502ba434508 100644 --- a/examples/features/debugging/client/main.go +++ b/examples/features/debugging/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use logging and Channelz for debugging +// gRPC operations. package main import ( diff --git a/examples/features/debugging/server/main.go b/examples/features/debugging/server/main.go index 81939d9cd0fb..5dd31af9cedc 100644 --- a/examples/features/debugging/server/main.go +++ b/examples/features/debugging/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to enable logging and Channelz for debugging +// gRPC services. package main import ( diff --git a/examples/features/encryption/ALTS/client/main.go b/examples/features/encryption/ALTS/client/main.go index b0778ec6bb9a..5ac1f98574dc 100644 --- a/examples/features/encryption/ALTS/client/main.go +++ b/examples/features/encryption/ALTS/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use ALTS credentials for secure +// gRPC communication. package main import ( diff --git a/examples/features/encryption/ALTS/server/main.go b/examples/features/encryption/ALTS/server/main.go index 98337f3f3254..174e188a453b 100644 --- a/examples/features/encryption/ALTS/server/main.go +++ b/examples/features/encryption/ALTS/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to use ALTS credentials to secure gRPC +// services. package main import ( diff --git a/examples/features/encryption/TLS/client/main.go b/examples/features/encryption/TLS/client/main.go index 27e978065885..ff53c7a1e1ac 100644 --- a/examples/features/encryption/TLS/client/main.go +++ b/examples/features/encryption/TLS/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use TLS credentials for secure +// gRPC communication. package main import ( diff --git a/examples/features/encryption/TLS/server/main.go b/examples/features/encryption/TLS/server/main.go index 2003134da213..82162a99bb52 100644 --- a/examples/features/encryption/TLS/server/main.go +++ b/examples/features/encryption/TLS/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to use TLS credentials to secure gRPC services. package main import ( diff --git a/examples/features/error_details/client/main.go b/examples/features/error_details/client/main.go index 7e54135a6365..d7fc9cc052e8 100644 --- a/examples/features/error_details/client/main.go +++ b/examples/features/error_details/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to handle error messages from a gRPC server. package main import ( diff --git a/examples/features/error_details/server/main.go b/examples/features/error_details/server/main.go index 0ff936ea643a..798513b04a8e 100644 --- a/examples/features/error_details/server/main.go +++ b/examples/features/error_details/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to provide error messages in gRPC responses. package main import ( diff --git a/examples/features/error_handling/client/main.go b/examples/features/error_handling/client/main.go index 3a15bf146f61..7eadaad38f12 100644 --- a/examples/features/error_handling/client/main.go +++ b/examples/features/error_handling/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to handle errors returned by a gRPC server. package main import ( diff --git a/examples/features/error_handling/server/main.go b/examples/features/error_handling/server/main.go index 80229e1e2966..44c880912afe 100644 --- a/examples/features/error_handling/server/main.go +++ b/examples/features/error_handling/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to return specific error codes in gRPC +// responses. package main import ( diff --git a/examples/features/flow_control/client/main.go b/examples/features/flow_control/client/main.go index b1296f529e1a..eeba8a2432e5 100644 --- a/examples/features/flow_control/client/main.go +++ b/examples/features/flow_control/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how the gRPC flow control blocks sending when the +// receiver is not ready. package main import ( diff --git a/examples/features/flow_control/server/main.go b/examples/features/flow_control/server/main.go index 5452c3e622a5..af03f0d5000c 100644 --- a/examples/features/flow_control/server/main.go +++ b/examples/features/flow_control/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how gRPC flow control block sending when the +// receiver is not ready. package main import ( diff --git a/examples/features/health/client/main.go b/examples/features/health/client/main.go index cf47409c4b3f..dc5382a40a9e 100644 --- a/examples/features/health/client/main.go +++ b/examples/features/health/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to check and observe gRPC server health using +// the health library. package main import ( diff --git a/examples/features/health/server/main.go b/examples/features/health/server/main.go index 5cc10bad5860..ea94c36a6496 100644 --- a/examples/features/health/server/main.go +++ b/examples/features/health/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to manage and report its health status using +// the gRPC health library. package main import ( diff --git a/examples/features/interceptor/client/main.go b/examples/features/interceptor/client/main.go index 22150c404670..feb59bf1a2eb 100644 --- a/examples/features/interceptor/client/main.go +++ b/examples/features/interceptor/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use interceptors to observe or control the +// behavior of gRPC including logging, authentication,metrics collection, etc. package main import ( diff --git a/examples/features/interceptor/server/main.go b/examples/features/interceptor/server/main.go index f5e1333afcb4..40919ec171f5 100644 --- a/examples/features/interceptor/server/main.go +++ b/examples/features/interceptor/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to use interceptors to observe or control the +// behavior of gRPC including logging, authentication,metrics collection, etc. package main import ( diff --git a/examples/features/keepalive/client/main.go b/examples/features/keepalive/client/main.go index b93fcf608938..6de00174d930 100644 --- a/examples/features/keepalive/client/main.go +++ b/examples/features/keepalive/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to configure keepalive pings to maintain +// connectivity and detect stale connections. package main import ( diff --git a/examples/features/keepalive/server/main.go b/examples/features/keepalive/server/main.go index 8236c2efdd1e..f7ab42ef56ed 100644 --- a/examples/features/keepalive/server/main.go +++ b/examples/features/keepalive/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to enforce keepalive settings and manage idle +// connections to maintain active client connections. package main import ( diff --git a/examples/features/load_balancing/client/main.go b/examples/features/load_balancing/client/main.go index 22504d0cc5b6..c970b904e68c 100644 --- a/examples/features/load_balancing/client/main.go +++ b/examples/features/load_balancing/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to configure load balancing policies to +// distribute RPCs across backend servers. package main import ( diff --git a/examples/features/load_balancing/server/main.go b/examples/features/load_balancing/server/main.go index 9cfa8471f950..ad26561f3376 100644 --- a/examples/features/load_balancing/server/main.go +++ b/examples/features/load_balancing/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to respond with backend addresses for the +// client load balancing policies. package main import ( diff --git a/examples/features/metadata/client/main.go b/examples/features/metadata/client/main.go index a314f3063c66..5c457a47f5b5 100644 --- a/examples/features/metadata/client/main.go +++ b/examples/features/metadata/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to send and receive metadata to and from RPC. package main import ( diff --git a/examples/features/metadata/server/main.go b/examples/features/metadata/server/main.go index d8ef473ae38f..767337cc1d12 100644 --- a/examples/features/metadata/server/main.go +++ b/examples/features/metadata/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to read and set metadata to and from RPCs. package main import ( diff --git a/examples/features/metadata_interceptor/client/main.go b/examples/features/metadata_interceptor/client/main.go index 3c950ed7c57b..9e19070fcd53 100644 --- a/examples/features/metadata_interceptor/client/main.go +++ b/examples/features/metadata_interceptor/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to send and receive metadata in RPC headers +// and trailers. package main import ( diff --git a/examples/features/metadata_interceptor/server/main.go b/examples/features/metadata_interceptor/server/main.go index 93125433b959..e1525d94ecc8 100644 --- a/examples/features/metadata_interceptor/server/main.go +++ b/examples/features/metadata_interceptor/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to update metadata from interceptors on server. package main import ( diff --git a/examples/features/multiplex/client/main.go b/examples/features/multiplex/client/main.go index 3e60c05068cd..d5a432e16b12 100644 --- a/examples/features/multiplex/client/main.go +++ b/examples/features/multiplex/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use a single grpc.ClientConn for multiple +// service stubs. package main import ( diff --git a/examples/features/multiplex/server/main.go b/examples/features/multiplex/server/main.go index 475b074f2663..edd6ede6ca22 100644 --- a/examples/features/multiplex/server/main.go +++ b/examples/features/multiplex/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to use a single grpc.Server instance to +// register and serve multiple services. package main import ( diff --git a/examples/features/name_resolving/client/main.go b/examples/features/name_resolving/client/main.go index 72ffd62812e7..1eda5a425d5c 100644 --- a/examples/features/name_resolving/client/main.go +++ b/examples/features/name_resolving/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to use different name resolvers to connect +// to a server. package main import ( diff --git a/examples/features/name_resolving/server/main.go b/examples/features/name_resolving/server/main.go index fdf61bb8299a..6a7297a1e730 100644 --- a/examples/features/name_resolving/server/main.go +++ b/examples/features/name_resolving/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to set up a gRPC server that listens on a +// specified port for name resolution examples. package main import ( diff --git a/examples/features/observability/client/main.go b/examples/features/observability/client/main.go index 22f069ebaedc..ad08c8a303c5 100644 --- a/examples/features/observability/client/main.go +++ b/examples/features/observability/client/main.go @@ -16,7 +16,8 @@ * */ -// Package main implements a client for Greeter service. +// Binary client demonstrates how to instrument RPCs with logging, metrics, +// and tracing. package main import ( diff --git a/examples/features/observability/server/main.go b/examples/features/observability/server/main.go index 184fba881e64..b8455ef82588 100644 --- a/examples/features/observability/server/main.go +++ b/examples/features/observability/server/main.go @@ -16,7 +16,8 @@ * */ -// Package main implements a server for Greeter service. +// Binary server demonstrates how to instrument RPCs for logging, metrics, +// and tracing. package main import ( diff --git a/examples/features/orca/client/main.go b/examples/features/orca/client/main.go index 1046bbbe1f29..a0ef49a3fa4d 100644 --- a/examples/features/orca/client/main.go +++ b/examples/features/orca/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to handle ORCA metrics for load reporting. package main import ( diff --git a/examples/features/orca/server/main.go b/examples/features/orca/server/main.go index e52d5d06eebf..5714a43b6d21 100644 --- a/examples/features/orca/server/main.go +++ b/examples/features/orca/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstartes how to implement ORCA for reporting out-of-band +// and per-RPC load metrics. package main import ( diff --git a/examples/features/reflection/server/main.go b/examples/features/reflection/server/main.go index d7fc3620860d..a970455459b0 100644 --- a/examples/features/reflection/server/main.go +++ b/examples/features/reflection/server/main.go @@ -16,7 +16,8 @@ * */ -// Binary server is an example server. +// Binary server demonstrates how to register multiple services and enable +// client discovery. package main import ( diff --git a/examples/features/retry/client/main.go b/examples/features/retry/client/main.go index 00acc5f7b814..751a74a9c1b1 100644 --- a/examples/features/retry/client/main.go +++ b/examples/features/retry/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// Binary client demonstrates how to enable and configure retry policies for +// gRPC requests. package main import ( diff --git a/examples/features/retry/server/main.go b/examples/features/retry/server/main.go index 0fdf4ef91b6e..657c682ce145 100644 --- a/examples/features/retry/server/main.go +++ b/examples/features/retry/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server is an example server. +// Binary server demonstrates to enforce retries on client side. package main import ( From 090528e497a9217f0df50237e8de2f2bca319c28 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Sun, 22 Sep 2024 15:15:29 +0530 Subject: [PATCH 2/8] Correct spelling --- examples/features/orca/server/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/features/orca/server/main.go b/examples/features/orca/server/main.go index 5714a43b6d21..1296cdc9c461 100644 --- a/examples/features/orca/server/main.go +++ b/examples/features/orca/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server demonstartes how to implement ORCA for reporting out-of-band +// Binary server demonstrates how to implement ORCA for reporting out-of-band // and per-RPC load metrics. package main From 44345d70974bd4be36fc6298952a36e89d9e358b Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Thu, 26 Sep 2024 12:35:37 +0530 Subject: [PATCH 3/8] improve comments --- examples/features/compression/server/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/features/compression/server/main.go b/examples/features/compression/server/main.go index 6e8148e2d43f..d231e75c54fd 100644 --- a/examples/features/compression/server/main.go +++ b/examples/features/compression/server/main.go @@ -28,6 +28,8 @@ import ( "net" "google.golang.org/grpc" + // Importing the gzip encoding registers it as an available compressor. + // gRPC will automatically negotiate and use gzip if the client supports it. _ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor pb "google.golang.org/grpc/examples/features/proto/echo" From d57d205b37abac16996ee7912cc1614bb34d5271 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Thu, 26 Sep 2024 14:06:10 +0530 Subject: [PATCH 4/8] improve comments --- examples/features/compression/server/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/features/compression/server/main.go b/examples/features/compression/server/main.go index d231e75c54fd..a741aaab337d 100644 --- a/examples/features/compression/server/main.go +++ b/examples/features/compression/server/main.go @@ -28,9 +28,9 @@ import ( "net" "google.golang.org/grpc" - // Importing the gzip encoding registers it as an available compressor. + // Installing the gzip encoding registers it as an available compressor. // gRPC will automatically negotiate and use gzip if the client supports it. - _ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor + _ "google.golang.org/grpc/encoding/gzip" pb "google.golang.org/grpc/examples/features/proto/echo" ) From d3c0c08251c3e338c69dc18dfc4a5fa48b1d2ea4 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Fri, 4 Oct 2024 11:44:17 +0530 Subject: [PATCH 5/8] Address comments --- examples/features/authz/client/main.go | 2 +- examples/features/cancellation/client/main.go | 2 +- examples/features/deadline/client/main.go | 2 +- examples/features/deadline/server/main.go | 4 ++-- examples/features/load_balancing/server/main.go | 4 ++-- examples/features/metadata/client/main.go | 2 +- examples/features/metadata/server/main.go | 2 +- examples/features/name_resolving/client/main.go | 4 ++-- examples/features/orca/client/main.go | 3 ++- examples/features/orca/server/main.go | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/examples/features/authz/client/main.go b/examples/features/authz/client/main.go index 8b67f620adc9..db05ab29f7eb 100644 --- a/examples/features/authz/client/main.go +++ b/examples/features/authz/client/main.go @@ -17,7 +17,7 @@ */ // Binary client demonstrates how to include authorization credentials in the -// form of metadata for every RPC for server side validation. +// form of metadata in every RPC for server side validation. package main import ( diff --git a/examples/features/cancellation/client/main.go b/examples/features/cancellation/client/main.go index e5c1044e2e49..9ac765be870c 100644 --- a/examples/features/cancellation/client/main.go +++ b/examples/features/cancellation/client/main.go @@ -17,7 +17,7 @@ */ // Binary client demonstrates how to cancel in-flight RPCs by canceling the -// context passed to the RPC call. +// context passed to the RPC. package main import ( diff --git a/examples/features/deadline/client/main.go b/examples/features/deadline/client/main.go index 08de2e497cd7..4d16a02d966b 100644 --- a/examples/features/deadline/client/main.go +++ b/examples/features/deadline/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to set deadlines for RPCs and handle +// Binary client demonstrates how to set deadlines for RPCs and how to handle // deadline-exceeded errors. package main diff --git a/examples/features/deadline/server/main.go b/examples/features/deadline/server/main.go index ffd221985513..a826b3998255 100644 --- a/examples/features/deadline/server/main.go +++ b/examples/features/deadline/server/main.go @@ -16,8 +16,8 @@ * */ -// Binary server demonstrates how to handle RPCs with deadlines and propagate -// deadlines in requests. +// Binary server demonstrates how to handle RPCs with deadlines and how to +// propagate deadlines in requests. package main import ( diff --git a/examples/features/load_balancing/server/main.go b/examples/features/load_balancing/server/main.go index ad26561f3376..c88f80cadbf2 100644 --- a/examples/features/load_balancing/server/main.go +++ b/examples/features/load_balancing/server/main.go @@ -16,8 +16,8 @@ * */ -// Binary server demonstrates how to respond with backend addresses for the -// client load balancing policies. +// Binary server demonstrates how to spin up multiple server backends +// to enable client-side load balancing. package main import ( diff --git a/examples/features/metadata/client/main.go b/examples/features/metadata/client/main.go index 5c457a47f5b5..d553434c428e 100644 --- a/examples/features/metadata/client/main.go +++ b/examples/features/metadata/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to send and receive metadata to and from RPC. +// Binary client demonstrates how to receive metadata from RPCs. package main import ( diff --git a/examples/features/metadata/server/main.go b/examples/features/metadata/server/main.go index 767337cc1d12..daf7f946a93b 100644 --- a/examples/features/metadata/server/main.go +++ b/examples/features/metadata/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server demonstrates how to read and set metadata to and from RPCs. +// Binary server demonstrates how to send and read metadata to and from RPCs. package main import ( diff --git a/examples/features/name_resolving/client/main.go b/examples/features/name_resolving/client/main.go index 1eda5a425d5c..6d5003266a97 100644 --- a/examples/features/name_resolving/client/main.go +++ b/examples/features/name_resolving/client/main.go @@ -16,8 +16,8 @@ * */ -// Binary client demonstrates how to use different name resolvers to connect -// to a server. +// Binary client demonstrates how to use custom name resolvers to resolve +// server backend addresses. package main import ( diff --git a/examples/features/orca/client/main.go b/examples/features/orca/client/main.go index a0ef49a3fa4d..60a91f4c0dc6 100644 --- a/examples/features/orca/client/main.go +++ b/examples/features/orca/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client demonstrates how to handle ORCA metrics for load reporting. +// Binary client demonstrates the use of a custom LB policy that handles ORCA +// per-call and out-of-band metrics for load reporting. package main import ( diff --git a/examples/features/orca/server/main.go b/examples/features/orca/server/main.go index 1296cdc9c461..65c767aaac3d 100644 --- a/examples/features/orca/server/main.go +++ b/examples/features/orca/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server demonstrates how to implement ORCA for reporting out-of-band +// Binary server demonstrates how to use ORCA for reporting out-of-band // and per-RPC load metrics. package main From b65c35b52fb6098292ff7b22d7beabf0e5f2b438 Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Fri, 4 Oct 2024 11:50:20 +0530 Subject: [PATCH 6/8] Address comments --- examples/features/metadata/client/main.go | 2 +- examples/features/metadata_interceptor/client/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/features/metadata/client/main.go b/examples/features/metadata/client/main.go index d553434c428e..a781987694b0 100644 --- a/examples/features/metadata/client/main.go +++ b/examples/features/metadata/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to receive metadata from RPCs. +// Binary client demonstrates how to send and receive metadata to and from RPCs. package main import ( diff --git a/examples/features/metadata_interceptor/client/main.go b/examples/features/metadata_interceptor/client/main.go index 9e19070fcd53..cc8754de3513 100644 --- a/examples/features/metadata_interceptor/client/main.go +++ b/examples/features/metadata_interceptor/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to send and receive metadata in RPC headers +// Binary client demonstrates how to receive metadata in RPC headers // and trailers. package main From 1f8fdbe7deaeb3efd0a8f71952c0358ea096321e Mon Sep 17 00:00:00 2001 From: eshitachandwani Date: Fri, 4 Oct 2024 11:56:17 +0530 Subject: [PATCH 7/8] Improve comments --- examples/features/metadata/client/main.go | 2 +- examples/features/metadata/server/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/features/metadata/client/main.go b/examples/features/metadata/client/main.go index a781987694b0..5c457a47f5b5 100644 --- a/examples/features/metadata/client/main.go +++ b/examples/features/metadata/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to send and receive metadata to and from RPCs. +// Binary client demonstrates how to send and receive metadata to and from RPC. package main import ( diff --git a/examples/features/metadata/server/main.go b/examples/features/metadata/server/main.go index daf7f946a93b..6989242968ab 100644 --- a/examples/features/metadata/server/main.go +++ b/examples/features/metadata/server/main.go @@ -16,7 +16,7 @@ * */ -// Binary server demonstrates how to send and read metadata to and from RPCs. +// Binary server demonstrates how to send and read metadata to and from RPC. package main import ( From d97740d0dfc666e45b1d8a2f890d4520905c05ba Mon Sep 17 00:00:00 2001 From: eshitachandwani <59800922+eshitachandwani@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:52:03 +0530 Subject: [PATCH 8/8] Update metadata/client/main.go --- examples/features/metadata/client/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/features/metadata/client/main.go b/examples/features/metadata/client/main.go index 5c457a47f5b5..861e3eece268 100644 --- a/examples/features/metadata/client/main.go +++ b/examples/features/metadata/client/main.go @@ -16,7 +16,7 @@ * */ -// Binary client demonstrates how to send and receive metadata to and from RPC. +// Binary client demonstrates how to send and receive metadata to and from an RPC. package main import (