tui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DoctorKeys = DoctorKeyMap{
	Back:   key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "back")),
	Expand: key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "details")),
	Rescan: key.NewBinding(key.WithKeys("R"), key.WithHelp("R", "re-scan")),
}
View Source
var GraphKeys = GraphKeyMap{
	Back:   key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "back")),
	Select: key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "select")),
}
View Source
var LogsKeys = LogsKeyMap{
	Back:       key.NewBinding(key.WithKeys("esc"), key.WithHelp("esc", "back")),
	Timestamps: key.NewBinding(key.WithKeys("t"), key.WithHelp("t", "timestamps")),
	Wrap:       key.NewBinding(key.WithKeys("w"), key.WithHelp("w", "wrap")),
	Search:     key.NewBinding(key.WithKeys("/"), key.WithHelp("/", "search")),
	Clear:      key.NewBinding(key.WithKeys("c"), key.WithHelp("c", "clear")),
	Top:        key.NewBinding(key.WithKeys("g"), key.WithHelp("g", "top")),
	Bottom:     key.NewBinding(key.WithKeys("G"), key.WithHelp("G", "bottom")),
}
View Source
var ServicesKeys = ServicesKeyMap{
	Up:      key.NewBinding(key.WithKeys("up", "k"), key.WithHelp("↑/k", "up")),
	Down:    key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "down")),
	Restart: key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "restart")),
	Shell:   key.NewBinding(key.WithKeys("s"), key.WithHelp("s", "shell")),
	Logs:    key.NewBinding(key.WithKeys("l"), key.WithHelp("l", "logs")),
	Delete:  key.NewBinding(key.WithKeys("x"), key.WithHelp("x", "stop")),
	Desc:    key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "describe")),
	Doctor:  key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "doctor")),
	Graph:   key.NewBinding(key.WithKeys("g"), key.WithHelp("g", "graph")),
	Filter:  key.NewBinding(key.WithKeys("/"), key.WithHelp("/", "filter")),
	Command: key.NewBinding(key.WithKeys(":"), key.WithHelp(":", "command")),
	Help:    key.NewBinding(key.WithKeys("?"), key.WithHelp("?", "help")),
	Quit:    key.NewBinding(key.WithKeys("q"), key.WithHelp("q", "quit")),
}

Functions

func Run

func Run() error

Types

type ActionResultMsg

type ActionResultMsg struct {
	Text string
	Err  error
}

type CommandModel

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

func NewCommandModel

func NewCommandModel() CommandModel

func (*CommandModel) Activate

func (m *CommandModel) Activate(mode InputMode)

func (CommandModel) Active

func (m CommandModel) Active() bool

func (CommandModel) Filter

func (m CommandModel) Filter() string

func (*CommandModel) SetServiceNames

func (m *CommandModel) SetServiceNames(names []string)

func (CommandModel) Update

func (m CommandModel) Update(msg tea.Msg) (CommandModel, tea.Cmd)

func (CommandModel) View

func (m CommandModel) View(width int) string

type CommandResult

type CommandResult struct {
	View   ViewType
	Arg    string
	IsQuit bool
	Filter string
}

type ConfirmAction

type ConfirmAction int
const (
	ConfirmRestart ConfirmAction = iota
	ConfirmDelete
)

type ConfirmModel

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

func NewConfirmModel

func NewConfirmModel() ConfirmModel

func (ConfirmModel) Request

func (m ConfirmModel) Request(action ConfirmAction, service string) ConfirmModel

func (ConfirmModel) Update

func (m ConfirmModel) Update(msg tea.Msg) (ConfirmModel, tea.Cmd)

func (ConfirmModel) View

func (m ConfirmModel) View() string

type ConfirmRequestMsg

type ConfirmRequestMsg struct {
	Action  ConfirmAction
	Service string
}

type ConfirmYesMsg

type ConfirmYesMsg struct {
	Action  ConfirmAction
	Service string
}

type DescribeModel

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

func NewDescribeModel

func NewDescribeModel() DescribeModel

func (DescribeModel) ServiceName

func (m DescribeModel) ServiceName() string

func (DescribeModel) Start

func (m DescribeModel) Start(service string, services []ServiceInfo, width, height int) (DescribeModel, tea.Cmd)

func (DescribeModel) Update

func (m DescribeModel) Update(msg tea.Msg) (DescribeModel, tea.Cmd)

func (DescribeModel) View

func (m DescribeModel) View(width, height int) string

type DoctorKeyMap

type DoctorKeyMap struct {
	Back   key.Binding
	Expand key.Binding
	Rescan key.Binding
}

type DoctorResultMsg

type DoctorResultMsg struct {
	Findings []doctor.Finding
}

type DoctorRunningMsg

type DoctorRunningMsg struct{}

type DoctorViewModel

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

func NewDoctorViewModel

func NewDoctorViewModel() DoctorViewModel

func (DoctorViewModel) Init

func (m DoctorViewModel) Init() tea.Cmd

func (DoctorViewModel) Update

