tui

package
v0.0.0-...-3cbc118 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(data ReportData) error

Run starts the TUI with the provided report data

Types

type DriftDetail

type DriftDetail struct {
	Field    string
	Expected string
	Actual   string
	Severity string
}

DriftDetail represents a single drift

type DriftItem

type DriftItem struct {
	ResourceType string
	Project      string
	Name         string
	Location     string
	State        string
	Labels       map[string]string
	Drifts       []DriftDetail
}

DriftItem represents a generic drift item for TUI display

type KeyMap

type KeyMap struct {
	NextTab      key.Binding
	PrevTab      key.Binding
	Up           key.Binding
	Down         key.Binding
	PageUp       key.Binding
	PageDown     key.Binding
	HalfPageUp   key.Binding
	HalfPageDown key.Binding
	Quit         key.Binding
}

KeyMap defines the keyboard shortcuts

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default keyboard shortcuts

type Model

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

Model represents the TUI state

func NewModel

func NewModel(tabs []Tab) Model

NewModel creates a new TUI model with the given tabs

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the TUI

func (Model) Update

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

Update handles incoming messages

func (Model) View

func (m Model) View() string

View renders the TUI

type ReportData

type ReportData struct {
	Title            string
	Timestamp        time.Time
	TotalResources   int
	DriftedResources int
	Items            []DriftItem
}

ReportData holds the complete report data for TUI

func FromGCEReport

func FromGCEReport(report *gce.DriftReport) ReportData

FromGCEReport converts a GCE drift report to TUI format

func FromGKEReport

func FromGKEReport(report *gke.DriftReport) ReportData

FromGKEReport converts a GKE drift report to TUI format

func FromSQLReport

func FromSQLReport(report *sql.DriftReport) ReportData

FromSQLReport converts a SQL drift report to TUI format

type Tab

type Tab struct {
	Title   string
	Content string
}

Tab represents a single tab in the TUI

Jump to

Keyboard shortcuts

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