Documentation
¶
Index ¶
- func DetectEncoding(formatter OutputFormatterInferface, str string) string
- func Escape(s string) string
- func EscapeTrailingBackslash(s string) string
- func FormatBlock(messages []string, style string, large bool) string
- func FormatSection(section string, message string, style string) string
- func RemoveDecoration(formatter OutputFormatterInferface, str string) string
- func Truncate(message string, length int, suffix string) string
- type OutputFormatter
- func (o *OutputFormatter) Clone() OutputFormatterInferface
- func (o *OutputFormatter) Format(message string) string
- func (o *OutputFormatter) FormatAndWrap(message string, width int) string
- func (o *OutputFormatter) HasStyle(name string) bool
- func (o *OutputFormatter) IsDecorated() bool
- func (o *OutputFormatter) SetDecorated(decorated bool)
- func (o *OutputFormatter) SetStyle(name string, style OutputFormatterStyleInterface)
- func (o *OutputFormatter) Style(name string) (OutputFormatterStyleInterface, error)
- func (o *OutputFormatter) StyleStack() *OutputFormatterStyleStack
- type OutputFormatterInferface
- type OutputFormatterStyle
- func (s *OutputFormatterStyle) Apply(text string) string
- func (s *OutputFormatterStyle) Clone() OutputFormatterStyleInterface
- func (s *OutputFormatterStyle) SetBackground(c string)
- func (s *OutputFormatterStyle) SetForeground(c string)
- func (s *OutputFormatterStyle) SetHref(href string)
- func (s *OutputFormatterStyle) SetOption(option string)
- func (s *OutputFormatterStyle) SetOptions(options []string)
- func (s *OutputFormatterStyle) UnsetOption(option string)
- type OutputFormatterStyleInterface
- type OutputFormatterStyleStack
- func (s *OutputFormatterStyleStack) Clone() *OutputFormatterStyleStack
- func (s *OutputFormatterStyleStack) Current() OutputFormatterStyleInterface
- func (s *OutputFormatterStyleStack) EmptyStyle() OutputFormatterStyleInterface
- func (s *OutputFormatterStyleStack) Pop(style OutputFormatterStyleInterface) OutputFormatterStyleInterface
- func (s *OutputFormatterStyleStack) Push(style OutputFormatterStyleInterface)
- func (s *OutputFormatterStyleStack) Reset()
- func (s *OutputFormatterStyleStack) SetEmptyStyle(style OutputFormatterStyleInterface)
- type WrappableOutputFormatterInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectEncoding ¶
func DetectEncoding(formatter OutputFormatterInferface, str string) string
TODO: implement
func EscapeTrailingBackslash ¶
func RemoveDecoration ¶
func RemoveDecoration(formatter OutputFormatterInferface, str string) string
Types ¶
type OutputFormatter ¶
type OutputFormatter struct {
// contains filtered or unexported fields
}
func NewOutputFormatter ¶
func NewOutputFormatter(decorated bool, styles map[string]OutputFormatterStyleInterface) *OutputFormatter
func (*OutputFormatter) Clone ¶
func (o *OutputFormatter) Clone() OutputFormatterInferface
func (*OutputFormatter) Format ¶
func (o *OutputFormatter) Format(message string) string
func (*OutputFormatter) FormatAndWrap ¶
func (o *OutputFormatter) FormatAndWrap(message string, width int) string
func (*OutputFormatter) HasStyle ¶
func (o *OutputFormatter) HasStyle(name string) bool
func (*OutputFormatter) IsDecorated ¶
func (o *OutputFormatter) IsDecorated() bool
func (*OutputFormatter) SetDecorated ¶
func (o *OutputFormatter) SetDecorated(decorated bool)
func (*OutputFormatter) SetStyle ¶
func (o *OutputFormatter) SetStyle(name string, style OutputFormatterStyleInterface)
func (*OutputFormatter) Style ¶
func (o *OutputFormatter) Style(name string) (OutputFormatterStyleInterface, error)
func (*OutputFormatter) StyleStack ¶
func (o *OutputFormatter) StyleStack() *OutputFormatterStyleStack
type OutputFormatterInferface ¶
type OutputFormatterInferface interface { SetDecorated(decorated bool) IsDecorated() bool SetStyle(name string, style OutputFormatterStyleInterface) HasStyle(name string) bool Style(name string) (OutputFormatterStyleInterface, error) Format(message string) string Clone() OutputFormatterInferface }
type OutputFormatterStyle ¶
type OutputFormatterStyle struct {
// contains filtered or unexported fields
}
func NewOutputFormatterStyle ¶
func NewOutputFormatterStyle(foreground string, background string, options []string) *OutputFormatterStyle
func (*OutputFormatterStyle) Apply ¶
func (s *OutputFormatterStyle) Apply(text string) string
func (*OutputFormatterStyle) Clone ¶
func (s *OutputFormatterStyle) Clone() OutputFormatterStyleInterface
func (*OutputFormatterStyle) SetBackground ¶
func (s *OutputFormatterStyle) SetBackground(c string)
func (*OutputFormatterStyle) SetForeground ¶
func (s *OutputFormatterStyle) SetForeground(c string)
func (*OutputFormatterStyle) SetHref ¶
func (s *OutputFormatterStyle) SetHref(href string)
func (*OutputFormatterStyle) SetOption ¶
func (s *OutputFormatterStyle) SetOption(option string)
func (*OutputFormatterStyle) SetOptions ¶
func (s *OutputFormatterStyle) SetOptions(options []string)
func (*OutputFormatterStyle) UnsetOption ¶
func (s *OutputFormatterStyle) UnsetOption(option string)
type OutputFormatterStyleStack ¶
type OutputFormatterStyleStack struct {
// contains filtered or unexported fields
}
func NewOutputFormatterStyleStack ¶
func NewOutputFormatterStyleStack(emptyStyle OutputFormatterStyleInterface) *OutputFormatterStyleStack
func (*OutputFormatterStyleStack) Clone ¶
func (s *OutputFormatterStyleStack) Clone() *OutputFormatterStyleStack
func (*OutputFormatterStyleStack) Current ¶
func (s *OutputFormatterStyleStack) Current() OutputFormatterStyleInterface
func (*OutputFormatterStyleStack) EmptyStyle ¶
func (s *OutputFormatterStyleStack) EmptyStyle() OutputFormatterStyleInterface
func (*OutputFormatterStyleStack) Pop ¶
func (s *OutputFormatterStyleStack) Pop(style OutputFormatterStyleInterface) OutputFormatterStyleInterface
func (*OutputFormatterStyleStack) Push ¶
func (s *OutputFormatterStyleStack) Push(style OutputFormatterStyleInterface)
func (*OutputFormatterStyleStack) Reset ¶
func (s *OutputFormatterStyleStack) Reset()
func (*OutputFormatterStyleStack) SetEmptyStyle ¶
func (s *OutputFormatterStyleStack) SetEmptyStyle(style OutputFormatterStyleInterface)
Click to show internal directories.
Click to hide internal directories.