io

package
v3.0.0-beta.20240620 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDataAvailable

func HasDataAvailable(reader io.Reader) bool

HasDataAvailable will return whether the given Reader has data available to read

func PromptForOne

func PromptForOne(options []string) (string, error)

PromptForOne will show the list of options to the user, allowing them to select one to return. It's possible for them to choose none or cancel the selection, resulting in an error.

Types

type Pending

type Pending struct {
	Err error
	// contains filtered or unexported fields
}

Pending is used to show a loading spinner while a long running function runs to perform some action and output information

func NewPendingCommand

func NewPendingCommand(fn tea.Cmd, loadingText string) Pending

NewPendingCommand is used to show a loading spinner while a long running function runs to perform some action and output information. fn is a function run to perform the action. It should return a PendingOutput if to update the output after the action is complete. It can also return an error instance. loadingText is the text shown while the function is running

func (Pending) Init

func (p Pending) Init() tea.Cmd

Init implements tea.Model.

func (Pending) Update

func (p Pending) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (Pending) View

func (p Pending) View() string

View implements tea.Model.

type PendingOutput

type PendingOutput string

Jump to

Keyboard shortcuts

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