Help us shape the future of Go! Take the 2026 Go Developer Survey

views

package
v0.0.0-...-b830f6f Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatResourceType

func FormatResourceType(resourceType string) string

FormatResourceType formats the resource type for display

func GetDescribeContent

func GetDescribeContent(ctx context.Context, client *k8s.Client, resourceType, resourceName, namespace string) (string, error)

GetDescribeUsingClient gets actual describe content using the K8s client

Types

type ConfirmView

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

ConfirmView displays a confirmation dialog

func NewConfirmView

func NewConfirmView(title, message string) *ConfirmView

NewConfirmView creates a new confirmation dialog

func (*ConfirmView) Init

func (v *ConfirmView) Init() tea.Cmd

Init initializes the view

func (*ConfirmView) IsCompleted

func (v *ConfirmView) IsCompleted() bool

IsCompleted returns whether the dialog has been completed (user made a choice)

func (*ConfirmView) IsConfirmed

func (v *ConfirmView) IsConfirmed() bool

IsConfirmed returns whether the user confirmed the action

func (*ConfirmView) SetCancelText

func (v *ConfirmView) SetCancelText(text string)

SetCancelText sets custom cancel button text

func (*ConfirmView) SetConfirmText

func (v *ConfirmView) SetConfirmText(text string)

SetConfirmText sets custom confirm button text

func (*ConfirmView) SetSize

func (v *ConfirmView) SetSize(width, height int)

SetSize updates the view size

func (*ConfirmView) Update

func (v *ConfirmView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*ConfirmView) View

func (v *ConfirmView) View() string

View renders the confirmation dialog

type ContextInfoMsg

type ContextInfoMsg struct {
	ContextName string
}

ContextInfoMsg is sent when context info should be displayed

type ContextView

type ContextView struct {
	SearchMode bool
	// contains filtered or unexported fields
}

ContextView displays available Kubernetes contexts for selection

func NewContextView

func NewContextView(contexts []string, currentContexts []string) *ContextView

NewContextView creates a new context selector view

func (*ContextView) GetSelectedContexts

func (v *ContextView) GetSelectedContexts() []string

GetSelectedContexts returns the selected context names

func (*ContextView) Init

func (v *ContextView) Init() tea.Cmd

Init initializes the view

func (*ContextView) IsLoading

func (v *ContextView) IsLoading() bool

IsLoading returns whether the view is in loading state

func (*ContextView) SetContextLoading

func (v *ContextView) SetContextLoading(contextName string, loading bool)

SetContextLoading sets the loading state for a specific context

func (*ContextView) SetLoading

func (v *ContextView) SetLoading(loading bool)

SetLoading sets the loading state for the entire view

func (*ContextView) SetSize

func (v *ContextView) SetSize(width, height int)

SetSize updates the view size

func (*ContextView) Update

func (v *ContextView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*ContextView) View

func (v *ContextView) View() string

View renders the context selector

type DataView

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

DataView displays ConfigMap or Secret data

func NewConfigMapView

func NewConfigMapView(cm *v1.ConfigMap) *DataView

NewConfigMapView creates a view for a ConfigMap

func NewSecretView

func NewSecretView(secret *v1.Secret) *DataView

NewSecretView creates a view for a Secret

func (*DataView) Init

func (v *DataView) Init() tea.Cmd

Init initializes the view

func (*DataView) SetSize

func (v *DataView) SetSize(width, height int)

SetSize updates the view size

func (*DataView) Update

func (v *DataView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*DataView) View

func (v *DataView) View() string

View renders the data view

type DescribeView

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

DescribeView displays the kubectl describe output for a resource

func NewDescribeView

func NewDescribeView(resourceType, resourceName, namespace, context string) *DescribeView

NewDescribeView creates a new describe view for a resource

func (*DescribeView) Init

func (v *DescribeView) Init() tea.Cmd

Init initializes the view

func (*DescribeView) LoadDescribeWithClient

func (v *DescribeView) LoadDescribeWithClient(ctx context.Context, client *k8s.Client) tea.Cmd

LoadDescribeWithClient loads the describe output using a real K8s client

func (*DescribeView) SetSize

func (v *DescribeView) SetSize(width, height int)

SetSize updates the view size

func (*DescribeView) Update

func (v *DescribeView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*DescribeView) View

func (v *DescribeView) View() string

View renders the describe view

type ErrorMsg

type ErrorMsg struct {
	Error error
}

Message types

type GenericResourceView

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

