Documentation ¶
Index ¶
- func ApplyTemplate(str string, object interface{}) string
- func ColoredString(str string, colorAttribute color.Attribute) string
- func ColoredStringDirect(str string, colour *color.Color) 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 IsFocused(isFocused bool) func(c *RenderListConfig)
- func Loader() string
- func Max(x, y int) int
- func NormalizeLinefeeds(str string) string
- func RenderList(slice interface{}, options ...func(*RenderListConfig)) (string, error)
- func RenderTable(stringArrays [][]string) (string, error)
- func ResolvePlaceholderString(str string, arguments map[string]string) string
- func SplitLines(multilineString string) []string
- func WithHeader(header []string) func(c *RenderListConfig)
- func WithPadding(str string, padding int) string
- func WithShortSha(str string) string
- type Displayable
- type RenderListConfig
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 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 IsFocused ¶
func IsFocused(isFocused bool) func(c *RenderListConfig)
func NormalizeLinefeeds ¶
NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func RenderList ¶
func RenderList(slice interface{}, options ...func(*RenderListConfig)) (string, error)
RenderList takes a slice of items, confirms they implement the Displayable interface, then generates a list of their displaystrings to write to a panel's buffer
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 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 WithHeader ¶
func WithHeader(header []string) func(c *RenderListConfig)
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