Skip to content

Commit b9ed6ae

Browse files
authored
Merge pull request grpc-ecosystem#99 from thurt/patch-1
Spelling/grammar corrections for validator docs
2 parents bc372cc + 9e9bc80 commit b9ed6ae

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

validator/DOC.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
* [Index](#pkg-index)
77

88
## <a name="pkg-overview">Overview</a>
9-
`grpc_validator` a generic request contents validator server-side middleware for gRPC.
9+
`grpc_validator` is a generic request contents validator server-side middleware for gRPC.
1010

1111
### Request Validator Middleware
12-
Validating input is important, and hard. It also causes a lot of boiler plate. This middleware
13-
checks for the existance of a `Validate` method on each of the messages of a gRPC request. This
12+
Validating input is important, and hard. It also causes a lot of boilerplate code. This middleware
13+
checks for the existence of a `Validate` method on each of the messages of a gRPC request. This
1414
includes the single request of the `Unary` calls, as well as each message of the inbound Stream calls.
15-
In case of a validation failure, a `InvalidArgument` gRPC status is returned, alongside with a
15+
In case of a validation failure, an `InvalidArgument` gRPC status is returned, along with a
1616
description of the validation failure.
1717

18-
While it is generic, it was indented to be used with <a href="https://github.com/mwitkow/go-proto-validators">https://github.com/mwitkow/go-proto-validators</a>,
18+
While it is generic, it was intended to be used with <a href="https://github.com/mwitkow/go-proto-validators">https://github.com/mwitkow/go-proto-validators</a>,
1919
a Go protocol buffers codegen plugin that creates the `Validate` methods (including nested messages)
2020
based on declarative options in the `.proto` files themselves. For example:
2121

@@ -37,11 +37,11 @@ based on declarative options in the `.proto` files themselves. For example:
3737
InnerMessage inner = 2 [(validator.field) = {msg_exists : true}];
3838
}
3939

40-
The `OuterMessage.Validate` would include validation of regexes, existance of the InnerMessage and
40+
The `OuterMessage.Validate` would include validation of regexes, existence of the InnerMessage and
4141
the range values within it. The `grpc_validator` middleware would then automatically use that to
4242
check all messages processed by the server.
4343

44-
Please consult <a href="https://github.com/mwitkow/go-proto-validators">https://github.com/mwitkow/go-proto-validators</a> for details of `protoc` invoation and
44+
Please consult <a href="https://github.com/mwitkow/go-proto-validators">https://github.com/mwitkow/go-proto-validators</a> for details on `protoc` invocation and
4545
other parameters of customization.
4646

4747
## <a name="pkg-imports">Imported Packages</a>
@@ -61,7 +61,7 @@ other parameters of customization.
6161
``` go
6262
func StreamServerInterceptor() grpc.StreamServerInterceptor
6363
```
64-
StreamServerInterceptor returns a new streaming server interceptors that validates incoming messages.
64+
StreamServerInterceptor returns a new streaming server interceptor that validates incoming messages.
6565

6666
The stage at which invalid messages will be rejected with `InvalidArgument` varies based on the
6767
type of the RPC. For `ServerStream` (1:m) requests, it will happen before reaching any userspace
@@ -72,7 +72,7 @@ calls to `stream.Recv()`.
7272
``` go
7373
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
7474
```
75-
UnaryServerInterceptor returns a new unary server interceptors that validates incoming messages.
75+
UnaryServerInterceptor returns a new unary server interceptor that validates incoming messages.
7676

7777
Invalid messages will be rejected with `InvalidArgument` before reaching any userspace handlers.
7878

validator/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# grpc_validator
2-
--
2+
33
import "github.com/grpc-ecosystem/go-grpc-middleware/validator"
44

5-
`grpc_validator` a generic request contents validator server-side middleware for
5+
`grpc_validator` is a generic request contents validator server-side middleware for
66
gRPC.
77

88

99
### Request Validator Middleware
1010

11-
Validating input is important, and hard. It also causes a lot of boiler plate.
12-
This middleware checks for the existance of a `Validate` method on each of the
11+
Validating input is important, and hard. It also causes a lot of boilerplate code.
12+
This middleware checks for the existence of a `Validate` method on each of the
1313
messages of a gRPC request. This includes the single request of the `Unary`
1414
calls, as well as each message of the inbound Stream calls. In case of a
15-
validation failure, a `InvalidArgument` gRPC status is returned, alongside with
15+
validation failure, an `InvalidArgument` gRPC status is returned, along with
1616
a description of the validation failure.
1717

