ui

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlePbStop

func HandlePbStop(pb *pterm.ProgressbarPrinter)

func HandleSpinnerStop

func HandleSpinnerStop(spinner *pterm.SpinnerPrinter)

func PromptText

func PromptText(message, defaultValue string) (string, error)

PromptText demande à l'utilisateur de saisir du texte

func ShowError

func ShowError(message string, args ...interface{})

ShowError affiche un message d'erreur

func ShowInfo

func ShowInfo(message string, args ...interface{})

ShowInfo affiche un message d'information

func ShowSuccess

func ShowSuccess(message string, args ...interface{})

ShowSuccess affiche un message de succès

Types

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

MenuBuilder aide à construire les menus interactifs

func NewMenuBuilder

func NewMenuBuilder() *MenuBuilder

NewMenuBuilder crée un nouveau builder de menu

func (m *MenuBuilder) AddOption(label string, handler func() error) *MenuBuilder

AddOption ajoute une option au menu

func (m *MenuBuilder) AddStandardOptions(skipHandler, exitHandler func() error) *MenuBuilder

AddStandardOptions ajoute les options standard (Skip, Exit) au menu

func (m *MenuBuilder) Build() error

Build crée et affiche le menu interactif

type MenuOption struct {
	Label    string
	Handler  func() error
	Position int
}

MenuOption représente une option dans un menu interactif

Jump to

Keyboard shortcuts

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