Documentation ¶
Index ¶
- Constants
- func ErrWrite(content ...any)
- func ErrWriteF(format string, params ...any)
- func ErrWriteLine(content ...any)
- func ErrWriteLineF(format string, params ...any)
- func ReadLine() (string, error)
- func ResetColour()
- func Write(content ...any)
- func WriteF(format string, params ...any)
- func WriteLine(content ...any)
- func WriteLineF(format string, params ...any)
- type Colour
- type ColourText
- type PrintConfig
- func (p PrintConfig) ConsoleString() (cfg string, needReset bool)
- func (p PrintConfig) ErrWrite(format string, params ...interface{})
- func (p PrintConfig) ErrWriteLine(format string, params ...interface{})
- func (p PrintConfig) WithBackground(c Colour) PrintConfig
- func (p PrintConfig) WithBold(b bool) PrintConfig
- func (p PrintConfig) WithForeground(c Colour) PrintConfig
- func (p PrintConfig) WithUnderline(u bool) PrintConfig
- func (p PrintConfig) Write(format string, params ...interface{})
- func (p PrintConfig) WriteLine(format string, params ...interface{})
Constants ¶
View Source
const ( Bold = "\033[1m" Underline = "\033[4m" )
View Source
const ResetColourSymbol = "\033[0m"
Variables ¶
This section is empty.
Functions ¶
func ErrWriteLine ¶
func ErrWriteLine(content ...any)
func ErrWriteLineF ¶ added in v0.0.14
func ResetColour ¶
func ResetColour()
func WriteLineF ¶ added in v0.0.14
Types ¶
type Colour ¶
type Colour int
func (Colour) AsBackground ¶
func (c Colour) AsBackground() PrintConfig
func (Colour) AsForeground ¶
func (c Colour) AsForeground() PrintConfig
func (Colour) Background ¶
func (Colour) Foreground ¶
type ColourText ¶
type ColourText struct { PrintConfig Text string }
func ColourfulText ¶
func ColourfulText(text string, foreground Colour, background Colour) ColourText
func NewColourText ¶
func NewColourText(text string) ColourText
func (ColourText) String ¶
func (ct ColourText) String() string
type PrintConfig ¶
func (PrintConfig) ConsoleString ¶
func (p PrintConfig) ConsoleString() (cfg string, needReset bool)
func (PrintConfig) ErrWrite ¶
func (p PrintConfig) ErrWrite(format string, params ...interface{})
func (PrintConfig) ErrWriteLine ¶
func (p PrintConfig) ErrWriteLine(format string, params ...interface{})
func (PrintConfig) WithBackground ¶
func (p PrintConfig) WithBackground(c Colour) PrintConfig
func (PrintConfig) WithBold ¶
func (p PrintConfig) WithBold(b bool) PrintConfig
func (PrintConfig) WithForeground ¶
func (p PrintConfig) WithForeground(c Colour) PrintConfig
func (PrintConfig) WithUnderline ¶
func (p PrintConfig) WithUnderline(u bool) PrintConfig
func (PrintConfig) Write ¶
func (p PrintConfig) Write(format string, params ...interface{})
func (PrintConfig) WriteLine ¶
func (p PrintConfig) WriteLine(format string, params ...interface{})
Click to show internal directories.
Click to hide internal directories.