File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
interceptors/protovalidate Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ import (
14
14
"google.golang.org/protobuf/proto"
15
15
)
16
16
17
+ // Option interface is currently empty and serves as a placeholder for potential future implementations.
18
+ // It allows adding new options without breaking existing code.
19
+ type Option interface {
20
+ unimplemented ()
21
+ }
22
+
17
23
// UnaryServerInterceptor returns a new unary server interceptor that validates incoming messages.
18
- func UnaryServerInterceptor (validator * protovalidate.Validator ) grpc.UnaryServerInterceptor {
24
+ func UnaryServerInterceptor (validator * protovalidate.Validator , opts ... Option ) grpc.UnaryServerInterceptor {
19
25
return func (
20
26
ctx context.Context ,
21
27
req interface {},
@@ -36,7 +42,7 @@ func UnaryServerInterceptor(validator *protovalidate.Validator) grpc.UnaryServer
36
42
}
37
43
38
44
// StreamServerInterceptor returns a new streaming server interceptor that validates incoming messages.
39
- func StreamServerInterceptor (validator * protovalidate.Validator ) grpc.StreamServerInterceptor {
45
+ func StreamServerInterceptor (validator * protovalidate.Validator , opts ... Option ) grpc.StreamServerInterceptor {
40
46
return func (
41
47
srv interface {},
42
48
stream grpc.ServerStream ,
You can’t perform that action at this time.
0 commit comments