grpc-multi-interceptor is a simple library which provides a function to chain multiple UnaryServerInterceptor
s or StreamServerInterceptor
s for gRPC.
import (
mint "github.com/kazegusuri/grpc-multi-interceptor"
)
func main() {
uIntOpt := grpc.UnaryInterceptor(mint.NewMultiUnaryServerInterceptor(
fooUnaryInterceptor,
barUnaryInterceptor,
))
sIntOpt := grpc.StreamInterceptor(mint.NewMultiStreamServerInterceptor(
fooStreamInterceptor,
barStreamInterceptor,
))
grpc.NewServer(uIntOpt, sIntOpt)
}
Author | Masahiro Sano |
Copyright | Copyright (c) 2016- Masahiro Sano |
License | MIT License |