Class: Karafka::Web::Ui::Pro::Controllers::Routing

Inherits:
Controllers::Routing show all
Defined in:
lib/karafka/web/ui/pro/controllers/routing.rb

Overview

Routing details - same as in OSS

Instance Method Summary collapse

Methods inherited from Controllers::Base

#initialize

Constructor Details

This class inherits a constructor from Karafka::Web::Ui::Controllers::Base

Instance Method Details

#indexObject

Routing list



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/karafka/web/ui/pro/controllers/routing.rb', line 27

def index
  detect_patterns_routes

  @routes = Karafka::App.routes

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

  render
end

#show(topic_id) ⇒ Object

Given route details

Parameters:

  • topic_id (String)

    topic id



42
43
44
45
46
47
48
49
50
# File 'lib/karafka/web/ui/pro/controllers/routing.rb', line 42

def show(topic_id)
  detect_patterns_routes

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

  @topic || raise(::Karafka::Web::Errors::Ui::NotFoundError, topic_id)

  render
end