Sha256: a78c829ad06845b740af0e62950e764c86113fb9eac18e77f42a6e1501e0e46f

Contents?: true

Size: 1.62 KB

Versions: 11

Compression:

Stored size: 1.62 KB

Contents

# frozen_string_literal: true

# This Karafka component is a Pro component under a commercial license.
# This Karafka component is NOT licensed under LGPL.
#
# All of the commercial components are present in the lib/karafka/pro directory of this
# repository and their usage requires commercial license agreement.
#
# Karafka has also commercial-friendly license, commercial support and commercial components.
#
# By sending a pull request to the pro components, you are agreeing to transfer the copyright of
# your code to Maciej Mensfeld.

module Karafka
  module Web
    module Pro
      module Ui
        module Controllers
          # Routing details - same as in OSS
          class RoutingController < BaseController
            self.sortable_attributes = %w[
              name
              active?
            ].freeze

            # Routing list
            def index
              detect_patterns_routes

              @routes = Karafka::App.routes

              @routes.each do |consumer_group|
                refine(consumer_group.topics)
              end

              render
            end

            # Given route details
            #
            # @param topic_id [String] topic id
            def show(topic_id)
              detect_patterns_routes

              @topic = Karafka::Routing::Router.find_by(id: topic_id)

              @topic || not_found!(topic_id)

              render
            end

            private

            # Detect routes defined as patterns
            def detect_patterns_routes
              Lib::PatternsDetector.new.call
            end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
karafka-web-0.10.2 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.10.1 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.10.0 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.10.0.rc2 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.10.0.rc1 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.10.0.beta1 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.9.1 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.9.0 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.9.0.rc3 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.9.0.rc2 lib/karafka/web/pro/ui/controllers/routing_controller.rb
karafka-web-0.9.0.rc1 lib/karafka/web/pro/ui/controllers/routing_controller.rb