Documentation ¶
Index ¶
- func ApplyTemplate(str string, object interface{}) string
- func CloseMany(closers []io.Closer) error
- func ColoredString(str string, colorAttribute color.Attribute) string
- func ColoredStringDirect(str string, colour *color.Color) string
- func ColoredYamlString(str string) string
- func Decolorise(str string) string
- func FormatBinaryBytes(b int) string
- func FormatDecimalBytes(b int) string
- func FormatMap(padding int, m map[string]string) string
- func FormatMapItem(padding int, k string, v interface{}) string
- func GetColorAttribute(key string) color.Attribute
- func GetGocuiAttribute(key string) gocui.Attribute
- func IsValidHexValue(v string) bool
- func Loader() string
- func MarshalIntoYaml(data interface{}) ([]byte, error)
- func Max(x, y int) int
- func MultiColoredString(str string, colorAttribute ...color.Attribute) string
- func NormalizeLinefeeds(str string) string
- func OpensMenuStyle(str string) string
- func RenderTable(rows [][]string) (string, error)
- func ResolvePlaceholderString(str string, arguments map[string]string) string
- func SafeTruncate(str string, limit int) string
- func SplitLines(multilineString string) []string
- func WithPadding(str string, padding int) string
- func WithShortSha(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplate ¶
func ColoredString ¶
ColoredString takes a string and a colour attribute and returns a colored string with that attribute
func ColoredStringDirect ¶
ColoredStringDirect used for aggregating a few color attributes rather than just sending a single one
func ColoredYamlString ¶ added in v0.23.2
ColoredYamlString takes an YAML formatted string and returns a colored string with colors hardcoded as: keys: cyan Booleans: magenta Numbers: yellow Strings: green
func FormatBinaryBytes ¶
func FormatDecimalBytes ¶
func FormatMapItem ¶ added in v0.2.1
FormatMapItem is for displaying items in a map
func GetColorAttribute ¶
GetColorAttribute gets the color attribute from the string
func GetGocuiAttribute ¶
GetGocuiAttribute gets the gocui color attribute from the string
func IsValidHexValue ¶ added in v0.23.2
func MarshalIntoYaml ¶ added in v0.23.2
MarshalIntoYaml gets any json-tagged data and marshal it into yaml saving original json structure. Useful for structs from 3rd-party libs without yaml tags.
func MultiColoredString ¶ added in v0.23.2
MultiColoredString takes a string and an array of colour attributes and returns a colored string with those attributes
func NormalizeLinefeeds ¶
NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func OpensMenuStyle ¶ added in v0.23.2
Style used on menu items that open another menu
func RenderTable ¶
RenderTable takes an array of string arrays and returns a table containing the values
func ResolvePlaceholderString ¶
ResolvePlaceholderString populates a template with values
func SafeTruncate ¶ added in v0.23.2
func SplitLines ¶
SplitLines takes a multiline string and splits it on newlines currently we are also stripping \r's which may have adverse effects for windows users (but no issues have been raised yet)
func WithPadding ¶
WithPadding pads a string as much as you want
func WithShortSha ¶ added in v0.2.1
WithShortSha returns a command but with a shorter SHA. in the terminal we're all used to 10 character SHAs but under the hood they're actually 64 characters long. No need including all the characters when we're just displaying a command
Types ¶
This section is empty.