Documentation ¶
Index ¶
- Constants
- func AddOutputFlag(f *pflag.FlagSet, s *string, supportedFormats []Format, defaultFormat Format)
- func AddOutputParam(cmd *cobra.Command, supportedFormats []Format, defaultFormat Format) *cobra.Command
- func EventForMessage(message string) contracts.EventEnvelope
- func TabAlign(selections []string, padding int) ([]string, error)
- func WithBackticks(text string) string
- func WithBold(text string, a ...interface{}) string
- func WithErrorFormat(text string, a ...interface{}) string
- func WithGrayFormat(text string, a ...interface{}) string
- func WithHighLightFormat(text string, a ...interface{}) string
- func WithHyperlink(url string, text string) string
- func WithLinkFormat(link string, a ...interface{}) string
- func WithSuccessFormat(text string, a ...interface{}) string
- func WithUnderline(text string, a ...interface{}) string
- func WithWarningFormat(text string, a ...interface{}) string
- type Column
- type EnvVarsFormatter
- type Format
- type Formatter
- type JsonFormatter
- type Link
- type NoneFormatter
- type TableFormatter
- type TableFormatterOptions
Constants ¶
View Source
const ( TableColumnMinWidth = 10 TableTabSize = 4 TablePadSize = 2 TablePadCharacter = ' ' TableFlags = 0 )
Variables ¶
This section is empty.
Functions ¶
func AddOutputFlag ¶
func AddOutputParam ¶
func EventForMessage ¶
func EventForMessage(message string) contracts.EventEnvelope
jsonObjectForMessage creates a json object representing a message. Any ANSI control sequences from the message are removed. A trailing newline is added to the message.
func TabAlign ¶
TabAlign transforms translates tab-separated columns in input into properly aligned text with the given padding for separation. For more information, refer to the tabwriter package.
func WithBackticks ¶
WithBackticks wraps text with the backtick (`) character.
func WithErrorFormat ¶
func WithGrayFormat ¶
func WithHighLightFormat ¶
withHighLightFormat creates string with highlight-looking color
func WithHyperlink ¶
WithHyperlink wraps text with the colored hyperlink format escape sequence.
func WithLinkFormat ¶
withLinkFormat creates string with hyperlink-looking color
func WithSuccessFormat ¶
func WithUnderline ¶
func WithWarningFormat ¶
Types ¶
type EnvVarsFormatter ¶
type EnvVarsFormatter struct { }
func (*EnvVarsFormatter) Format ¶
func (f *EnvVarsFormatter) Format(obj interface{}, writer io.Writer, _ interface{}) error
func (*EnvVarsFormatter) Kind ¶
func (f *EnvVarsFormatter) Kind() Format
type Formatter ¶
type Formatter interface { Kind() Format Format(obj interface{}, writer io.Writer, opts interface{}) error }
func NewFormatter ¶
type JsonFormatter ¶
type JsonFormatter struct { }
func (*JsonFormatter) Format ¶
func (f *JsonFormatter) Format(obj interface{}, writer io.Writer, _ interface{}) error
func (*JsonFormatter) Kind ¶
func (f *JsonFormatter) Kind() Format
type NoneFormatter ¶
type NoneFormatter struct{}
func (*NoneFormatter) Format ¶
func (f *NoneFormatter) Format(obj interface{}, writer io.Writer, opts interface{}) error
func (*NoneFormatter) Kind ¶
func (f *NoneFormatter) Kind() Format
type TableFormatter ¶
type TableFormatter struct { }
func (*TableFormatter) Format ¶
func (f *TableFormatter) Format(obj interface{}, writer io.Writer, opts interface{}) error
func (*TableFormatter) Kind ¶
func (f *TableFormatter) Kind() Format
type TableFormatterOptions ¶
type TableFormatterOptions struct {
Columns []Column
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.