Documentation ¶
Index ¶
- 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 GetCurrentRepoName() string
- func GetProjectRoot() string
- func IncludesString(list []string, a string) bool
- func Loader() string
- 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{}, isFocused bool) (string, error)
- func ResolvePlaceholderString(str string, arguments map[string]string) string
- func SplitLines(multilineString string) []string
- func TrimTrailingNewline(str string) string
- func WithPadding(str string, padding int) string
- type Displayable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Decolorise ¶ added in v0.8.1
Decolorise strips a string of color
func GetCurrentRepoName ¶
func GetCurrentRepoName() string
GetCurrentRepoName gets the repo's base name
func GetProjectRoot ¶ added in v0.1.71
func GetProjectRoot() string
GetProjectRoot returns the path to the root of the project. Only to be used in testing contexts, as with binaries it's unlikely this path will exist on the machine
func IncludesString ¶ added in v0.8.1
IncludesString if the list contains the string
func Loader ¶ added in v0.2.0
func Loader() string
Loader dumps a string to be displayed as a loader
func NextIndex ¶ added in v0.8.1
NextIndex returns the index of the element that comes after the given number
func NormalizeLinefeeds ¶ added in v0.1.79
NormalizeLinefeeds - Removes all Windows and Mac style line feeds
func PrevIndex ¶ added in v0.8.1
PrevIndex returns the index that comes before the given number, cycling if we reach the end
func RenderList ¶ added in v0.8.1
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 ResolvePlaceholderString ¶ added in v0.8.1
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 WithPadding ¶
WithPadding pads a string as much as you want