Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Bar print progress bar Bar = func(data ...interface{}) { print(themesDB[currThemeName].Bar, data...) } // Print prints a message Print = func(data ...interface{}) { print(themesDB[currThemeName].Print, data...) return } // PrintC prints a message with color PrintC = func(data ...interface{}) { print(themesDB[currThemeName].PrintC, data...) return } // Printf prints a formatted message Printf = func(f string, data ...interface{}) { printf(themesDB[currThemeName].Print, f, data...) return } // Println prints a message with a newline Println = func(data ...interface{}) { println(themesDB[currThemeName].Print, data...) } // Fatal print a error message and exit Fatal = func(data ...interface{}) { defer os.Exit(1) print(themesDB[currThemeName].Fatal, data...) return } // Fatalf print a error message with a format specified and exit Fatalf = func(f string, data ...interface{}) { defer os.Exit(1) printf(themesDB[currThemeName].Fatal, f, data...) return } // Fatalln print a error message with a new line and exit Fatalln = func(data ...interface{}) { defer os.Exit(1) println(themesDB[currThemeName].Fatal, data...) return } // Error prints a error message Error = func(data ...interface{}) { print(themesDB[currThemeName].Error, data...) return } // Errorf print a error message with a format specified Errorf = func(f string, data ...interface{}) { printf(themesDB[currThemeName].Error, f, data...) return } // Errorln prints a error message with a new line Errorln = func(data ...interface{}) { println(themesDB[currThemeName].Error, data...) return } // Info prints a informational message Info = func(data ...interface{}) { print(themesDB[currThemeName].Info, data...) return } // Infof prints a informational message in custom format Infof = func(f string, data ...interface{}) { printf(themesDB[currThemeName].Info, f, data...) return } // Infoln prints a informational message with a new line Infoln = func(data ...interface{}) { println(themesDB[currThemeName].Info, data...) return } // Debug prints a debug message without a new line // Debug prints a debug message Debug = func(data ...interface{}) { if !NoDebugPrint { print(themesDB[currThemeName].Debug, data...) } } // Debugf prints a debug message with a new line Debugf = func(f string, data ...interface{}) { if !NoDebugPrint { printf(themesDB[currThemeName].Debug, f, data...) } } // Debugln prints a debug message with a new line Debugln = func(data ...interface{}) { if !NoDebugPrint { println(themesDB[currThemeName].Debug, data...) } } // Time helper to print Time theme Time = themesDB[currThemeName].Time.SprintfFunc() // Size helper to print Size theme Size = themesDB[currThemeName].Size.SprintfFunc() // File helper to print File theme File = themesDB[currThemeName].File.SprintfFunc() // Dir helper to print Dir theme Dir = themesDB[currThemeName].Dir.SprintfFunc() // Command helper to print command theme Command = themesDB[currThemeName].Command.SprintfFunc() // SessionID helper to print sessionid theme SessionID = themesDB[currThemeName].SessionID.SprintfFunc() // JSON helper to print json strings JSON = themesDB[currThemeName].JSON.SprintfFunc() )
View Source
var MiniTheme = Theme{ Debug: (color.New(color.FgWhite, color.Faint, color.Italic)), Fatal: (color.New(color.FgRed, color.Italic, color.Bold)), Error: (color.New(color.FgYellow, color.Italic)), Info: (color.New(color.FgGreen, color.Bold)), File: (color.New(color.FgWhite)), Dir: (color.New(color.FgCyan, color.Bold)), Command: (color.New(color.FgWhite, color.Bold)), SessionID: (color.New(color.FgYellow, color.Bold)), Size: (color.New(color.FgYellow)), Time: (color.New(color.FgGreen)), JSON: (color.New(color.FgWhite, color.Italic)), Bar: (color.New(color.FgGreen, color.Bold)), PrintC: (color.New(color.FgGreen, color.Bold)), Print: (color.New()), }
MiniTheme - Minio's default color theme
View Source
var NoColorTheme = Theme{ Debug: (color.New()), Fatal: (color.New()), Error: (color.New()), Info: (color.New()), File: (color.New()), Dir: (color.New()), Command: (color.New()), SessionID: (color.New()), Size: (color.New()), Time: (color.New()), JSON: (color.New()), Bar: (color.New()), PrintC: (color.New()), Print: (color.New()), }
NoColorTheme - Disables color theme
View Source
var NoDebugPrint = true
NoDebugPrint defines if the input should be printed in debug or not. By default it's set to true.
View Source
var WhiteTheme = Theme{ Debug: (color.New(color.FgWhite, color.Faint, color.Italic)), Fatal: (color.New(color.FgWhite, color.Bold, color.Italic)), Error: (color.New(color.FgWhite, color.Bold, color.Italic)), Info: (color.New(color.FgWhite, color.Bold)), File: (color.New(color.FgWhite, color.Bold)), Dir: (color.New(color.FgWhite, color.Bold)), Command: (color.New(color.FgWhite, color.Bold)), SessionID: (color.New(color.FgWhite, color.Bold)), Size: (color.New(color.FgWhite, color.Bold)), Time: (color.New(color.FgWhite, color.Bold)), JSON: (color.New(color.FgWhite, color.Bold, color.Italic)), Bar: (color.New(color.FgWhite, color.Bold)), PrintC: (color.New(color.FgWhite, color.Bold)), Print: (color.New()), }
WhiteTheme - All white color theme
Functions ¶
func GetDefaultThemeName ¶
func GetDefaultThemeName() string
GetDefaultThemeName returns the default theme
func GetThemeNames ¶
func GetThemeNames() (themeNames []string)
GetThemeNames returns currently supported list of themes
func IsValidTheme ¶
IsValidTheme returns true if "themeName" is currently supported
func ProgramName ¶
func ProgramName() string
ProgramName - return the name of the executable program
Types ¶
type Theme ¶
type Theme struct { Fatal *color.Color Error *color.Color Info *color.Color Debug *color.Color Size *color.Color Time *color.Color File *color.Color Dir *color.Color Command *color.Color SessionID *color.Color JSON *color.Color Bar *color.Color PrintC *color.Color Print *color.Color }
Theme holds console color scheme
Click to show internal directories.
Click to hide internal directories.