Documentation
¶
Index ¶
- func Fail(text string)
- func Failf(format string, a ...interface{})
- func Good(text string)
- func Goodf(format string, a ...interface{})
- func Info(text string)
- func Infof(format string, a ...interface{})
- func Sfail(text string) string
- func Sfailf(format string, a ...interface{}) string
- func Sgood(text string) string
- func Sgoodf(format string, a ...interface{}) string
- func Sinfo(text string) string
- func Sinfof(format string, a ...interface{}) string
- func Stext(text string) string
- func Stextf(format string, a ...interface{}) string
- func Stitle(text string) string
- func Stitlef(format string, a ...interface{}) string
- func Swarn(text string) string
- func Swarnf(format string, a ...interface{}) string
- func Text(text string)
- func Textf(format string, a ...interface{})
- func Title(text string)
- func Titlef(format string, a ...interface{})
- func Warn(text string)
- func Warnf(format string, a ...interface{})
- type Printer
- func (p *Printer) Fail(text string)
- func (p *Printer) Failf(format string, a ...interface{})
- func (p *Printer) Good(text string)
- func (p *Printer) Goodf(format string, a ...interface{})
- func (p *Printer) Info(text string)
- func (p *Printer) Infof(format string, a ...interface{})
- func (p *Printer) Sfail(text string) string
- func (p *Printer) Sfailf(format string, a ...interface{}) string
- func (p *Printer) Sgood(text string) string
- func (p *Printer) Sgoodf(format string, a ...interface{}) string
- func (p *Printer) Sinfo(text string) string
- func (p *Printer) Sinfof(format string, a ...interface{}) string
- func (p *Printer) Stext(text string) string
- func (p *Printer) Stextf(format string, a ...interface{}) string
- func (p *Printer) Stitle(text string) string
- func (p *Printer) Stitlef(format string, a ...interface{}) string
- func (p *Printer) Swarn(text string) string
- func (p *Printer) Swarnf(format string, a ...interface{}) string
- func (p *Printer) Text(text string)
- func (p *Printer) Textf(format string, a ...interface{})
- func (p *Printer) Title(text string)
- func (p *Printer) Titlef(format string, a ...interface{})
- func (p *Printer) Warn(text string)
- func (p *Printer) Warnf(format string, a ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fail ¶
func Fail(text string)
Fail prints an error message using the default symbols and colors.
func Failf ¶
func Failf(format string, a ...interface{})
Failf prints a formatted error message using the default symbols and colors.
func Good ¶
func Good(text string)
Good prints a success message using the default symbols and colors.
func Goodf ¶
func Goodf(format string, a ...interface{})
Goodf prints a formatted success message using the default symbols and colors.
func Info ¶
func Info(text string)
Info prints an information message using the default symbols and colors.
func Infof ¶
func Infof(format string, a ...interface{})
Infof prints a formatted information message using the default symbols and colors.
func Textf ¶
func Textf(format string, a ...interface{})
Textf prints a formatted normal, uncoloured message.
func Title ¶
func Title(text string)
Title prints a Title message using the default symbols and colors
A Title is distinguishable from all other constructs in msg as it will has 1 newline before and 2 newlines after it.
func Titlef ¶
func Titlef(format string, a ...interface{})
Titlef prints a formatted Title message using the default symbols and colors.
Types ¶
type Printer ¶
type Printer struct {
Out io.Writer // Stdout
SymbolInfo string // Symbol for the Info output
SymbolTitle string // Symbol for the Title output
SymbolWarn string // Symbol for the Warn output
SymbolFail string // Symbol for the Fail output
SymbolGood string // Symbol for the Good output
ColorInfo color.Attribute // Color for the Info output
ColorTitle color.Attribute // Color for the Title output
ColorWarn color.Attribute // Color for the Warn output
ColorFail color.Attribute // Color for the Fail output
ColorGood color.Attribute // Color for the Good output
}
Printer is the primary construct in msg, it allows you to configure the colors and symbols used for each of the printing methods attached to it.
func Default ¶ added in v0.2.0
func Default() *Printer
Default constructs and returns a default Printer with sensible colors and symbols configured to print to os.Stdout.
func (*Printer) Stitle ¶
Stitle is like Title but it returns a string rather than printing it
The returned string will have all it's leading and trailing whitespace/newlines trimmed so you have access to the raw string.
func (*Printer) Stitlef ¶
Stitlef returns a formatted title string, stripped of all leading/trailing whitespace.
func (*Printer) Text ¶
Text prints a normal, uncoloured message you could argue we don't need this as all is does is call fmt.Fprintln but we're here now.
func (*Printer) Textf ¶
Textf prints a formatted normal message a newline is automatically appended to the end of 'format' so you don't have to.
func (*Printer) Title ¶
Title prints a Title message
A Title is distinguishable from all other constructs in msg as it will has 1 newline before and 2 newlines after it to create separation
If the Printer has a SymbolTitle, it will be prefixed onto 'text' with 2 spaces separating them.


