Documentation ¶
Index ¶
- Variables
- func BasicTable(data [][]Pair) string
- func Display(v any) string
- func DisplayArray(vs []any) []string
- func DisplayFloat(f float64) string
- func DisplayFloatWithGran(f float64, gran float64) string
- func DisplayInt(n int64) string
- func DisplayUint(n uint64) string
- func ErrMsg(err any) tea.Cmd
- func ExitWithError(err any)
- func FixedBlock(pre string, post string, n int) string
- func MapToStableList[K cmp.Ordered, V any, E any](m map[K]V, cvt func(K, V) E) []E
- func Navigate(model tea.Model) tea.Cmd
- func Pad(n int) string
- func PromptSelect(title string, list []string) string
- func PromptSelectService(cl client.Client) string
- func PromptSelectValueDesc[V cmp.Ordered](title string, vd map[V]string) V
- func PromptString(msg string, initial string, placeholder string, validate func(s string) error) string
- func RenderErrorLine(err any) string
- func RenderOkLine(res any) string
- func Run(m Bimodel)
- func SetSpinnerState(b bool) tea.Cmd
- func SpinnyAsync(msg string, done <-chan struct{})
- func SpinnyWait[T any](msg string, f func() (T, error)) (res T)
- func StatusMsg(msg string) tea.Cmd
- type Bimodel
- type ChanStore
- type DerivedStore
- type Displayer
- type ImmutableStore
- type Item
- type KeyMatchMsg
- type List
- func (m List[T]) Init() tea.Cmd
- func (m List[T]) Run() error
- func (m List[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m List[T]) View() string
- func (m List[T]) WithPull(f func() ([]T, error)) List[T]
- func (m List[T]) WithStore(s Store[[]T]) List[T]
- func (m List[T]) WithThen(then func(T) tea.Model) List[T]
- func (m List[T]) WithTitle(title string) List[T]
- type NavigateMsg
- type Observer
- type Page
- func (m Page) FullHelp() [][]key.Binding
- func (m Page) Height() int
- func (m Page) Init() tea.Cmd
- func (m Page) Run() error
- func (m *Page) SetHeight(v int)
- func (m *Page) SetShowHelp(v bool)
- func (m *Page) SetShowTitle(v bool)
- func (m *Page) SetSize(width, height int)
- func (m *Page) SetSpinner(spinner spinner.Spinner)
- func (m *Page) SetWidth(v int)
- func (m Page) ShortHelp() []key.Binding
- func (m Page) ShowHelp() bool
- func (m Page) ShowTitle() bool
- func (m *Page) StartSpinner() tea.Cmd
- func (m *Page) StopSpinner()
- func (m Page) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Page) View() string
- func (m Page) Width() int
- type PageModel
- type PageProps
- type Pair
- type PullStore
- type ServiceControl
- type ServiceDetailModel
- type ServiceItem
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FaintColor = lipgloss.AdaptiveColor{Light: "#D9DCCF", Dark: "#8b8b8b"} FaintStyle = lipgloss.NewStyle().Foreground(FaintColor) OkColor = lipgloss.AdaptiveColor{Light: "#43BF6D", Dark: "#73F59F"} OkStyle = lipgloss.NewStyle().Foreground(OkColor) ErrColor = lipgloss.AdaptiveColor{Light: "#770000", Dark: "#AA0000"} ErrStyle = lipgloss.NewStyle().Foreground(ErrColor) BrownColor = lipgloss.AdaptiveColor{Light: "#A67C53", Dark: "#A67C53"} BrownStyle = lipgloss.NewStyle().Foreground(BrownColor) DocStyle = lipgloss.NewStyle().Margin(1, 2) TitleStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("230")). Background(lipgloss.Color("32")). Padding(0, 1) TitleBarStyle = lipgloss.NewStyle().Padding(0, 0, 1, 2) HelpStyle = lipgloss.NewStyle().Padding(1, 0, 0, 2) SpinnerStyle = lipgloss.NewStyle(). Foreground(lipgloss.AdaptiveColor{Light: "#8E8E8E", Dark: "#747373"}) )
View Source
var ServiceControls = []ServiceControl{ { Use: "restart [name]", Short: "Restart service", Aliases: []string{"r"}, WaitMsg: "Restarting...", Display: "💫 Restart", Do: func(cli client.Client, name string) (string, error) { n, e := cli.ServiceRestart(name, false) if e != nil { return "", e } else { return fmt.Sprintf("Restarted %d services", n.Count), nil } }, }, { Use: "rebuild [name]", Short: "Invalidates build cache and restarts service", Aliases: []string{"invalidate"}, WaitMsg: "Rebuilding...", Display: "🔨 Rebuild", Do: func(cli client.Client, name string) (string, error) { n, e := cli.ServiceRestart(name, true) if e != nil { return "", e } else { return fmt.Sprintf("Rebuilt %d services", n.Count), nil } }, }, { Use: "stop [name]", Short: "Stops service", Aliases: []string{"kill"}, WaitMsg: "Stopping the service...", Display: "🛑 Stop", Do: func(cli client.Client, name string) (string, error) { n, e := cli.ServiceStop(name) if e != nil { return "", e } else { return fmt.Sprintf("Stopped %d services", n.Count), nil } }, }, }
Functions ¶
func BasicTable ¶
func DisplayArray ¶
func DisplayFloat ¶
func DisplayFloatWithGran ¶
func DisplayInt ¶
func DisplayUint ¶
func ExitWithError ¶
func ExitWithError(err any)
func MapToStableList ¶
func PromptSelect ¶
func PromptSelectService ¶
func PromptSelectValueDesc ¶
func PromptString ¶
func RenderErrorLine ¶
func RenderOkLine ¶
func SetSpinnerState ¶
func SpinnyAsync ¶
func SpinnyAsync(msg string, done <-chan struct{})
func SpinnyWait ¶
Types ¶
type Bimodel ¶
func MakeServiceDetailModel ¶
func MakeServiceDetailModel(cl client.Client, item *ServiceItem) Bimodel
func MakeServiceListModel ¶
type DerivedStore ¶
func (DerivedStore[T, U]) Next ¶
func (t DerivedStore[T, U]) Next() (data U, next Store[U], err error)
type Displayer ¶
type Displayer interface {
Display() string
}
Displayer is an interface for displaying a string.
type ImmutableStore ¶
type ImmutableStore[T any] [1]T
func (ImmutableStore[T]) Next ¶
func (d ImmutableStore[T]) Next() (data T, next Store[T], err error)
type KeyMatchMsg ¶
type KeyMatchMsg struct {
Key string
}
type NavigateMsg ¶
type NavigateMsg struct {
}type Page ¶
type Page struct { Title string // Key mappings for navigating the list. KeyMap []key.Binding Help help.Model StatusMessageLifetime time.Duration // contains filtered or unexported fields }
func (*Page) SetShowHelp ¶
SetShowHelp shows or hides the help view.
func (*Page) SetShowTitle ¶
SetShowTitle shows or hides the title bar.
func (*Page) SetSpinner ¶
SetSpinner allows to set the spinner style.
func (*Page) StartSpinner ¶
StartSpinner starts the spinner. Note that this returns a command.
type ServiceControl ¶
type ServiceDetailModel ¶
type ServiceDetailModel struct {
// contains filtered or unexported fields
}
func (ServiceDetailModel) Init ¶
func (m ServiceDetailModel) Init() tea.Cmd
func (ServiceDetailModel) Run ¶
func (m ServiceDetailModel) Run() error
func (ServiceDetailModel) View ¶
func (m ServiceDetailModel) View(w, h int) string
type ServiceItem ¶
type ServiceItem struct { Name string session.ServiceInfo }
func (ServiceItem) Description ¶
func (i ServiceItem) Description() string
func (ServiceItem) Entries ¶
func (i ServiceItem) Entries() (m []Pair)
func (ServiceItem) FilterValue ¶
func (i ServiceItem) FilterValue() string
func (ServiceItem) Title ¶
func (i ServiceItem) Title() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.