GenericResourceView is a generic view that uses the template-driven configuration system

func NewGenericResourceView

func NewGenericResourceView(state *core.State, registry *resource.Registry, engine *template.Engine, dynamicClient dynamic.Interface) (*GenericResourceView, error)

NewGenericResourceView creates a new generic resource view

func (*GenericResourceView) GetSelectedResource

func (v *GenericResourceView) GetSelectedResource() *unstructured.Unstructured

GetSelectedResource returns the currently selected resource

func (*GenericResourceView) Init

func (v *GenericResourceView) Init() tea.Cmd

Init initializes the view

func (*GenericResourceView) RefreshResources

func (v *GenericResourceView) RefreshResources(ctx context.Context) error

RefreshResources fetches resources using the dynamic client

func (*GenericResourceView) SetFilter

func (v *GenericResourceView) SetFilter(filter string)

SetFilter sets the filter text

func (*GenericResourceView) SetResourceType

func (v *GenericResourceView) SetResourceType(resourceType string) error

SetResourceType sets the current resource type

func (*GenericResourceView) SetSort

func (v *GenericResourceView) SetSort(column int, ascending bool)

SetSort sets the sort column and direction

func (*GenericResourceView) Update

func (v *GenericResourceView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*GenericResourceView) View

func (v *GenericResourceView) View() string

View renders the view

type HelpView

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

HelpView displays help information

func NewHelpView

func NewHelpView() *HelpView

NewHelpView creates a new help view

func (*HelpView) Init

func (v *HelpView) Init() tea.Cmd

Init initializes the view

func (*HelpView) SetContext

func (v *HelpView) SetContext(context string)

SetContext sets the help context (resource or logs)

func (*HelpView) SetModeHelp

func (v *HelpView) SetModeHelp(mode interface{})

SetModeHelp sets help content from a screen mode

func (*HelpView) Update

func (v *HelpView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*HelpView) View

func (v *HelpView) View() string

View renders the help screen

type LogView

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

LogView displays logs from pods

func NewLogView

func NewLogView() *LogView

NewLogView creates a new log view

func (*LogView) Init

func (v *LogView) Init() tea.Cmd

Init initializes the view

func (*LogView) IsSearchMode

func (v *LogView) IsSearchMode() bool

IsSearchMode returns true if the log view is in search mode

func (*LogView) SetSize

func (v *LogView) SetSize(width, height int)

SetSize updates the view size

func (*LogView) StartStreaming

func (v *LogView) StartStreaming(ctx context.Context, client *k8s.Client, state *core.State, selectedResourceName string) tea.Cmd

StartStreaming starts streaming logs for the selected resource

func (*LogView) StopStreaming

func (v *LogView) StopStreaming() tea.Cmd

StopStreaming stops streaming logs

func (*LogView) Update

func (v *LogView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*LogView) View

func (v *LogView) View() string

View renders the view

type NamespaceView

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

NamespaceView displays a list of namespaces for selection

func NewNamespaceView

func NewNamespaceView(namespaces []v1.Namespace, currentNamespace string) *NamespaceView

NewNamespaceView creates a new namespace selector view

func NewNamespaceViewWithLoading

func NewNamespaceViewWithLoading(currentNamespace string, loadingMessage string) *NamespaceView

NewNamespaceViewWithLoading creates a new namespace selector view in loading state

func (*NamespaceView) GetSelectedNamespace

func (v *NamespaceView) GetSelectedNamespace() string

GetSelectedNamespace returns the selected namespace name

func (*NamespaceView) Init

func (v *NamespaceView) Init() tea.Cmd

Init initializes the view

func (*NamespaceView) SetLoading

func (v *NamespaceView) SetLoading(loading bool, message string)

SetLoading sets the loading state

func (*NamespaceView) SetNamespaces

func (v *NamespaceView) SetNamespaces(namespaces []v1.Namespace)

SetNamespaces updates the namespaces and clears loading state

func (*NamespaceView) SetSize

func (v *NamespaceView) SetSize(width, height int)

SetSize updates the view size

func (*NamespaceView) Update

func (v *NamespaceView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*NamespaceView) View

func (v *NamespaceView) View() string

View renders the namespace selector

type RefreshCompleteMsg

type RefreshCompleteMsg struct{}

type ResourceSelectedMsg

type ResourceSelectedMsg struct {
	ResourceType core.ResourceType
}

ResourceSelectedMsg is sent when a resource type is selected

