protovalid

package
v0.0.0-...-2597ab7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 5 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL