mirror of
				https://github.com/linka-cloud/grpc.git
				synced 2025-10-31 01:22:29 +00:00 
			
		
		
		
	recovery server interceptor
This commit is contained in:
		| @@ -3,25 +3,31 @@ package recovery | |||||||
| import ( | import ( | ||||||
| 	grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" | 	grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" | ||||||
| 	"google.golang.org/grpc" | 	"google.golang.org/grpc" | ||||||
|  |  | ||||||
|  | 	"go.linka.cloud/grpc/interceptors" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| type interceptors struct { | func NewInterceptors(opts ...grpc_recovery.Option) interceptors.ServerInterceptors { | ||||||
| 	opts grpc_recovery.Option | 	return &recovery{opts: opts} | ||||||
| } | } | ||||||
|  |  | ||||||
| func (i *interceptors) UnaryServerInterceptor() grpc.UnaryServerInterceptor { | type recovery struct { | ||||||
| 	return grpc_recovery.UnaryServerInterceptor(i.opts) | 	opts []grpc_recovery.Option | ||||||
| } | } | ||||||
|  |  | ||||||
| func (i *interceptors) StreamServerInterceptor() grpc.StreamServerInterceptor { | func (i *recovery) UnaryServerInterceptor() grpc.UnaryServerInterceptor { | ||||||
| 	return grpc_recovery.StreamServerInterceptor(i.opts) | 	return grpc_recovery.UnaryServerInterceptor(i.opts...) | ||||||
| } | } | ||||||
|  |  | ||||||
| func (i *interceptors) UnaryClientInterceptor() grpc.UnaryClientInterceptor { | func (i *recovery) StreamServerInterceptor() grpc.StreamServerInterceptor { | ||||||
|  | 	return grpc_recovery.StreamServerInterceptor(i.opts...) | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (i *recovery) UnaryClientInterceptor() grpc.UnaryClientInterceptor { | ||||||
| 	panic("not implemented") | 	panic("not implemented") | ||||||
| } | } | ||||||
|  |  | ||||||
| func (i *interceptors) StreamClientInterceptor() grpc.StreamClientInterceptor { | func (i *recovery) StreamClientInterceptor() grpc.StreamClientInterceptor { | ||||||
| 	panic("not implemented") | 	panic("not implemented") | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user