type ResourceSelectorCancelledMsg

type ResourceSelectorCancelledMsg struct{}

ResourceSelectorCancelledMsg is sent when the selector is cancelled

type ResourceSelectorView

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

ResourceSelectorView provides a dropdown for selecting resource types

func NewResourceSelectorView

func NewResourceSelectorView() *ResourceSelectorView

NewResourceSelectorView creates a new resource selector view

func (*ResourceSelectorView) Close

func (v *ResourceSelectorView) Close()

Close closes the dropdown

func (*ResourceSelectorView) GetSelectedOption

func (v *ResourceSelectorView) GetSelectedOption() dropdown.Option

GetSelectedOption returns the currently selected option

func (*ResourceSelectorView) Init

func (v *ResourceSelectorView) Init() tea.Cmd

Init initializes the view

func (*ResourceSelectorView) IsOpen

func (v *ResourceSelectorView) IsOpen() bool

IsOpen returns whether the dropdown is open

func (*ResourceSelectorView) Open

func (v *ResourceSelectorView) Open()

Open opens the dropdown

func (*ResourceSelectorView) SetCurrentResourceType

func (v *ResourceSelectorView) SetCurrentResourceType(resourceType core.ResourceType)

SetCurrentResourceType sets the currently selected resource type

func (*ResourceSelectorView) SetSize

func (v *ResourceSelectorView) SetSize(width, height int)

SetSize sets the view dimensions (screen size for centering)

func (*ResourceSelectorView) Update

func (v *ResourceSelectorView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*ResourceSelectorView) View

func (v *ResourceSelectorView) View() string

View renders the view

type ResourceUpdateMsg

type ResourceUpdateMsg struct {
	ResourceType string
}

type ResourceView

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

ResourceView displays a list of Kubernetes resources

func NewResourceView

func NewResourceView(state *core.State, k8sClient *k8s.Client) *ResourceView

NewResourceView creates a new resource view

func NewResourceViewWithMultiContext

func NewResourceViewWithMultiContext(state *core.State, multiClient *k8s.MultiContextClient) *ResourceView

NewResourceViewWithMultiContext creates a new resource view with multi-context support

func (*ResourceView) DeleteSelected

func (v *ResourceView) DeleteSelected() tea.Cmd

DeleteSelected deletes the selected resource(s)

func (*ResourceView) DisableNewComponents

func (rv *ResourceView) DisableNewComponents()

DisableNewComponents disables the new refactored components, falling back to legacy rendering

func (*ResourceView) EnableNewComponents

func (rv *ResourceView) EnableNewComponents()

EnableNewComponents enables the new refactored components for rendering

func (*ResourceView) GetSelectedResourceContext

func (v *ResourceView) GetSelectedResourceContext() string

GetSelectedResourceContext returns the context of the currently selected resource (multi-context mode)

func (*ResourceView) GetSelectedResourceName

func (v *ResourceView) GetSelectedResourceName() string

GetSelectedResourceName returns the name of the currently selected resource

func (*ResourceView) Init

func (v *ResourceView) Init() tea.Cmd

Init initializes the view

func (*ResourceView) IsUsingNewComponents

func (rv *ResourceView) IsUsingNewComponents() bool

IsUsingNewComponents returns whether new components are currently enabled

func (*ResourceView) RefreshResources

func (v *ResourceView) RefreshResources() tea.Cmd

RefreshResources fetches and updates the resource list

func (*ResourceView) SetCompactMode

func (v *ResourceView) SetCompactMode(compact bool)

SetCompactMode enables/disables compact mode for split view

func (*ResourceView) SetSelectedRow

func (v *ResourceView) SetSelectedRow(row int)

SetSelectedRow sets the selected row index (for testing purposes)

func (*ResourceView) SetSize

func (v *ResourceView) SetSize(width, height int)

SetSize updates the view size

func (*ResourceView) SetTestData

func (v *ResourceView) SetTestData(headers []string, rows [][]string)

SetTestData sets test data for the ResourceView (for testing purposes)

func (*ResourceView) TryUpdateWithNewComponents

func (rv *ResourceView) TryUpdateWithNewComponents(resources []interface{}) bool

TryUpdateWithNewComponents attempts to update the table using new components Returns true if successful, false if it falls back to legacy methods

func (*ResourceView) Update

func (v *ResourceView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages

func (*ResourceView) View

func (v *ResourceView) View() string

View renders the view

Jump to

Keyboard shortcuts

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