Documentation ¶
Overview ¶
Package protovalid provides gRPC interceptors for validating protobuf messages compiled with protoc-gen-validate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientInterceptor is a grpc.UnaryClientInterceptor that validates the request only, returning a codes.InvalidArgument error should validation fail.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, h grpc.UnaryHandler) (interface{}, error)
UnaryServerInterceptor is a grpc.UnaryServerInterceptor that validates both the client request and the server response. An invalid request results in codes.InvalidArgument whereas an invalid response results in codes.Internal.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.