status

package
v0.3.34 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStatusTTL = 5 * time.Second

DefaultStatusTTL is the default time-to-live for status messages.

Variables

This section is empty.

Functions

func ClearInfoMsgCmd

func ClearInfoMsgCmd(ttl time.Duration) tea.Cmd

ClearInfoMsgCmd returns a command that clears the info message after the given TTL.

func Cmd added in v0.3.31

func Cmd(msg InfoMsg) tea.Cmd

Cmd returns a command that displays a message.

func Error

func Error(err error) tea.Cmd

Error returns a command that displays an error message.

func Info

func Info(msg string) tea.Cmd

Info returns a command that displays an info message.

func Msg

func Msg(cmd tea.Cmd) tea.Msg

Msg is a helper function that returns a tea.Msg from a tea.Cmd.

func Success

func Success(msg string) tea.Cmd

Success returns a command that displays a success message.

func Warn

func Warn(msg string) tea.Cmd

Warn returns a command that displays a warning message.

Types

type ClearStatusMsg

type ClearStatusMsg struct{}

ClearStatusMsg is a message to clear the status bar.

type InfoMsg

type InfoMsg struct {
	// Type is the type of the message.
	Type InfoMsgType
	// Msg is the message text.
	Msg string
	// TTL is the time-to-live for the message.
	TTL time.Duration
}

InfoMsg is a message to be displayed in the status bar.

func (InfoMsg) IsEmpty

func (m InfoMsg) IsEmpty() bool

IsEmpty checks if the InfoMsg is empty.

type InfoMsgType

type InfoMsgType int

InfoMsgType is the type of an info message.

const (
	InfoMsgTypeInfo InfoMsgType = iota
	InfoMsgTypeSuccess
	InfoMsgTypeWarn
	InfoMsgTypeError
	InfoMsgTypeUpdate
	InfoMsgTypePlan
	InfoMsgTypeYolo
)

Jump to

Keyboard shortcuts

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