Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTermenvStyle ¶
func NewTermenvStyle(p termenv.Profile, in FormatPrimitive) termenv.Style
Types ¶
type Config ¶
type Config struct { Formatting Formatting `json:"formatting,omitempty" yaml:"formatting,omitempty"` Layout Layout `json:"layout,omitempty" yaml:"layout,omitempty"` }
Config holds style configuration.
func DefaultConfig ¶
DefaultConfig returns default style config.
type Date ¶
type Date struct {
EnableHumanizedSuffix bool `json:"enableHumanizedSuffix" yaml:"enableHumanizedSuffix"`
}
Date holds template 'date' func related settings.
type FormatPrimitive ¶
type FormatPrimitive struct { Color string `json:"color" yaml:"color"` Background string `json:"background" yaml:"background"` Options []string `json:"options" yaml:"options"` }
FormatPrimitive holds general formatting options.
type Formatting ¶
type Formatting struct { Header Header `json:"header" yaml:"header"` Key Key `json:"key" yaml:"key"` Val Val `json:"val" yaml:"val"` Date Date `json:"date" yaml:"date"` }
Formatting holds formatting settings.
func DefaultFormatting ¶
func DefaultFormatting() Formatting
type GoTemplateRender ¶
type GoTemplateRender struct {
// contains filtered or unexported fields
}
GoTemplateRender provides a functionality to render input data based on a given style.
func NewGoTemplateRender ¶
func NewGoTemplateRender(cfg *Config) *GoTemplateRender
NewGoTemplateRender returns new GoTemplateRender instance.
type Header ¶
type Header struct { Prefix string `json:"prefix" yaml:"prefix"` FormatPrimitive `json:",inline" yaml:",inline"` }
Header holds template 'header' func related settings.
type Key ¶
type Key struct {
FormatPrimitive `json:",inline" yaml:",inline"`
}
Key holds template 'key' func related settings.
type Layout ¶
type Layout struct { // GoTemplate defines layout in with Go template syntax. GoTemplate string `json:"goTemplate,omitempty" yaml:"goTemplate,omitempty"` }
Layout define the layout for printing the pretty format.
type Val ¶
type Val struct {
FormatPrimitive `json:",inline" yaml:",inline"`
}
Val holds template 'val' func related settings.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.