mirror of
https://github.com/linka-cloud/grpc.git
synced 2025-06-22 01:02:29 +00:00
add sentry interceptors
This commit is contained in:
36
interceptors/sentry/interceptors.go
Normal file
36
interceptors/sentry/interceptors.go
Normal file
@ -0,0 +1,36 @@
|
||||
package sentry
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/johnbellone/grpc-middleware-sentry"
|
||||
|
||||
"go.linka.cloud/grpc/interceptors"
|
||||
)
|
||||
|
||||
type interceptor struct {
|
||||
opts []grpc_sentry.Option
|
||||
}
|
||||
|
||||
func NewInterceptors(option ...grpc_sentry.Option) interceptors.Interceptors {
|
||||
return &interceptor{opts: option}
|
||||
}
|
||||
|
||||
func (i *interceptor) UnaryServerInterceptor() grpc.UnaryServerInterceptor {
|
||||
return grpc_sentry.UnaryServerInterceptor(i.opts...)
|
||||
}
|
||||
|
||||
func (i *interceptor) StreamServerInterceptor() grpc.StreamServerInterceptor {
|
||||
return grpc_sentry.StreamServerInterceptor(i.opts...)
|
||||
}
|
||||
|
||||
func (i *interceptor) UnaryClientInterceptor() grpc.UnaryClientInterceptor {
|
||||
return grpc_sentry.UnaryClientInterceptor(i.opts...)
|
||||
}
|
||||
|
||||
func (i *interceptor) StreamClientInterceptor() grpc.StreamClientInterceptor {
|
||||
return grpc_sentry.StreamClientInterceptor(i.opts...)
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user