kafui

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 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(cfgOption string, 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
	CurrentResource      *Resource
	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) 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) ShowNotification added in v0.1.24

func (m *MainPage) ShowNotification(message string)

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) 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 ResouceTopic added in v0.1.27

type ResouceTopic struct {
	LastFetchedTopics map[string]api.Topic
	// contains filtered or unexported fields
}

func NewResouceTopic added in v0.1.27

func NewResouceTopic(dataSource api.KafkaDataSource, onError func(err error), recoverFunc func()) *ResouceTopic

func (*ResouceTopic) FetchTopics added in v0.1.27

func (r *ResouceTopic) FetchTopics(dataSource api.KafkaDataSource) map[string]api.Topic

func (ResouceTopic) GetName added in v0.1.27

func (r ResouceTopic) GetName() string

func (*ResouceTopic) ShowTopicsInTable added in v0.1.27

func (r *ResouceTopic) ShowTopicsInTable(table *tview.Table, topics map[string]api.Topic, search string)

func (*ResouceTopic) StartFetchingData added in v0.1.27

func (r *ResouceTopic) StartFetchingData()

func (*ResouceTopic) StopFetching added in v0.1.27

func (r *ResouceTopic) StopFetching()

func (*ResouceTopic) UpdateTable added in v0.1.27

func (r *ResouceTopic) UpdateTable(table *tview.Table, dataSource api.KafkaDataSource, search string)

func (*ResouceTopic) UpdateTableDataRoutine added in v0.1.27

func (r *ResouceTopic) UpdateTableDataRoutine(ctx context.Context, dataSource api.KafkaDataSource)

type Resource added in v0.1.27

type Resource interface {
	StartFetchingData()
	UpdateTable(table *tview.Table, dataSource api.KafkaDataSource, search string)
	StopFetching()
	GetName() string
}

type ResourceContext added in v0.1.27

type ResourceContext struct {
	FetchedContexts map[string]string
	Name            string
	// contains filtered or unexported fields
}

func NewResourceContext added in v0.1.27

func NewResourceContext(dataSource api.KafkaDataSource, onError func(err error), recoverFunc func()) *ResourceContext

func (*ResourceContext) FetchContextRoutine added in v0.1.27

func (c *ResourceContext) FetchContextRoutine(ctx context.Context, dataSource api.KafkaDataSource)

func (*ResourceContext) FetchContexts added in v0.1.27

func (rc *ResourceContext) FetchContexts(dataSource api.KafkaDataSource) []string

func (ResourceContext) GetName added in v0.1.27

func (r ResourceContext) GetName() string

func (ResourceContext) ShowContextsInTable added in v0.1.27

func (r ResourceContext) ShowContextsInTable(table *tview.Table, contexts map[string]string, search string)

func (*ResourceContext) StartFetchingData added in v0.1.27

func (r *ResourceContext) StartFetchingData()

func (*ResourceContext) StopFetching added in v0.1.27

func (r *ResourceContext) StopFetching()

func (*ResourceContext) UpdateTable added in v0.1.27

func (r *ResourceContext) UpdateTable(table *tview.Table, dataSource api.KafkaDataSource, search string)

type ResourceGroup added in v0.1.27

type ResourceGroup struct {
	FetchedConsumerGroups map[string]api.ConsumerGroup
	// contains filtered or unexported fields
}

func NewResourceGroup added in v0.1.27

func NewResourceGroup(onError func(err error), dataSource api.KafkaDataSource, recoverFunc func()) *ResourceGroup

func (*ResourceGroup) FetchConsumerGroups added in v0.1.27

func (g *ResourceGroup) FetchConsumerGroups(dataSource api.KafkaDataSource) []api.ConsumerGroup

func (*ResourceGroup) FetchGroupsRoutine added in v0.1.27

func (g *ResourceGroup) FetchGroupsRoutine(ctx context.Context, dataSource api.KafkaDataSource)

func (ResourceGroup) GetName added in v0.1.27

func (r ResourceGroup) GetName() string

func (ResourceGroup) ShowConsumerGroups added in v0.1.27

func (r ResourceGroup) ShowConsumerGroups(table *tview.Table, cgs map[string]api.ConsumerGroup, search string)

func (*ResourceGroup) StartFetchingData added in v0.1.27

func (r *ResourceGroup) StartFetchingData()

func (*ResourceGroup) StopFetching added in v0.1.27

func (r *ResourceGroup) StopFetching()

func (*ResourceGroup) UpdateTable added in v0.1.27

func (r *ResourceGroup) UpdateTable(table *tview.Table, dataSource api.KafkaDataSource, search string)
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 Resource
	UpdateTable     func(newResource Resource, searchText string)
	// contains filtered or unexported fields
}

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(newResource Resource, searchText string), onError func(err error)) *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