tui

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AltScreenEnabledFromEnv

func AltScreenEnabledFromEnv() bool

func MouseEnabledFromEnv

func MouseEnabledFromEnv() bool

func ServiceActionTarget

func ServiceActionTarget(action ActionID) (string, string, bool)

func StackActionTarget

func StackActionTarget(action ActionID) (string, string, bool)

Types

type ActionID

type ActionID string
const (
	ActionStart       ActionID = "start"
	ActionStop        ActionID = "stop"
	ActionRestart     ActionID = "restart"
	ActionUseStack    ActionID = "use-stack"
	ActionOpenCockpit ActionID = "open-cockpit"
	ActionOpenPgAdmin ActionID = "open-pgadmin"
	ActionDoctor      ActionID = "doctor"
)

type ActionReport

type ActionReport struct {
	Status  string
	Message string
	Details []string
	Refresh bool
}

type ActionRunner

type ActionRunner func(ActionID) (ActionReport, error)

type ActionSpec

type ActionSpec struct {
	ID             ActionID
	Label          string
	Group          string
	ConfirmMessage string
	PendingMessage string
	PendingStatus  string
	DefaultStatus  string
}

func (ActionSpec) RequiresConfirmation

func (s ActionSpec) RequiresConfirmation() bool

type ClipboardWriter

type ClipboardWriter func(string) error

type ConfigManager

type ConfigManager struct {
	DefaultConfig             func() configpkg.Config
	SaveConfig                func(string, configpkg.Config) error
	ValidateConfig            func(configpkg.Config) []configpkg.ValidationIssue
	MarshalConfig             func(configpkg.Config) ([]byte, error)
	ManagedStackNeedsScaffold func(configpkg.Config) (bool, error)
	ScaffoldManagedStack      func(configpkg.Config, bool) (configpkg.ScaffoldResult, error)
}

type ConfigSourceState

type ConfigSourceState string
const (
	ConfigSourceLoaded      ConfigSourceState = "loaded"
	ConfigSourceMissing     ConfigSourceState = "missing"
	ConfigSourceUnavailable ConfigSourceState = "unavailable"
)

type Connection

type Connection struct {
	Name  string
	Value string
}

type DBShellLauncher

type DBShellLauncher func(DBShellRequest) (tea.ExecCommand, error)

type DBShellRequest

type DBShellRequest struct {
	Service string
}

type DoctorCheck

type DoctorCheck struct {
	Status  string
	Message string
}

type DoctorSummary

type DoctorSummary struct {
	OK   int
	Warn int
	Miss int
	Fail int
}

type HealthLine

type HealthLine struct {
	Status  string
	Message string
}

type Loader

type Loader func() (Snapshot, error)

type LogWatchLauncher

type LogWatchLauncher func(LogWatchRequest) (tea.ExecCommand, error)

type LogWatchRequest

type LogWatchRequest struct {
	Service string
}

type Model

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

func NewActionModel

func NewActionModel(loader Loader, runner ActionRunner) Model

func NewFullModel

func NewFullModel(loader Loader, logWatchLauncher LogWatchLauncher, runner ActionRunner, configManager *ConfigManager) Model

func NewInspectionModel

func NewInspectionModel(loader Loader, logWatchLauncher LogWatchLauncher, runner ActionRunner) Model

func NewModel

func NewModel(loader Loader) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) QuitBlockedReason

func (m Model) QuitBlockedReason() string

func (Model) Update

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

func (Model) View

func (m Model) View() tea.View

func (Model) WithAltScreen

func (m Model) WithAltScreen(enabled bool) Model

func (Model) WithHelpExpanded

func (m Model) WithHelpExpanded(expanded bool) Model

func (Model) WithMouse

func (m Model) WithMouse(enabled bool) Model

func (Model) WithProductivity

func (m Model) WithProductivity(copyWriter ClipboardWriter, shellLauncher ServiceShellLauncher, dbShellLauncher DBShellLauncher) Model

func (Model) WithVersion

func (m Model) WithVersion(version string) Model

type QuitBlockedMsg

type QuitBlockedMsg struct {
	Reason string
}

type Service

type Service struct {
	Name              string
	DisplayName       string
	Status            string
	ContainerName     string
	Image             string
	DataVolume        string
	Host              string
	ExternalPort      int
	InternalPort      int
	PortListening     bool
	PortConflict      bool
	Database          string
	MaintenanceDB     string
	Email             string
	MasterKey         string
	Token             string
	AccessKey         string
	SecretKey         string
	Username          string
	Password          string
	AppendOnly        *bool
	SavePolicy        string
	MaxMemoryPolicy   string
	VolumeSizeLimitMB int
	ServerMode        string
	Endpoint          string
	URL               string
	DSN               string
}

type ServiceShellLauncher

type ServiceShellLauncher func(ServiceShellRequest) (tea.ExecCommand, error)

type ServiceShellRequest

type ServiceShellRequest struct {
	Service string
}

type Snapshot

type Snapshot struct {
	ConfigPath            string
	ConfigData            configpkg.Config
	ConfigSource          ConfigSourceState
	ConfigProblem         string
	ConfigIssues          []configpkg.ValidationIssue
	ConfigNeedsScaffold   bool
	ConfigScaffoldProblem string
	StackName             string
	StackDir              string
	ComposePath           string
	Managed               bool
	WaitForServices       bool
	StartupTimeoutSec     int
	LoadedAt              time.Time
	ServiceError          string
	HealthError           string
	DoctorError           string
	Services              []Service
	Health                []HealthLine
	DoctorSummary         DoctorSummary
	DoctorChecks          []DoctorCheck
	Connections           []Connection
	ConnectText           string
	EnvExportText         string
	PortsText             string
	Stacks                []StackProfile
}

type StackProfile

type StackProfile struct {
	Name       string
	ConfigPath string
	Current    bool
	Configured bool
	State      string
	Mode       string
	Services   string
}

Jump to

Keyboard shortcuts

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