diff --git a/examples/features/authz/client/main.go b/examples/features/authz/client/main.go index b4f5fca59641..db05ab29f7eb 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 in 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..9ac765be870c 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. 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..a741aaab337d 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 ( @@ -27,7 +28,9 @@ import ( "net" "google.golang.org/grpc" - _ "google.golang.org/grpc/encoding/gzip" // Install the gzip 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" pb "google.golang.org/grpc/examples/features/proto/echo" ) diff --git a/examples/features/deadline/client/main.go b/examples/features/deadline/client/main.go index 8c13eb85377b..4d16a02d966b 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 how to 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..a826b3998255 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 how to +// 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..c88f80cadbf2 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 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 a314f3063c66..861e3eece268 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 an RPC. package main import ( diff --git a/examples/features/metadata/server/main.go b/examples/features/metadata/server/main.go index d8ef473ae38f..6989242968ab 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 send and read metadata to and from RPC. package main import ( diff --git a/examples/features/metadata_interceptor/client/main.go b/examples/features/metadata_interceptor/client/main.go index 3c950ed7c57b..cc8754de3513 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 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..6d5003266a97 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 custom name resolvers to resolve +// server backend addresses. 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..60a91f4c0dc6 100644 --- a/examples/features/orca/client/main.go +++ b/examples/features/orca/client/main.go @@ -16,7 +16,8 @@ * */ -// Binary client is an example client. +// 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 e52d5d06eebf..65c767aaac3d 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 demonstrates how to use 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 (