Documentation
¶
Index ¶
- func ApplyTemplate(str string, object interface{}) string
- func AsJson(i 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 GetColorAttribute(key string) color.Attribute
- func GetGocuiAttribute(key string) gocui.Attribute
- func IncludesString(list []string, a string) bool
- func IsFocused(isFocused bool) func(c *RenderListConfig)
- func Loader() string
- func Max(x, y int) int
- func Min(x, y int) int
- func NextIndex(numbers []int, currentNumber int) int
- func NormalizeLinefeeds(str string) string
- func PrevIndex(numbers []int, currentNumber int) int
- 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 TrimTrailingNewline(str string) string
- func WithHeader(header []string) func(c *RenderListConfig)
- func WithPadding(str string, padding int) 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 GetColorAttribute ¶
GetColorAttribute gets the color attribute from the string
func GetGocuiAttribute ¶
GetGocuiAttribute gets the gocui color attribute from the string
func IncludesString ¶
IncludesString if the list contains the string
func IsFocused ¶
func IsFocused(isFocused bool) func(c *RenderListConfig)
func NormalizeLinefeeds ¶
NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func PrevIndex ¶
PrevIndex returns the index that comes before the given number, cycling if we reach the end
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 TrimTrailingNewline ¶
TrimTrailingNewline - Trims the trailing newline TODO: replace with `chomp` after refactor
func WithHeader ¶
func WithHeader(header []string) func(c *RenderListConfig)
func WithPadding ¶
WithPadding pads a string as much as you want