mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 09:12:28 +00:00
options: fix interceptors, add defaulter and recovery
This commit is contained in:
29
interceptors/recovery/interceptors.go
Normal file
29
interceptors/recovery/interceptors.go
Normal 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")
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user