klock

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StyleRestartsWarning = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(3))

	StyleFractionOK      = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(2))
	StyleFractionWarning = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(3))

	StyleStatusDefault = lipgloss.NewStyle()
	StyleStatusOK      = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(2))
	StyleStatusError   = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(1))
	StyleStatusWarning = lipgloss.NewStyle().Foreground(lipgloss.ANSIColor(3))
)

Functions

func Execute

func Execute(o Options, args []string) error

func FractionStyle

func FractionStyle(str string) (lipgloss.Style, bool)

func StatusColumn added in v0.6.0

func StatusColumn(status string) any

func StatusStyle

func StatusStyle(status string) lipgloss.Style

Types

type Fraction

type Fraction struct {
	Count int
	Total int
}

func ParseFraction

func ParseFraction(s string) (Fraction, bool)

func (Fraction) String

func (f Fraction) String() string

type Options

type Options struct {
	ConfigFlags *genericclioptions.ConfigFlags

	LabelSelector   string
	FieldSelector   string
	AllNamespaces   bool
	WatchKubeconfig bool
	LabelColumns    []string

	Output string
}

func (Options) Validate

func (o Options) Validate() error

type Printer

type Printer struct {
	Table      *table.Model
	WideOutput bool

	LabelCols []string
	// contains filtered or unexported fields
}

func (*Printer) Clear

func (p *Printer) Clear()

func (*Printer) Configure

func (p *Printer) Configure(info schema.GroupVersionKind, printNamespace bool)

func (*Printer) PrintObj

func (p *Printer) PrintObj(obj runtime.Object, eventType watch.EventType) (tea.Cmd, error)

type Watcher

type Watcher struct {
	Options
	Program *tea.Program
	Printer Printer
	Args    []string
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(options Options, program *tea.Program, printer Printer, args []string) *Watcher

func (*Watcher) ErrorChan

func (w *Watcher) ErrorChan() <-chan error

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context) error

func (*Watcher) WatchLoop

func (w *Watcher) WatchLoop(ctx context.Context, restartChan <-chan struct{}) error

Jump to

Keyboard shortcuts

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