kafui

package
v0.1.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

https://stackoverflow.com/a/70802740

func CopySelectedRowToClipboard

func CopySelectedRowToClipboard(table *tview.Table, ConsumeMessage func(message string))

Function to copy the selected row of the table to the clipboard in CSV format

func CreateMainInputLegend

func CreateMainInputLegend() *tview.Flex

func CreatePropertyInfo

func CreatePropertyInfo(propertyName string, propertyValue string) *tview.InputField

func CreateRunInfo

func CreateRunInfo(runeName string, info string) *tview.InputField

func Init

func Init(useMock bool)

func OpenUI

func OpenUI(dataSource api.KafkaDataSource)

func RecoverAndExit added in v0.1.24

func RecoverAndExit(app *tview.Application)

Types

type ByOffsetThenPartition

type ByOffsetThenPartition []api.Message

Implement the sort.Interface

func (ByOffsetThenPartition) Len

func (a ByOffsetThenPartition) Len() int

func (ByOffsetThenPartition) Less

func (a ByOffsetThenPartition) Less(i, j int) bool

func (ByOffsetThenPartition) Swap

func (a ByOffsetThenPartition) Swap(i, j int)

type DetailPage

type DetailPage struct {
	// contains filtered or unexported fields
}

func NewDetailPage

func NewDetailPage(app *tview.Application, pages *tview.Pages, value string) *DetailPage

func (*DetailPage) CreateInputLegend

func (vp *DetailPage) CreateInputLegend() *tview.Flex

func (*DetailPage) Hide

func (vp *DetailPage) Hide()

Hide hides the page.

func (*DetailPage) Show

func (vp *DetailPage) Show()

type MainPage added in v0.1.24

type MainPage struct {
	CurrentContextName    string
	NotificationTextView  *tview.TextView
	MidFlex               *tview.Flex
	ContextInfo           *tview.InputField
	CurrentSearchString   string
	LastFetchedTopics     map[string]api.Topic
	FetchedContexts       map[string]string
	FetchedConsumerGroups map[string]api.ConsumerGroup
	SearchBar             SearchBar
}

func NewMainPage added in v0.1.24

func NewMainPage() *MainPage

func (*MainPage) CreateMainPage added in v0.1.24

func (m *MainPage) CreateMainPage(dataSource api.KafkaDataSource, pages *tview.Pages, app *tview.Application, modal *tview.Modal, msgChannel chan UIEvent) *tview.Flex

func (*MainPage) CurrentTimeString added in v0.1.24

func (m *MainPage) CurrentTimeString() string

func (*MainPage) FetchConsumerGroups added in v0.1.24

func (m *MainPage) FetchConsumerGroups(dataSource api.KafkaDataSource) []api.ConsumerGroup

func (*MainPage) FetchContexts added in v0.1.24

func (m *MainPage) FetchContexts(dataSource api.KafkaDataSource) []string

func (*MainPage) FetchTopics added in v0.1.24

func (m *MainPage) FetchTopics(dataSource api.KafkaDataSource) map[string]api.Topic

func (*MainPage) SetupTableInput added in v0.1.24

func (m *MainPage) SetupTableInput(table *tview.Table, app *tview.Application, pages *tview.Pages, dataSource api.KafkaDataSource, msgChannel chan UIEvent)

func (*MainPage) ShowConsumerGroups added in v0.1.24

func (m *MainPage) ShowConsumerGroups(table *tview.Table, cgs map[string]api.ConsumerGroup)

func (*MainPage) ShowContextsInTable added in v0.1.24

func (m *MainPage) ShowContextsInTable(table *tview.Table, contexts map[string]string)

func (*MainPage) ShowNotification added in v0.1.24

func (m *MainPage) ShowNotification(message string)

func (*MainPage) ShowTopicsInTable added in v0.1.24

func (m *MainPage) ShowTopicsInTable(table *tview.Table, topics map[string]api.Topic)

