console

package
v0.0.0-...-b2d0fcc Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearPreviousLine

func ClearPreviousLine()

func Error

func Error(a ...interface{})

Error prints an error message with a newline.

func Info

func Info(a ...interface{})

Info prints an information message.

func Input

func Input(a ...interface{})

Input prints an input prompt.

func Print

func Print(a ...interface{})

Print prints a message to the console.

func ReadLine

func ReadLine() (string, error)

ReadLine reads a line from standard input.

func ReadPassword

func ReadPassword() (string, error)

ReadPassword reads a password from standard input without echoing.

func Reset

func Reset()

Reset ensures the cursor is visible and terminal is in a normal state.

func Success

func Success(a ...interface{})

Success prints a success message.

func Warning

func Warning(a ...interface{})

Warning prints a warning message.

Types

type SpinnerManager

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

SpinnerManager handles multiple named spinners with concurrent access support.

func NewSpinnerManager

func NewSpinnerManager() *SpinnerManager

NewSpinnerManager creates a SpinnerManager with the provided writer.

func (*SpinnerManager) AddSpinner

func (m *SpinnerManager) AddSpinner(name, msg string) *ysmrr.Spinner

AddSpinner creates a new spinner with the given name and message.

func (*SpinnerManager) Complete

func (m *SpinnerManager) Complete(name string)

Complete marks the specified spinner as completed.

func (*SpinnerManager) Error

func (m *SpinnerManager) Error(name string)

Error marks the specified spinner as errored.

func (*SpinnerManager) ErrorWithMessagef

func (m *SpinnerManager) ErrorWithMessagef(name, format string, args ...interface{})

ErrorWithMessagef marks the specified spinner as errored with a formatted message.

func (*SpinnerManager) Start

func (m *SpinnerManager) Start()

Start begins the spinner animation for all spinners.

func (*SpinnerManager) Stop

func (m *SpinnerManager) Stop()

func (*SpinnerManager) UpdateMessage

func (m *SpinnerManager) UpdateMessage(name, msg string)

UpdateMessage updates the message of the specified spinner.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