tui

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FancySelect

func FancySelect(title string, items []list.Item) (string, error)

FancySelect displays a list of items and allows the user to select one.

func List

func List(title string, items []list.Item) error

func ListFleets

func ListFleets() error

ListFleets lists the fleets related to the currently authenticated's namespace without prompting the user to choose one for further actions.

func ListGateways

func ListGateways(fleet api.Fleet) error

func ListMachineEvents

func ListMachineEvents(fleetID, machineID string) error

func ListMachines

func ListMachines(fleets []ravelAPI.Fleet, fleetID string) error

func SelectFleet

func SelectFleet() (fleetID string, err error)

SelectFleet prompts the user to select an existing fleet from the list.

func SelectFleetWithFleets

func SelectFleetWithFleets(fleets []ravelAPI.Fleet) (fleetID string, err error)

SelectFleetWithFleets prompts the user to select an existing fleet from the list.

func SelectGateway

func SelectGateway(fleet api.Fleet) (gateway *api.Gateway, err error)

func SelectMachine

func SelectMachine(fleetID string) (string, error)

func SelectOrCreateFleet

func SelectOrCreateFleet() (fleetID string, err error)

SelectOrCreateFleet lets the user select or create a fleet.

func ShowTable

func ShowTable(
	columns []table.Column,
	envs map[string]string,
	height int,
)

func StreamMachineLogs

func StreamMachineLogs(ctx context.Context, client *valyent.Client, opts valyent.LogStreamOptions)

StreamMachineLogs streams logs using the StreamModel and the LogStream API.

Types

type FancySelectItem

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

func (FancySelectItem) Description

func (i FancySelectItem) Description() string

func (FancySelectItem) FilterValue

func (i FancySelectItem) FilterValue() string

func (FancySelectItem) Title

func (i FancySelectItem) Title() string

func (FancySelectItem) Value

func (i FancySelectItem) Value() string

type ListItem

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

func (ListItem) Description

func (i ListItem) Description() string

func (ListItem) FilterValue

func (i ListItem) FilterValue() string

func (ListItem) Title

func (i ListItem) Title() string

type StreamModel

type StreamModel struct {
	Title string
	// contains filtered or unexported fields
}

func NewStreamModel

func NewStreamModel(Title string) StreamModel

func (StreamModel) Init

func (m StreamModel) Init() tea.Cmd

func (StreamModel) Run

func (m StreamModel) Run(streamFn func(p *tea.Program))

func (StreamModel) Update

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

func (StreamModel) View

func (m StreamModel) View() string

type StreamModelResultMsg

type StreamModelResultMsg struct {
	Title    string
	Subtitle string
}

func (StreamModelResultMsg) String

func (r StreamModelResultMsg) String() string

type TableModel

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

func (TableModel) Init

func (m TableModel) Init() tea.Cmd

func (TableModel) Update

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

func (TableModel) View

func (m TableModel) View() string

Jump to

Keyboard shortcuts

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