Documentation
¶
Index ¶
- Constants
- func Colorize(text, color string, enabled bool) string
- func GetColor(ctx context.Context) string
- func GetFormat(ctx context.Context) string
- func GetQuery(ctx context.Context) string
- func Output(ctx context.Context, data any, textFn func(io.Writer)) error
- func OutputWithQuery(format, query string, data any, textFn func(io.Writer)) error
- func ShouldColorize(mode string) bool
- func WithColor(ctx context.Context, mode string) context.Context
- func WithFormat(ctx context.Context, format string) context.Context
- func WithQuery(ctx context.Context, query string) context.Context
- func WriteJSON(w io.Writer, data any) error
- func WriteJSONPretty(w io.Writer, data any) error
- func WriteJSONWithQuery(w io.Writer, data any, queryStr string) error
- type ColorMode
- type TableWriter
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Magenta = "\033[35m" Cyan = "\033[36m" Gray = "\033[90m" )
ANSI color codes
Variables ¶
This section is empty.
Functions ¶
func OutputWithQuery ¶
func ShouldColorize ¶
ShouldColorize returns true if output should be colorized
Types ¶
type TableWriter ¶
type TableWriter struct {
// contains filtered or unexported fields
}
func NewTableWriter ¶
func NewTableWriter(w io.Writer) *TableWriter
func (*TableWriter) Append ¶
func (t *TableWriter) Append(row []string)
func (*TableWriter) Render ¶
func (t *TableWriter) Render()
func (*TableWriter) SetHeader ¶
func (t *TableWriter) SetHeader(headers []string)
Click to show internal directories.
Click to hide internal directories.