Skip to content

Commit

Permalink
examples: improve package comments (grpc#7658)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshitachandwani authored Oct 7, 2024
1 parent 859602c commit 5fd9853
Show file tree
Hide file tree
Showing 43 changed files with 81 additions and 44 deletions.
3 changes: 2 additions & 1 deletion examples/features/authz/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/authz/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/cancellation/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/cancellation/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/compression/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*
*/

// Binary client is an example client.
// Binary client demonstrates how to specify compression options when performing
// RPCs.
package main

import (
Expand Down
7 changes: 5 additions & 2 deletions examples/features/compression/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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"
)
Expand Down
3 changes: 2 additions & 1 deletion examples/features/deadline/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/deadline/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/debugging/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/debugging/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/encryption/ALTS/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/encryption/ALTS/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/encryption/TLS/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/encryption/TLS/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/error_details/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/error_details/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

// Binary server is an example server.
// Binary server demonstrates how to provide error messages in gRPC responses.
package main

import (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/error_handling/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/error_handling/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/flow_control/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/flow_control/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/health/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/health/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/interceptor/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/interceptor/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/keepalive/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/keepalive/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/load_balancing/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/load_balancing/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/metadata/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/metadata/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/metadata_interceptor/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion examples/features/metadata_interceptor/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

// Binary server is an example server.
// Binary server demonstrates how to update metadata from interceptors on server.
package main

import (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/multiplex/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/multiplex/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/name_resolving/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/name_resolving/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/observability/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/observability/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion examples/features/orca/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading

0 comments on commit 5fd9853

Please sign in to comment.