options: fix interceptors, add defaulter and recovery

This commit is contained in:
2021-11-21 16:13:43 +01:00
parent dc78a2c688
commit d246bb3214
11 changed files with 165 additions and 40 deletions

View File

@ -0,0 +1,29 @@
package recovery
import (
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
"google.golang.org/grpc"
)
type interceptors struct {
opts grpc_recovery.Option
}
func (i *interceptors) UnaryServerInterceptor() grpc.UnaryServerInterceptor {
return grpc_recovery.UnaryServerInterceptor(i.opts)
}
func (i *interceptors) StreamServerInterceptor() grpc.StreamServerInterceptor {
return grpc_recovery.StreamServerInterceptor(i.opts)
}
func (i *interceptors) UnaryClientInterceptor() grpc.UnaryClientInterceptor {
panic("not implemented")
}
func (i *interceptors) StreamClientInterceptor() grpc.StreamClientInterceptor {
panic("not implemented")
}