18-
While it is generic, it was indented to be used with
18+
While it is generic, it was intended to be used with
1919
https://github.com/mwitkow/go-proto-validators, a Go protocol buffers codegen
2020
plugin that creates the `Validate` methods (including nested messages) based on
2121
declarative options in the `.proto` files themselves. For example:
@@ -38,12 +38,12 @@ declarative options in the `.proto` files themselves. For example:
3838
InnerMessage inner = 2 [(validator.field) = {msg_exists : true}];
3939
}
4040

41-
The `OuterMessage.Validate` would include validation of regexes, existance of
41+
The `OuterMessage.Validate` would include validation of regexes, existence of
4242
the InnerMessage and the range values within it. The `grpc_validator` middleware
4343
would then automatically use that to check all messages processed by the server.
4444

45-
Please consult https://github.com/mwitkow/go-proto-validators for details of
46-
`protoc` invoation and other parameters of customization.
45+
Please consult https://github.com/mwitkow/go-proto-validators for details on
46+
`protoc` invocation and other parameters of customization.
4747

4848
## Usage
4949

@@ -52,7 +52,7 @@ Please consult https://github.com/mwitkow/go-proto-validators for details of
5252
```go
5353
func StreamServerInterceptor() grpc.StreamServerInterceptor
5454
```
55-
StreamServerInterceptor returns a new streaming server interceptors that
55+
StreamServerInterceptor returns a new streaming server interceptor that
5656
validates incoming messages.
5757

5858
The stage at which invalid messages will be rejected with `InvalidArgument`
@@ -66,7 +66,7 @@ happen before reaching any userspace handlers. For `ClientStream` (n:1) or
6666
```go
6767
func UnaryServerInterceptor() grpc.UnaryServerInterceptor
6868
```
69-
UnaryServerInterceptor returns a new unary server interceptors that validates
69+
UnaryServerInterceptor returns a new unary server interceptor that validates
7070
incoming messages.
7171

7272
Invalid messages will be rejected with `InvalidArgument` before reaching any

validator/doc.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
// See LICENSE for licensing terms.
33

44
/*
5-
`grpc_validator` a generic request contents validator server-side middleware for gRPC.
5+
`grpc_validator` is a generic request contents validator server-side middleware for gRPC.
66
77
Request Validator Middleware
88
9-
Validating input is important, and hard. It also causes a lot of boiler plate. This middleware
10-
checks for the existance of a `Validate` method on each of the messages of a gRPC request. This
9+
Validating input is important, and hard. It also causes a lot of boilerplate code. This middleware
10+
checks for the existence of a `Validate` method on each of the messages of a gRPC request. This
1111
includes the single request of the `Unary` calls, as well as each message of the inbound Stream calls.
12-
In case of a validation failure, a `InvalidArgument` gRPC status is returned, alongside with a
12+
In case of a validation failure, an `InvalidArgument` gRPC status is returned, along with a
1313
description of the validation failure.
1414
15-
While it is generic, it was indented to be used with https://github.com/mwitkow/go-proto-validators,
15+
While it is generic, it was intended to be used with https://github.com/mwitkow/go-proto-validators,
1616
a Go protocol buffers codegen plugin that creates the `Validate` methods (including nested messages)
1717
based on declarative options in the `.proto` files themselves. For example:
1818
@@ -35,11 +35,11 @@ based on declarative options in the `.proto` files themselves. For example:
3535
InnerMessage inner = 2 [(validator.field) = {msg_exists : true}];
3636
}
3737
38-
The `OuterMessage.Validate` would include validation of regexes, existance of the InnerMessage and
38+
The `OuterMessage.Validate` would include validation of regexes, existence of the InnerMessage and
3939
the range values within it. The `grpc_validator` middleware would then automatically use that to
4040
check all messages processed by the server.
4141
42-
Please consult https://github.com/mwitkow/go-proto-validators for details of `protoc` invoation and
42+
Please consult https://github.com/mwitkow/go-proto-validators for details on `protoc` invocation and
4343
other parameters of customization.
4444
*/
4545
package grpc_validator

validator/validator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type validator interface {
1313
Validate() error
1414
}
1515

16-
// UnaryServerInterceptor returns a new unary server interceptors that validates incoming messages.
16+
// UnaryServerInterceptor returns a new unary server interceptor that validates incoming messages.
1717
//
1818
// Invalid messages will be rejected with `InvalidArgument` before reaching any userspace handlers.
1919
func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
@@ -27,7 +27,7 @@ func UnaryServerInterceptor() grpc.UnaryServerInterceptor {
2727
}
2828
}
2929

30-
// StreamServerInterceptor returns a new streaming server interceptors that validates incoming messages.
30+
// StreamServerInterceptor returns a new streaming server interceptor that validates incoming messages.
3131
//
3232
// The stage at which invalid messages will be rejected with `InvalidArgument` varies based on the
3333
// type of the RPC. For `ServerStream` (1:m) requests, it will happen before reaching any userspace

0 commit comments

Comments
 (0)