Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrValidation = errors.MustDefine(errors.KindInvalidArgument, errors.Domain, "VALIDATION_FAILED")
ErrValidation identifies a request rejected by a validator.
Functions ¶
func PerMessageProtoValidateStream ¶
func PerMessageProtoValidateStream() middleware.StreamMiddleware
PerMessageProtoValidateStream validates every message received on a stream.
This suits client and bidirectional streaming, where each message is a separate input worth checking. A message that fails validation fails that RecvMsg with a BadRequest error and leaves the stream open, so the handler decides whether to continue or return. The initial request, when a method has one, is validated too.
func ProtoValidate ¶
func ProtoValidate() middleware.UnaryMiddleware
ProtoValidate is a middleware that validates the request message with protovalidate(https://github.com/bufbuild/protovalidate)
func ProtoValidateStream ¶
func ProtoValidateStream() middleware.StreamMiddleware
ProtoValidateStream validates the initial request of a stream, once, before the handler runs.
This suits server-streaming methods, where the client sends one request and then only receives. For client and bidirectional streaming the initial request is nil and nothing is validated — use PerMessageProtoValidateStream there.
Types ¶
This section is empty.