Skip to content

Commit 5fd9853

Browse files
examples: improve package comments (#7658)
1 parent 859602c commit 5fd9853

File tree

43 files changed

+81
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+81
-44
lines changed

examples/features/authz/client/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary client is an example client.
19+
// Binary client demonstrates how to include authorization credentials in the
20+
// form of metadata in every RPC for server side validation.
2021
package main
2122

2223
import (

examples/features/authz/server/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary server is an example server.
19+
// Binary server demonstrates how to validate authorization credential metadata
20+
// for incoming RPCs.
2021
package main
2122

2223
import (

examples/features/cancellation/client/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary client is an example client.
19+
// Binary client demonstrates how to cancel in-flight RPCs by canceling the
20+
// context passed to the RPC.
2021
package main
2122

2223
import (

examples/features/cancellation/server/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary server is an example server.
19+
// Binary server demonstrates how to handle canceled contexts when a client
20+
// cancels an in-flight RPC.
2021
package main
2122

2223
import (

examples/features/compression/client/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary client is an example client.
19+
// Binary client demonstrates how to specify compression options when performing
20+
// RPCs.
2021
package main
2122

2223
import (

examples/features/compression/server/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary server is an example server.
19+
// Binary server demonstrates how to install and support compressors for
20+
// incoming RPCs.
2021
package main
2122

2223
import (
@@ -27,7 +28,9 @@ import (
2728
"net"
2829

2930
"google.golang.org/grpc"
30-
_ "google.golang.org/grpc/encoding/gzip" // Install the gzip compressor
31+
// Installing the gzip encoding registers it as an available compressor.
32+
// gRPC will automatically negotiate and use gzip if the client supports it.
33+
_ "google.golang.org/grpc/encoding/gzip"
3134

3235
pb "google.golang.org/grpc/examples/features/proto/echo"
3336
)

examples/features/deadline/client/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary client is an example client.
19+
// Binary client demonstrates how to set deadlines for RPCs and how to handle
20+
// deadline-exceeded errors.
2021
package main
2122

2223
import (

examples/features/deadline/server/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary server is an example server.
19+
// Binary server demonstrates how to handle RPCs with deadlines and how to
20+
// propagate deadlines in requests.
2021
package main
2122

2223
import (

examples/features/debugging/client/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary client is an example client.
19+
// Binary client demonstrates how to use logging and Channelz for debugging
20+
// gRPC operations.
2021
package main
2122

2223
import (

examples/features/debugging/server/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
*
1717
*/
1818

19-
// Binary server is an example server.
19+
// Binary server demonstrates how to enable logging and Channelz for debugging
20+
// gRPC services.
2021
package main
2122

2223
import (

0 commit comments

Comments
 (0)