func (m DoctorViewModel) Update(msg tea.Msg) (DoctorViewModel, tea.Cmd)

func (DoctorViewModel) View

func (m DoctorViewModel) View(width, height int) string

type GraphKeyMap

type GraphKeyMap struct {
	Back   key.Binding
	Select key.Binding
}

type GraphModel

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

func NewGraphModel

func NewGraphModel() GraphModel

func (GraphModel) Init

func (m GraphModel) Init() tea.Cmd

func (GraphModel) Update

func (m GraphModel) Update(msg tea.Msg) (GraphModel, tea.Cmd)

func (GraphModel) View

func (m GraphModel) View(width, height int) string

type HeaderModel

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

func NewHeaderModel

func NewHeaderModel() HeaderModel

func (HeaderModel) Init

func (m HeaderModel) Init() tea.Cmd

func (HeaderModel) Update

func (m HeaderModel) Update(msg tea.Msg) (HeaderModel, tea.Cmd)

func (HeaderModel) View

func (m HeaderModel) View(width int, active ViewType) string

type HelpModel

type HelpModel struct{}

func NewHelpModel

func NewHelpModel() HelpModel

func (HelpModel) View

func (m HelpModel) View(width, height int, active ViewType) string

type InputMode

type InputMode int
const (
	ModeCommand InputMode = iota
	ModeFilter
)

type LogErrMsg

type LogErrMsg struct {
	Err error
}

type LogLineMsg

type LogLineMsg struct {
	Line string
}

type LogsKeyMap

type LogsKeyMap struct {
	Back       key.Binding
	Timestamps key.Binding
	Wrap       key.Binding
	Search     key.Binding
	Clear      key.Binding
	Top        key.Binding
	Bottom     key.Binding
}

type LogsModel

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

func NewLogsModel

func NewLogsModel() LogsModel

func (LogsModel) ServiceName

func (m LogsModel) ServiceName() string

func (LogsModel) Start

func (m LogsModel) Start(service string, width, height int) (LogsModel, tea.Cmd)

func (*LogsModel) Stop

func (m *LogsModel) Stop()

func (LogsModel) Update

func (m LogsModel) Update(msg tea.Msg) (LogsModel, tea.Cmd)

func (LogsModel) View

func (m LogsModel) View(width, height int) string

type Model

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

func NewModel

func NewModel() Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type ServiceInfo

type ServiceInfo struct {
	Name   string
	State  string
	Health string
	Ports  string
	Tier   int
	Uptime time.Duration
	CPU    float64
	Memory float64
}

type ServiceStats

type ServiceStats struct {
	CPU    float64
	Memory float64
}

type ServiceUpdateMsg

type ServiceUpdateMsg struct {
	Services []ServiceInfo
	Err      error
}

type ServicesKeyMap

type ServicesKeyMap struct {
	Up      key.Binding
	Down    key.Binding
	Restart key.Binding
	Shell   key.Binding
	Logs    key.Binding
	Delete  key.Binding
	Desc    key.Binding
	Doctor  key.Binding
	Graph   key.Binding
	Filter  key.Binding
	Command key.Binding
	Help    key.Binding
	Quit    key.Binding
}

type ServicesModel

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

func NewServicesModel

func NewServicesModel() ServicesModel

func (ServicesModel) Count

func (m ServicesModel) Count() int

func (ServicesModel) ErrorZoom

func (m ServicesModel) ErrorZoom() bool

func (ServicesModel) Init

func (m ServicesModel) Init() tea.Cmd

func (ServicesModel) Selected

func (m ServicesModel) Selected() string

func (ServicesModel) Services

func (m ServicesModel) Services() []ServiceInfo

func (ServicesModel) SetFilter

func (m ServicesModel) SetFilter(f string) ServicesModel

func (ServicesModel) ToggleErrorZoom

func (m ServicesModel) ToggleErrorZoom() ServicesModel

func (ServicesModel) Update

func (m ServicesModel) Update(msg tea.Msg) (ServicesModel, tea.Cmd)

func (ServicesModel) View

func (m ServicesModel) View(width, height int) string

type StatsHistory

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

func (*StatsHistory) Push

func (h *StatsHistory) Push(cpu, mem float64)

type StatsUpdateMsg

type StatsUpdateMsg struct {
	Stats map[string]ServiceStats
}

type TickMsg

type TickMsg time.Time

type ToastExpiredMsg

type ToastExpiredMsg struct{}

type ToastModel

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

func NewToastModel

func NewToastModel() ToastModel

func (ToastModel) Hide

func (m ToastModel) Hide() ToastModel

func (ToastModel) Message

func (m ToastModel) Message() string

func (ToastModel) Show

func (m ToastModel) Show(text string) ToastModel

func (ToastModel) Tick

func (m ToastModel) Tick() tea.Cmd

type ToastMsg

type ToastMsg struct {
	Text string
}

type ViewType

type ViewType int
const (
	ViewServices ViewType = iota
	ViewLogs
	ViewDoctor
	ViewGraph
	ViewDescribe
)

Jump to

Keyboard shortcuts

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