go-zero/zrpc/internal/chainserverinterceptors.go

14 lines
499 B
Go
Raw Normal View History

2020-07-29 18:06:57 +08:00
package internal
2020-07-26 17:09:05 +08:00
2020-11-11 17:20:56 +08:00
import "google.golang.org/grpc"
2020-07-26 17:09:05 +08:00
2021-03-01 23:52:44 +08:00
// WithStreamServerInterceptors uses given server stream interceptors.
2020-07-26 17:09:05 +08:00
func WithStreamServerInterceptors(interceptors ...grpc.StreamServerInterceptor) grpc.ServerOption {
return grpc.ChainStreamInterceptor(interceptors...)
2020-07-26 17:09:05 +08:00
}
2021-03-01 23:52:44 +08:00
// WithUnaryServerInterceptors uses given server unary interceptors.
2020-07-26 17:09:05 +08:00
func WithUnaryServerInterceptors(interceptors ...grpc.UnaryServerInterceptor) grpc.ServerOption {
return grpc.ChainUnaryInterceptor(interceptors...)
2020-11-11 17:20:56 +08:00
}