Documentation
¶
Overview ¶
Package ui provides console interaction utilities with styled output. It wraps terminal operations with colored frames and user prompts.
Index ¶
- type Console
- func (c *Console) Choose(q string, opts []string, def string) (string, error)
- func (c *Console) ClearLine(n int)
- func (c *Console) Confirm(q, def string) bool
- func (c *Console) ConfirmErr(q, def string) error
- func (c *Console) Error(s string) *frame.Frame
- func (c *Console) ErrorMesg(a ...any) string
- func (c *Console) Flush() *frame.Frame
- func (c *Console) Frame() *frame.Frame
- func (c *Console) Info(s string) *frame.Frame
- func (c *Console) InfoMesg(a ...any) string
- func (c *Console) Input(p string) string
- func (c *Console) InputPassword(s string) (string, error)
- func (c *Console) Palette() *ansi.Palette
- func (c *Console) Prompt(p string) string
- func (c *Console) PromptWithSuggestions(p string, items []string) string
- func (c *Console) ReplaceLine(s string)
- func (c *Console) ReplaceLines(n int, s string)
- func (c *Console) Reset() *frame.Frame
- func (c *Console) SetReader(r io.Reader)
- func (c *Console) SetWriter(w io.Writer)
- func (c *Console) Success(s string) *frame.Frame
- func (c *Console) SuccessMesg(a ...any) string
- func (c *Console) Term() *terminal.Term
- func (c *Console) Warning(s string) *frame.Frame
- func (c *Console) WarningMesg(a ...any) string
- func (c *Console) Writer() io.Writer
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
func NewConsole ¶
NewConsole creates a new Console with the given options.
func NewDefaultConsole ¶ added in v0.1.30
func (*Console) ConfirmErr ¶
ConfirmErr prompts the user with a question and options.
func (*Console) PromptWithSuggestions ¶
func (*Console) ReplaceLine ¶
func (*Console) ReplaceLines ¶
func (*Console) SuccessMesg ¶
SuccessMesg returns a prettified success message.
func (*Console) WarningMesg ¶
WarningMesg returns a prettified warning message.
type Option ¶ added in v0.1.30
type Option func(*Console)
Option is a function type for configuring Console.
func WithDefaultTerminal ¶ added in v0.1.30
func WithWriter ¶ added in v0.1.30
Directories
¶
| Path | Synopsis |
|---|---|
|
Package frame provides a customizable text framing and styling utility for console output, including borders and icons.
|
Package frame provides a customizable text framing and styling utility for console output, including borders and icons. |
|
Package menu provides a flexible wrapper for the fzf interactive filter, enabling customizable selection menus.
|
Package menu provides a flexible wrapper for the fzf interactive filter, enabling customizable selection menus. |
|
Package printer provides functions to format and print bookmark data, including records, tags, and repository information.
|
Package printer provides functions to format and print bookmark data, including records, tags, and repository information. |
|
Package txt provides text formatting helpers.
|
Package txt provides text formatting helpers. |
Click to show internal directories.
Click to hide internal directories.