Class: Karafka::Web::Ui::Controllers::RoutingController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/karafka/web/ui/controllers/routing_controller.rb

Overview

Routing presentation controller

Constant Summary

Constants inherited from BaseController

BaseController::Models

Instance Method Summary collapse

Methods inherited from BaseController

#initialize

Constructor Details

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

Instance Method Details

#indexObject

Routing list



15
16
17
18
19
20
21
22
23
# File 'lib/karafka/web/ui/controllers/routing_controller.rb', line 15

def index
  @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



28
29
30
31
32
33
34
# File 'lib/karafka/web/ui/controllers/routing_controller.rb', line 28

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

  @topic || not_found!(topic_id)

  render
end