// Stream intercepts stream RPC requests

Stream intercepts stream RPC requests
// Stream intercepts stream RPC requests
func (interceptor *AuthInterceptor) Stream() grpc.StreamServerInterceptor {
	return func(
		srv interface{},
		stream grpc.ServerStream,
		info *grpc.StreamServerInfo,
		handler grpc.StreamHandler,
	) error {
		newCtx, err := interceptor.authorize(stream.Context(), info.FullMethod)
		if err != nil {
			return err
		}
		wrapped := WrapServerStream(stream)
		wrapped.WrappedContext = newCtx
		return handler(srv, wrapped)
	}
}
func ( interceptor * AuthInterceptor ) Stream ( ) grpc . StreamServerInterceptor { return func ( srv interface { } , stream grpc . ServerStream , info * grpc . StreamServerInfo , handler grpc . StreamHandler , ) error { newCtx , err := interceptor . authorize ( stream . Context ( ) , info . FullMethod ) if err != nil { return err } wrapped := WrapServerStream ( stream ) wrapped . WrappedContext = newCtx return handler ( srv , wrapped ) } }
Stream intercepts stream RPC requests
Stream intercepts stream RPC requests