ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlePbStop

func HandlePbStop(ctx context.Context, pb *pterm.ProgressbarPrinter)

func HandleSpinnerStop

func HandleSpinnerStop(ctx context.Context, spinner *pterm.SpinnerPrinter)

func PromptText

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

PromptText demande à l'utilisateur de saisir du texte

func ShowError

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

ShowError affiche un message d'erreur

func ShowInfo

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

ShowInfo affiche un message d'information

func ShowSuccess

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

ShowSuccess affiche un message de succès

func ShowWarning added in v0.2.0

func ShowWarning(ctx context.Context, message string, args ...interface{})

ShowWarning affiche un message d'avertissement

func ShowWelcomeHeader added in v0.2.0

func ShowWelcomeHeader()

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