Documentation
¶
Index ¶
- Constants
- Variables
- func Debugf(format string, args ...any)
- func Errorf(format string, args ...any)
- func Infof(format string, args ...any)
- func IsDebug() bool
- func Print(m Message)
- func PrintBye()
- func PrintHighlighted(what string)
- func PrintKeyValue(b io.Writer, k string, v any)
- func PrintWelcome(version string)
- func Prompt() string
- func RuntimePanic(err error) error
- func SetANSIColorsEnabled(enabled bool)
- func ToggleDebug() bool
- func Warnf(format string, args ...any)
- type ConsoleWriter
- type Message
- type Notification
Constants ¶
View Source
const ( NotifyInfo = iota NotifyWarning NotifyError )
Variables ¶
View Source
var Console = ConsoleWriter{ StandardOut: os.Stdout, StandardError: os.Stderr, }
View Source
var Panic = RuntimePanic
View Source
var Println = fmt.Println
Println is to inject a function that can report info,error and warning
Functions ¶
func PrintHighlighted ¶ added in v0.9.2
func PrintHighlighted(what string)
func PrintWelcome ¶ added in v0.9.2
func PrintWelcome(version string)
func RuntimePanic ¶ added in v0.9.2
func SetANSIColorsEnabled ¶ added in v0.55.4
func SetANSIColorsEnabled(enabled bool)
func ToggleDebug ¶ added in v0.55.2
func ToggleDebug() bool
Types ¶
type ConsoleWriter ¶ added in v0.9.2
func (ConsoleWriter) Errorf ¶ added in v0.9.2
func (c ConsoleWriter) Errorf(format string, args ...any)
func (ConsoleWriter) Warnf ¶ added in v0.9.2
func (c ConsoleWriter) Warnf(format string, args ...any)
type Message ¶
func NewWarningf ¶ added in v0.9.2
type Notification ¶
type Notification struct {
// contains filtered or unexported fields
}
func (Notification) Message ¶
func (n Notification) Message() string
func (Notification) Type ¶
func (n Notification) Type() int
Click to show internal directories.
Click to hide internal directories.