func (*MainPage) UpdateMidFlexTitle added in v0.1.24

func (m *MainPage) UpdateMidFlexTitle(currentResouce string, amount int)

func (*MainPage) UpdateTable added in v0.1.24

func (m *MainPage) UpdateTable(table *tview.Table, dataSource api.KafkaDataSource)

func (*MainPage) UpdateTableDataRoutine added in v0.1.25

func (m *MainPage) UpdateTableDataRoutine(app *tview.Application, dataSource api.KafkaDataSource)

func (*MainPage) UpdateTableRoutine added in v0.1.24

func (m *MainPage) UpdateTableRoutine(app *tview.Application, table *tview.Table, timerView *tview.TextView, dataSource api.KafkaDataSource)

type ResouceName

type ResouceName []string // array because it can have multiple names
var (
	Context       ResouceName = []string{"context", "ctx", "kafka", "broker"}
	Topic         ResouceName = []string{"topics", "ts"}
	ConsumerGroup ResouceName = []string{"consumergroups", "groups", "consumers", "cgs"}
)
type SearchBar struct {
	Table           *tview.Table
	DataSource      api.KafkaDataSource
	Pages           *tview.Pages
	App             *tview.Application
	Modal           *tview.Modal
	DefaultLabel    string
	SearchInput     *tview.InputField
	CurrentMode     SearchMode
	CurrentString   string
	CurrentResource string
	UpdateTable     func(resourceName string, searchText string)
}

func NewSearchBar added in v0.1.24

func NewSearchBar(table *tview.Table, dataSource api.KafkaDataSource, pages *tview.Pages, app *tview.Application, modal *tview.Modal, updateTable func(resouceName string, searchText string)) *SearchBar

func (*SearchBar) CreateSearchInput added in v0.1.24

func (s *SearchBar) CreateSearchInput(msgChannel chan UIEvent) *tview.InputField

func (*SearchBar) ReceivingMessage added in v0.1.24

func (s *SearchBar) ReceivingMessage(app *tview.Application, table *tview.Table, searchInput *tview.InputField, msgChannel chan UIEvent)

type SearchMode

type SearchMode string
const (
	TableSearch   SearchMode = "TableSearch"
	ResouceSearch SearchMode = "ResouceSearch"
)

type TopicPage

type TopicPage struct {
	// contains filtered or unexported fields
}

func NewTopicPage

func NewTopicPage(dataSource api.KafkaDataSource, pages *tview.Pages, app *tview.Application, msgChannel chan UIEvent) *TopicPage

func (*TopicPage) CloseTopicPage

func (tp *TopicPage) CloseTopicPage()

func (*TopicPage) CreateConsumeFlagsSection

func (tp *TopicPage) CreateConsumeFlagsSection() *tview.Flex

func (*TopicPage) CreateInputLegend

func (tp *TopicPage) CreateInputLegend() *tview.Flex

func (*TopicPage) CreateInputSearch

func (tp *TopicPage) CreateInputSearch(onDone func()) *tview.Flex

func (*TopicPage) CreateTopicInfoSection

func (tp *TopicPage) CreateTopicInfoSection(topicName string, topicDetail api.Topic) *tview.Flex

func (*TopicPage) CreateTopicPage

func (tp *TopicPage) CreateTopicPage(currentTopic string) *tview.Flex

func (*TopicPage) PageConsumeTopic

func (tp *TopicPage) PageConsumeTopic(topicName string, currentTopic api.Topic, flags api.ConsumeFlags)

func (*TopicPage) RestartConsumer

func (tp *TopicPage) RestartConsumer()

func (*TopicPage) ShowNotification

func (tp *TopicPage) ShowNotification(message string)

type UIEvent

type UIEvent string
const (
	OnModalClose       UIEvent = "ModalClose"
	OnFocusSearch      UIEvent = "FocusSearch"
	OnStartTableSearch UIEvent = "OnStartTableSearch"
	OnPageChange       UIEvent = "PageChange"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL