mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-10 11:24:02 +02:00
feat: notifications retry mechanism and improved error formatting
This commit is contained in:
@@ -20,6 +20,26 @@ const (
|
||||
HighlightWhite = BrightWhite + Bold
|
||||
)
|
||||
|
||||
func Error(s string) string {
|
||||
return WithANSI(s, HighlightRed)
|
||||
}
|
||||
|
||||
func Success(s string) string {
|
||||
return WithANSI(s, HighlightGreen)
|
||||
}
|
||||
|
||||
func Warning(s string) string {
|
||||
return WithANSI(s, HighlightYellow)
|
||||
}
|
||||
|
||||
func Info(s string) string {
|
||||
return WithANSI(s, HighlightCyan)
|
||||
}
|
||||
|
||||
func WithANSI(s string, ansi string) string {
|
||||
return ansi + s + Reset
|
||||
}
|
||||
|
||||
func StripANSI(s string) string {
|
||||
return ansiRegexp.ReplaceAllString(s, "")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user