ui

package
v0.0.0-...-2f3587d Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	IconDialogError = "dialog-error"
	IconDialogInfo  = "dialog-information"
	IconDialogWarn  = "dialog-warning"

	UrgencyLow      = "low"
	UrgencyNormal   = "normal"
	UrgencyCritical = "critical"
)

For a list of possible icons, see: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Variables

This section is empty.

Functions

func Debug

func Debug(format string, a ...interface{})
Example
pterm.SetDefaultOutput(os.Stdout)
pterm.DisableStyling()
pterm.PrintDebugMessages = true

msg := "This is a test: %d"
a := 5
Debug(msg, a)
Output:

DEBUG: This is a test: 5

func Error

func Error(format string, a ...interface{})
Example
pterm.SetDefaultOutput(os.Stdout)
pterm.DisableStyling()

msg := "This is a test: %v"
a := os.ErrClosed
Error(msg, a)
Output:

ERROR: This is a test: file already closed

func ErrorAndNotify

func ErrorAndNotify(title string, format string, a ...interface{})

func Fatal

func Fatal(format string, a ...interface{})

func FatalWithoutStacktrace

func FatalWithoutStacktrace(format string, a ...interface{})

func Info

func Info(format string, a ...interface{})
Example
pterm.SetDefaultOutput(os.Stdout)
pterm.DisableStyling()

msg := "This is a test: %d"
a := 5
Info(msg, a)
Output:

INFO: This is a test: 5

func NotifyError

func NotifyError(title, text string)

func NotifyInfo

func NotifyInfo(title, text string)

func NotifySend

func NotifySend(urgency, title, text, icon string)

func NotifyWarn

func NotifyWarn(title, text string)

func Printf

func Printf(format string, a ...interface{})

func Printfln

func Printfln(format string, a ...interface{})

func SetDebugEnabled

func SetDebugEnabled(enabled bool)

func Success

func Success(format string, a ...interface{})

func Warning

func Warning(format string, a ...interface{})
Example
pterm.SetDefaultOutput(os.Stdout)
pterm.DisableStyling()

msg := "This is a test: %d"
a := 5
Warning(msg, a)
Output:

WARNING: This is a test: 5

func WarningAndNotify

func WarningAndNotify(title string, format string, a ...interface{})

Types

This section is empty.

Jump to

Keyboard shortcuts

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