grpc/interceptors/recovery/interceptors.go

33 lines
813 B
Go
Raw Normal View History

package recovery
import (
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
"google.golang.org/grpc"
2021-11-25 17:22:57 +00:00
"go.linka.cloud/grpc/interceptors"
)
2021-11-25 17:22:57 +00:00
func NewInterceptors(opts ...grpc_recovery.Option) interceptors.ServerInterceptors {
return &recovery{opts: opts}
}
type recovery struct {
opts []grpc_recovery.Option
}
2021-11-25 17:22:57 +00:00
func (i *recovery) UnaryServerInterceptor() grpc.UnaryServerInterceptor {
return grpc_recovery.UnaryServerInterceptor(i.opts...)
}
2021-11-25 17:22:57 +00:00
func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor {
return grpc_recovery.StreamServerInterceptor(i.opts...)
}
2021-11-25 17:22:57 +00:00
func (i *recovery) UnaryClientInterceptor() grpc.UnaryClientInterceptor {
panic("not implemented")
}
2021-11-25 17:22:57 +00:00
func (i *recovery) StreamClientInterceptor() grpc.StreamClientInterceptor {
panic("not implemented")
}