Skip to content

Commit a7e8d87

Browse files
authored
fix auto-generated docs (#548)
1 parent 5940f64 commit a7e8d87

File tree

11 files changed

+15
-19
lines changed

11 files changed

+15
-19
lines changed

auth/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
`grpc_auth` a generic server-side auth middleware for gRPC.
66
7-
Server Side Auth Middleware
7+
# Server Side Auth Middleware
88
99
It allows for easy assertion of `:authorization` headers in gRPC calls, be it HTTP Basic auth, or
1010
OAuth2 Bearer tokens.

doc.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
`grpc_middleware` is a collection of gRPC middleware packages: interceptors, helpers and tools.
66
7-
Middleware
7+
# Middleware
88
99
gRPC is a fantastic RPC middleware, which sees a lot of adoption in the Golang world. However, the
1010
upstream gRPC codebase is relatively bare bones.
@@ -13,7 +13,7 @@ This package, and most of its child packages provides commonly needed middleware
1313
client-side interceptors for retires, server-side interceptors for input validation and auth,
1414
functions for chaining said interceptors, metadata convenience methods and more.
1515
16-
Chaining
16+
# Chaining
1717
1818
By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on
1919
the server side. `grpc_middleware` provides convenient chaining methods
@@ -42,7 +42,7 @@ These interceptors will be executed from left to right: monitoring and then retr
4242
4343
The retry interceptor will call every interceptor that follows it whenever when a retry happens.
4444
45-
Writing Your Own
45+
# Writing Your Own
4646
4747
Implementing your own interceptor is pretty trivial: there are interfaces for that. But the interesting
4848
bit exposing common data to handlers (and other middleware), similarly to HTTP Middleware design.

logging/zap/doc.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ the full request/response payload needs to be written with care, this can signif
1717
1818
ZAP can also be made as a backend for gRPC library internals. For that use `ReplaceGrpcLoggerV2`.
1919
20-
2120
*Server Interceptor*
2221
Below is a JSON formatted example of a log that would be logged by the server interceptor:
2322
@@ -68,7 +67,6 @@ Below is a JSON formatted example of a log that would be logged by the payload i
6867
6968
Note - due to implementation ZAP differs from Logrus in the "grpc.request.content" object by having an inner "msg" object.
7069
71-
7270
Please see examples and tests for examples of use.
7371
Please see settable_test.go for canonical integration through "zaptest" with golang testing infrastructure.
7472
*/

ratelimit/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
`ratelimit` a generic server-side ratelimit middleware for gRPC.
33
4-
Server Side Ratelimit Middleware
4+
# Server Side Ratelimit Middleware
55
66
It allows to do grpc rate limit by your own rate limiter (e.g. token bucket, leaky bucket, etc.)
77

recovery/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
`grpc_recovery` are interceptors that recover from gRPC handler panics.
66
7-
Server Side Recovery Middleware
7+
# Server Side Recovery Middleware
88
99
By default a panic will be converted into a gRPC error with `code.Internal`.
1010

retry/doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
/*
55
`grpc_retry` provides client-side request retry logic for gRPC.
66
7-
Client-Side Request Retry Interceptor
7+
# Client-Side Request Retry Interceptor
88
99
It allows for automatic retry, inside the generated gRPC code of requests based on the gRPC status
1010
of the reply. It supports unary (1:1), and server stream (1:n) requests.
1111
1212
By default the interceptors *are disabled*, preventing accidental use of retries. You can easily
1313
override the number of retries (setting them to more than 0) with a `grpc.ClientOption`, e.g.:
1414
15-
myclient.Ping(ctx, goodPing, grpc_retry.WithMax(5))
15+
myclient.Ping(ctx, goodPing, grpc_retry.WithMax(5))
1616
1717
Other default options are: retry on `ResourceExhausted` and `Unavailable` gRPC codes, use a 50ms
1818
linear backoff with 10% jitter.

tags/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
`grpc_ctxtags` adds a Tag object to the context that can be used by other middleware to add context about a request.
33
4-
Request Context Tags
4+
# Request Context Tags
55
66
Tags describe information about the request, and can be set and used by other middleware, or handlers. Tags are used
77
for logging and tracing of requests. Tags are populated both upwards, *and* downwards in the interceptor-handler stack.

tags/fieldextractor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func CodeGenRequestFieldExtractor(fullMethod string, req interface{}) map[string
3535
// TagBasedRequestFieldExtractor is a function that relies on Go struct tags to export log fields from requests.
3636
// These are usually coming from a protoc-plugin, such as Gogo protobuf.
3737
//
38-
// message Metadata {
39-
// repeated string tags = 1 [ (gogoproto.moretags) = "log_field:\"meta_tags\"" ];
40-
// }
38+
// message Metadata {
39+
// repeated string tags = 1 [ (gogoproto.moretags) = "log_field:\"meta_tags\"" ];
40+
// }
4141
//
4242
// The tagName is configurable using the tagName variable. Here it would be "log_field".
4343
func TagBasedRequestFieldExtractor(tagName string) RequestFieldExtractorFunc {

tracing/opentracing/doc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*
55
`grpc_opentracing` adds OpenTracing
66
7-
OpenTracing Interceptors
7+
# OpenTracing Interceptors
88
99
These are both client-side and server-side interceptors for OpenTracing. They are a provider-agnostic, with backends
1010
such as Zipkin, or Google Stackdriver Trace.
@@ -17,6 +17,5 @@ All server-side spans are tagged with grpc_ctxtags information.
1717
For more information see:
1818
http://opentracing.io/documentation/
1919
https://github.com/opentracing/specification/blob/master/semantic_conventions.md
20-
2120
*/
2221
package grpc_opentracing

tracing/opentracing/interceptors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,4 @@ func (jaegerFormatExtractor) Extract(carrier interface{}) (mocktracer.MockSpanCo
337337
return rval, err
338338
}
339339
return rval, nil
340-
}
340+
}

0 commit comments

Comments
 (0)