Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlainFormatStrategy ¶
type PlainFormatStrategy struct{}
PlainFormatStrategy will format report text for file or plain output and will apply no styling to the text.
func (*PlainFormatStrategy) Bold ¶
func (*PlainFormatStrategy) Bold(str string) string
Bold returns the original string with no modification.
func (*PlainFormatStrategy) Color ¶
func (*PlainFormatStrategy) Color(str, colorStr string) string
Color returns the original string with no modification.
type RichANSIFormatStrategy ¶
type RichANSIFormatStrategy struct{}
RichANSIFormatStrategy will format report text for an interactive terminal using ANSI escape codes for color and font style.
func (*RichANSIFormatStrategy) Bold ¶
func (*RichANSIFormatStrategy) Bold(str string) string
Bold wraps the provided string with the ANSI escape codes for bold text.
func (*RichANSIFormatStrategy) Color ¶
func (*RichANSIFormatStrategy) Color(str, colorStr string) string
Color wraps the provided string with the ANSI escape codes for the given color.
type Text ¶
type Text struct {
FormatStrategy TextFormatStrategy
}
Text renders a report result as text, using a given format strategy
type TextFormatStrategy ¶
TextFormatStrategy describes what operations a particular format must implement.